Repository navigation
Commit 17a4a9d
committed
fix(P2): add bidi control character detection (CVE-2021-42574 / Trojan Source)
P2_PATTERNS was missing Unicode bidi override/embedding/isolate characters
(U+202A-U+202E, U+2066-U+2069) that can be used to hide malicious
instructions from human code review while the LLM sees and executes them.
Add the range with confidence 0.85 (higher than plain zero-width chars
because bidi controls have almost no legitimate use in AI skill content).
Closes #39
Signed-off-by: Lalit Shrotriya <[email protected]>1 parent a5092dd commit 17a4a9d
2 files changed
Lines changed: 26 additions & 0 deletions
File tree
- src/skillspector/nodes/analyzers
- tests/nodes/analyzers
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
51 | 51 | | |
52 | 52 | | |
53 | 53 | | |
| 54 | + | |
54 | 55 | | |
55 | 56 | | |
56 | 57 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
66 | 66 | | |
67 | 67 | | |
68 | 68 | | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
69 | 94 | | |
70 | 95 | | |
71 | 96 | | |
| |||
0 commit comments