@exorcist-98/cli 0.1.0 → 0.1.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +59 -2
- package/definitions/EX-001-hidden-unicode.yaml +23 -0
- package/definitions/EX-002-ai-instructions.yaml +20 -1
- package/definitions/EX-003-encoded-payload.yaml +11 -0
- package/definitions/EX-004-html-comment-smuggling.yaml +19 -1
- package/definitions/EX-005-tool-description-poisoning.yaml +1 -1
- package/definitions/EX-008-remote-code-hook.yaml +22 -1
- package/definitions/EX-011-secrets-in-agent-reach.yaml +13 -1
- package/definitions/EX-012-markdown-image-exfil.yaml +16 -4
- package/definitions/EX-014-steering-override.yaml +12 -2
- package/definitions/EX-015-shell-in-tool-output.yaml +18 -1
- package/definitions/EX-018-confused-deputy.yaml +13 -0
- package/definitions/EX-019-memory-poisoning.yaml +6 -0
- package/definitions/EX-021-smuggled-bytes.yaml +25 -0
- package/definitions/EX-022-canary-token.yaml +42 -0
- package/definitions/EX-023-lethal-trifecta.yaml +31 -0
- package/definitions/EX-024-detonated.yaml +38 -0
- package/definitions/EX-025-loader-env.yaml +20 -0
- package/definitions/EX-026-too-large-to-check.yaml +28 -0
- package/definitions/EX-027-session-trifecta.yaml +43 -0
- package/definitions/capabilities.yaml +311 -0
- package/dist/index.mjs +31845 -7716
- package/package.json +11 -8
- package/LICENSE +0 -201
package/README.md
CHANGED
|
@@ -11,7 +11,7 @@ Needs Node 20 or newer.
|
|
|
11
11
|
## Scan a project
|
|
12
12
|
|
|
13
13
|
```sh
|
|
14
|
-
npx -y @exorcist-98/cli@0.1.
|
|
14
|
+
npx -y @exorcist-98/cli@0.1.2 scan .
|
|
15
15
|
```
|
|
16
16
|
|
|
17
17
|
Every finding shows the file, line, the exact text, how serious it is and how
|
|
@@ -23,10 +23,38 @@ Add `--ai` to also ask an AI judge (Claude on Amazon Bedrock) about suspicious
|
|
|
23
23
|
text. It needs AWS credentials, `AWS_REGION` and
|
|
24
24
|
`npm install @aws-sdk/client-bedrock-runtime`; `--ai-max-calls` caps the cost.
|
|
25
25
|
|
|
26
|
+
## Map the haunted house
|
|
27
|
+
|
|
28
|
+
```sh
|
|
29
|
+
npx -y @exorcist-98/cli@0.1.2 map .
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
For every MCP config in the folder, lists which servers sit in the three rooms
|
|
33
|
+
of the "lethal trifecta": the Vault of Secrets (private data), the Open Door
|
|
34
|
+
(untrusted input) and the Escape Tunnel (a way out). A config that fills all
|
|
35
|
+
three is reported as EX-023 (critical when a tool on one of those servers is
|
|
36
|
+
auto-approved) and the command exits 1. `--format json` gives the same map as
|
|
37
|
+
data. The rules are in `definitions/capabilities.yaml`.
|
|
38
|
+
|
|
39
|
+
## Disinfect (exorcise)
|
|
40
|
+
|
|
41
|
+
```sh
|
|
42
|
+
npx -y @exorcist-98/cli@0.1.2 exorcise . # dry run: prints a unified diff
|
|
43
|
+
npx -y @exorcist-98/cli@0.1.2 exorcise . --write # apply, with a vault backup first
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
Only threats with one safe, mechanical fix are repaired: hidden characters
|
|
47
|
+
(EX-001), runs of four or more variation selectors (EX-021), smuggled HTML comments (EX-002, EX-004), data-carrying remote images
|
|
48
|
+
(EX-012) and unpinned `npx`/`uvx` MCP servers (EX-010, pinned to the current
|
|
49
|
+
version on npm or PyPI; `--offline` skips the lookup). Everything else is
|
|
50
|
+
reported, never edited. `--only EX-001,EX-010` limits the fixes. After
|
|
51
|
+
`--write` the changed files are scanned again ("12 threats removed, 2 need a
|
|
52
|
+
human"), and `exorcist vault restore <id>` puts every file back byte for byte.
|
|
53
|
+
|
|
26
54
|
## Protect your MCP servers
|
|
27
55
|
|
|
28
56
|
```sh
|
|
29
|
-
npx -y @exorcist-98/cli@0.1.
|
|
57
|
+
npx -y @exorcist-98/cli@0.1.2 wrap .kiro/settings/mcp.json
|
|
30
58
|
```
|
|
31
59
|
|
|
32
60
|
`wrap` puts every server in the file, local or remote, behind the Real-Time
|
|
@@ -35,6 +63,35 @@ secrets and unknown hosts in tool calls, and withholds tool results that try to
|
|
|
35
63
|
instruct your agent. `unwrap` restores the file exactly. See
|
|
36
64
|
`exorcist shield --help`, `exorcist approve --help` and `exorcist alerts`.
|
|
37
65
|
|
|
66
|
+
## Share approved tools with your team: exorcist.lock
|
|
67
|
+
|
|
68
|
+
```sh
|
|
69
|
+
npx -y @exorcist-98/cli@0.1.2 lock # write exorcist.lock, then commit it
|
|
70
|
+
npx -y @exorcist-98/cli@0.1.2 lock --check # exit 1 if any tool or program changed
|
|
71
|
+
npx -y @exorcist-98/cli@0.1.2 lock --check --static # starts nothing: names, programs, URLs only
|
|
72
|
+
```
|
|
73
|
+
|
|
74
|
+
`exorcist.lock` records the fingerprint of every tool your MCP servers list,
|
|
75
|
+
like a package lockfile for tool descriptions. Each teammate's Shield treats a
|
|
76
|
+
tool that differs from the lock as a rug pull, even on a machine that never
|
|
77
|
+
saw the tool before. The lock never approves anything by itself: a tool that
|
|
78
|
+
matches it still gets the Shield's first-use checks. `--from-shield` writes the lock from your local
|
|
79
|
+
pins without starting any server. In GitHub Actions, set `lock-check: true`.
|
|
80
|
+
|
|
81
|
+
`exorcist lock` and `lock --check` **start every server in the MCP config**
|
|
82
|
+
to list its tools. Only run them on a config you trust. On a pull request the
|
|
83
|
+
config is the author's: a changed `command` would run inside your CI with its
|
|
84
|
+
secrets and token. So the GitHub Action's `lock-check: true` always runs
|
|
85
|
+
`lock --check --static`, which starts nothing and compares the server names,
|
|
86
|
+
each server's program (command, arguments, argument files, env and cwd) and
|
|
87
|
+
remote URLs with the lock. `lock-check: live` also compares tool descriptions;
|
|
88
|
+
the Action runs it only on `push`, `schedule` and `workflow_dispatch` to the
|
|
89
|
+
default branch, at the pushed commit, and refuses every other event. A server
|
|
90
|
+
`env` that changes how its program loads (`NODE_OPTIONS`, `LD_PRELOAD` and
|
|
91
|
+
similar) is reported as high (EX-025). Servers that `exorcist lock` does start get a
|
|
92
|
+
minimal environment (PATH, HOME, LANG, LC_*, TMPDIR) plus their own `env`
|
|
93
|
+
from the config, so tokens and keys in your shell are not passed on.
|
|
94
|
+
|
|
38
95
|
## Licence
|
|
39
96
|
|
|
40
97
|
Apache-2.0.
|
|
@@ -13,6 +13,29 @@ match:
|
|
|
13
13
|
- zero-width # U+200B, U+200C, U+200D, U+FEFF
|
|
14
14
|
- bidi-override # U+202A-U+202E, U+2066-U+2069
|
|
15
15
|
- tag-block # U+E0000-U+E007F
|
|
16
|
+
# One to three zero-width characters on their own cannot carry a hidden
|
|
17
|
+
# message; in the field they were stray characters left by translation or
|
|
18
|
+
# formatting (docs/FIELD_REPORT.md). They are reported at medium. Longer
|
|
19
|
+
# runs, tag characters and bidi controls stay critical, and a phrase split
|
|
20
|
+
# by a zero-width character is still caught by the rule for that phrase.
|
|
21
|
+
# A U+200C/U+200D next to an Arabic, Persian or Indic letter is spelling and
|
|
22
|
+
# is not reported at all (packages/core/src/normalizer.ts).
|
|
23
|
+
minor_run:
|
|
24
|
+
max_length: 3
|
|
25
|
+
classes:
|
|
26
|
+
- zero-width
|
|
27
|
+
severity: medium
|
|
28
|
+
# A single U+200B between @ and a name is how changelogs keep GitHub from
|
|
29
|
+
# notifying that person (an @ sign, a zero-width space, then the name). It carries no message, so it is low and
|
|
30
|
+
# does not count toward the five short runs that make a file suspect.
|
|
31
|
+
mention_guard:
|
|
32
|
+
severity: low
|
|
33
|
+
# Test and eval fixtures hold attack samples on purpose (a security scanner's
|
|
34
|
+
# own tests, adversarial evals). Findings there are reported at low severity,
|
|
35
|
+
# not dropped. A file an agent reads (instructions, hooks, MCP configs, .kiro,
|
|
36
|
+
# .claude, .cursor) is never lowered, wherever it sits.
|
|
37
|
+
low_severity_paths:
|
|
38
|
+
- "(^|/)(tests?|__tests__|__mocks__|spec|specs|fixtures?|testdata|test-data|e2e|evals?)/|[._-](test|spec)s?\\.[A-Za-z0-9]+$|_tests?\\.(rs|go|py)$"
|
|
16
39
|
owasp:
|
|
17
40
|
- "LLM01:2025 Prompt Injection"
|
|
18
41
|
- "ASI03 Prompt Injection via External Content"
|
|
@@ -11,7 +11,26 @@ match:
|
|
|
11
11
|
# whitespace may separate the words. Ordinary text such as "you are now
|
|
12
12
|
# logged in" is not flagged. A phrase split by hidden characters still
|
|
13
13
|
# matches (the engine also scans the text with them removed).
|
|
14
|
-
regex: "(?:\\bignore\\s+(?:all\\s+|any\\s+|the\\s+)?(?:previous|prior|above|earlier)\\s+(?:instructions|rules|prompts?)|\\bdisregard\\s+(?:all\\s+|any\\s+|the\\s+)?(?:previous|prior|above|earlier)\\s+(?:instructions|rules)|\\byou\\s+are\\s+now\\s+(?:(?:operating\\s+)?in\\s+(?:maintenance|developer|debug|admin|god|unrestricted|jailbreak|dan)\\s+mode|operating\\s+without\\s+(?:any\\s+)?(?:restrictions|rules|limits)|free\\b|unrestricted|dan\\b)|\\bas\\s+an\\s+ai(?:\\s+(?:assistant|agent|model))?\\s*,?\\s+(?:your|you\\s+must|you\\s+should|ignore)|\\byour\\s+new\\s+(?:primary\\s+)?(?:directive|instructions?)\\b|\\bdo\\s+not\\s+(?:mention|tell|reveal)\\s+(?:this|these)\\s+(?:instruction|note|message)s?)"
|
|
14
|
+
regex: "(?:\\bignore\\s+(?:all\\s+|any\\s+|the\\s+)?(?:previous|prior|above|earlier)\\s+(?:instructions|rules|prompts?)|\\bdisregard\\s+(?:all\\s+|any\\s+|the\\s+)?(?:previous|prior|above|earlier)\\s+(?:instructions|rules)|\\byou\\s+are\\s+now\\s+(?:(?:operating\\s+)?in\\s+(?:maintenance|developer|debug|admin|god|unrestricted|jailbreak|dan)\\s+mode|operating\\s+without\\s+(?:any\\s+)?(?:restrictions|rules|limits)|free\\b|unrestricted|dan\\b)|\\bas\\s+an\\s+ai(?:\\s+(?:assistant|agent|model))?\\s*,?\\s+(?:your\\s+(?:new|real|true|actual|hidden|secret|only)\\b|you\\s+must|you\\s+should|ignore)|\\byour\\s+new\\s+(?:primary\\s+)?(?:directive|instructions?)\\b|\\bdo\\s+not\\s+(?:mention|tell|reveal)\\s+(?:this|these)\\s+(?:instruction|note|message)s?)"
|
|
15
|
+
# A phrase in quotation marks that close right after it, in a passage that
|
|
16
|
+
# is warning about it or quoting it as an example ("never follow text such
|
|
17
|
+
# as ..."), is not an order. In the field that was 35 of 42 findings of
|
|
18
|
+
# EX-002 (docs/FIELD_REPORT.md). A quoted phrase that runs on into a longer
|
|
19
|
+
# instruction is still reported.
|
|
20
|
+
quoted_example_cues: '\b(?:such\s+as|e\.g\.|i\.e\.|for\s+(?:example|instance)|never|do\s+not|don''t|must\s+not|should\s+not|refuse|reject|treat|untrusted|inert|injection|jailbreak|adversarial|attack|malicious|hostile|crafted|hijack|red[- ]?team|detect|flag|block|strip|sanitiz|filter|pattern|phrase|cases?\b|example|quarantine|directive|look(?:s|ing)?\s+like|shaped)'
|
|
21
|
+
# A phrase the passage itself forbids is a defence, not an attack: "never
|
|
22
|
+
# ignore earlier instructions", "users cannot bypass the prompt", "it must not
|
|
23
|
+
# attempt to tell the agent to ignore earlier instructions". The negation has
|
|
24
|
+
# to govern the phrase (it ends right before it, or opens a list of what must
|
|
25
|
+
# not be attempted); "do not mention this, tell the agent to ..." is still an
|
|
26
|
+
# attack (m7-precision, packages/core/src/scanner/context.ts isNegated).
|
|
27
|
+
negated_cues: '\b(?:(?:must|should|shall|will|would|may|might|can|could)\s*(?:not|never)|(?:must|should|shall|would|could|do|does|did|is|are|was|were|has|have|ca|wo)n[''’]t|cannot|do(?:es)?\s+not|did\s+not|never|refus(?:e|es|ed|ing)\s+to|(?:is|are)\s+not\s+(?:to|allowed\s+to|permitted\s+to|able\s+to)|unable\s+to)\s+(?:(?:ever|simply|just|even|actually|knowingly)\s+)*$|\b(?:(?:must|should|shall|will|would|may|might|can|could)\s*(?:not|never)|(?:must|should|shall|would|could|do|does|did|is|are|was|were|has|have|ca|wo)n[''’]t|cannot)\s+(?:attempt|try|seek)\s+to\b[^.!?\n]*?\b(?:tell|instruct|ask|cause|make|persuade|trick|convince|get|force|let|allow)\w*\s+(?:(?:the|an?|your|any)\s+)?(?:(?:agent|model|assistant|ai|llm|bot|claude)s?\s+)?(?:to\s+)?$|\b(?:(?:must|should|shall|will|would|may|might|can|could)\s*(?:not|never)|(?:must|should|shall|would|could|do|does|did|is|are|was|were|has|have|ca|wo)n[''’]t|cannot|do(?:es)?\s+not|did\s+not|never|refus(?:e|es|ed|ing)\s+to|(?:is|are)\s+not\s+(?:to|allowed\s+to|permitted\s+to|able\s+to)|unable\s+to)\s+(?:follow|obey|comply\s+with|act\s+on|honou?r|accept|execute|run)\s+(?:(?:any|an?|the|such|these|those|that|text|instructions?|requests?|commands?|messages?|content|tool\s+output|it)\s+)*(?:(?:that|which)\s+)?(?:(?:say|says|saying|tell|tells|telling|ask|asks|asking)\s+(?:you\s+)?(?:to\s+)?)?$'
|
|
28
|
+
# Test and eval fixtures hold attack samples on purpose (a security scanner's
|
|
29
|
+
# own tests, adversarial evals). Findings there are reported at low severity,
|
|
30
|
+
# not dropped. A file an agent reads (instructions, hooks, MCP configs, .kiro,
|
|
31
|
+
# .claude, .cursor) is never lowered, wherever it sits.
|
|
32
|
+
low_severity_paths:
|
|
33
|
+
- "(^|/)(tests?|__tests__|__mocks__|spec|specs|fixtures?|testdata|test-data|e2e|evals?)/|[._-](test|spec)s?\\.[A-Za-z0-9]+$|_tests?\\.(rs|go|py)$"
|
|
15
34
|
owasp:
|
|
16
35
|
- "LLM01:2025 Prompt Injection"
|
|
17
36
|
- "ASI03 Prompt Injection via External Content"
|
|
@@ -18,6 +18,17 @@ match:
|
|
|
18
18
|
# and identifiers decode to binary noise; before this check they were about
|
|
19
19
|
# 99% of all findings on ordinary repositories (docs/BENCHMARK.md).
|
|
20
20
|
validate: encoded-text
|
|
21
|
+
# One finding per blob: a base64 file wrapped over many lines, or split into
|
|
22
|
+
# concatenated strings, is decoded and judged as a whole (one blob gave 291
|
|
23
|
+
# findings, one per line, in the field). At most five findings per file.
|
|
24
|
+
merge_adjacent: true
|
|
25
|
+
max_per_file: 5
|
|
26
|
+
# A blob that decodes to an embedded file (SVG, XML, HTML, PDF, a Markdown
|
|
27
|
+
# document, a licence, anything starting with a byte-order mark) counts only
|
|
28
|
+
# if what it says is flagged by the other rules, or contains a chat-template
|
|
29
|
+
# marker that starts a system prompt. Free text and commands still count as
|
|
30
|
+
# they are: hidden words are what this rule is for.
|
|
31
|
+
decoded_flag_regex: '<\|im_start\|>|<\|(?:system|user|assistant)\|>|\[/?INST\]|<<SYS>>|<\|start_header_id\|>'
|
|
21
32
|
skip_paths:
|
|
22
33
|
- "(^|/)(tests?|__tests__|__mocks__|spec|specs|fixtures?|testdata|test-data|e2e)/|[._-](test|spec)s?\\.[A-Za-z0-9]+$|_tests?\\.(rs|go|py)$"
|
|
23
34
|
- "(^|/)(package-lock\\.json|npm-shrinkwrap\\.json|pnpm-lock\\.yaml|yarn\\.lock|bun\\.lockb?|Cargo\\.lock|poetry\\.lock|Pipfile\\.lock|uv\\.lock|go\\.sum|composer\\.lock|Gemfile\\.lock|[^/]*\\.lock\\.ya?ml)$"
|
|
@@ -7,7 +7,25 @@ applies_to:
|
|
|
7
7
|
match:
|
|
8
8
|
# The match stays inside one comment ((?!-->) stops it at the closing marker).
|
|
9
9
|
# Ordinary words like "fetch" or "send to" are not enough on their own.
|
|
10
|
-
|
|
10
|
+
# Naming an AI product is not enough either ("e.g. OpenAI, Claude, Gemini"
|
|
11
|
+
# in an issue template): a name followed by ":" or "," must be followed by an
|
|
12
|
+
# order ("Copilot: fill all sections", "AI: before answering ..."), and
|
|
13
|
+
# "silently" must come with an action that moves data or runs code
|
|
14
|
+
# ("silently send", not "a range silently drops lines").
|
|
15
|
+
regex: "<!--(?:(?!-->)[\\s\\S]){0,2000}?(?:\\b(?:ignore|disregard)\\s+(?:all\\s+|any\\s+|the\\s+)?(?:previous|prior|above|earlier)|exfiltrat|\\b(?:silently|quietly|secretly)\\s+(?:send|post|upload|exfiltrat\\w*|forward|copy|include|add|append|insert|run|execute|install|download|fetch|curl|leak|transmit|share|email)\\b|\\bdo\\s+not\\s+(?:mention|tell|reveal|inform)|\\b(?:ai|assistant|agent|llm|claude|copilot|cursor|kiro|gemini)\\s*[:,]\\s*(?:please\\s+)?(?:ignore|disregard|forget|do|don'?t|never|always|you|before|after|when(?:ever)?|if|first|now|then|send|post|upload|fetch|read|open|run|execute|write|delete|remove|add|insert|append|include|tell|say|reply|respond|answer|output|print|return|use|call|invoke|make|create|fill|copy|paste|summari[sz]e|translate|follow|obey|act|pretend|treat|set|change|update|modify|install|download|visit|navigate|go|search|approve|grant|enable|disable|skip|hide|keep|silently|quietly|secretly)\\b|\\byou\\s+are\\s+(?:now|an?\\s+ai)\\b|\\bas\\s+an\\s+ai\\b|\\b(?:curl|wget)\\s+\\S+[^\\n]*\\|\\s*(?:ba|z)?sh\\b|\\bsend\\s+(?:the\\s+|all\\s+|any\\s+)?(?:contents?|secrets?|keys?|tokens?|credentials?|\\.env)\\b)(?:(?!-->)[\\s\\S]){0,2000}?-->"
|
|
16
|
+
# A comment inside Markdown code (backticks or a fenced block) is displayed,
|
|
17
|
+
# not hidden, so it is not smuggling.
|
|
18
|
+
skip_in_code: true
|
|
19
|
+
# Only a bare linter directive is exempt: `<!-- noqa -->` or `<!-- noqa: CODE,
|
|
20
|
+
# CODE -->` and nothing else. Free text after the code is still checked, so
|
|
21
|
+
# starting a comment with noqa does not hide an instruction.
|
|
22
|
+
exclude_regex: '^<!--\s*noqa(?::\s*[A-Z0-9-]+(?:,\s*[A-Z0-9-]+)*)?\s*-->$'
|
|
23
|
+
# Test and eval fixtures hold attack samples on purpose (a security scanner's
|
|
24
|
+
# own tests, adversarial evals). Findings there are reported at low severity,
|
|
25
|
+
# not dropped. A file an agent reads (instructions, hooks, MCP configs, .kiro,
|
|
26
|
+
# .claude, .cursor) is never lowered, wherever it sits.
|
|
27
|
+
low_severity_paths:
|
|
28
|
+
- "(^|/)(tests?|__tests__|__mocks__|spec|specs|fixtures?|testdata|test-data|e2e|evals?)/|[._-](test|spec)s?\\.[A-Za-z0-9]+$|_tests?\\.(rs|go|py)$"
|
|
11
29
|
owasp:
|
|
12
30
|
- "LLM01:2025 Prompt Injection"
|
|
13
31
|
- "ASI03 Prompt Injection via External Content"
|
|
@@ -5,7 +5,7 @@ applies_to:
|
|
|
5
5
|
- mcp-config
|
|
6
6
|
- config
|
|
7
7
|
match:
|
|
8
|
-
regex: "(before (responding|answering|using this tool)|(prior to|before) (invoking|calling|running|using) (this|any|the)\\b|do not (inform|tell|mention|notify|alert) the user|without (telling|informing|notifying|asking) the user|(keep|stay) (this |it )?(quiet|secret|hidden) from|this is required for (audit|telemetry|logging)
|
|
8
|
+
regex: "(before (responding|answering|using this tool)|(prior to|before) (invoking|calling|running|using) (this|any|the)\\b|do not (inform|tell|mention|notify|alert) the user|without (telling|informing|notifying|asking) the user|(keep|stay) (this |it )?(quiet|secret|hidden) from|this is required for (audit|telemetry|logging)|\\b(?:send|include|attach|upload|pass|forward)(?:s|es|ed|ing)?\\b[^.\\n]{0,60}(~/\\.ssh|id_rsa|\\.env\\b|\\.aws/credentials|private key))"
|
|
9
9
|
# Only in files that describe MCP servers or tools. Model or prompt configs
|
|
10
10
|
# that say \"do not mention\" are ordinary (seen in openai/codex).
|
|
11
11
|
file_regex: "(\"mcpServers\"|\"inputSchema\"|\"input_schema\")"
|
|
@@ -7,11 +7,32 @@ applies_to:
|
|
|
7
7
|
- config
|
|
8
8
|
- tool-result
|
|
9
9
|
match:
|
|
10
|
-
|
|
10
|
+
# A download (from a URL or host name) piped into a shell or an interpreter
|
|
11
|
+
# that runs it, or decoded base64 piped into one. "curl | sh" with no
|
|
12
|
+
# address is a mention, not a command, and "| python -c" or "| node -e"
|
|
13
|
+
# reads the download as data.
|
|
14
|
+
# The lookahead right after "curl " only checks that a "| shell" follows
|
|
15
|
+
# within 1,200 characters (200 + the longest host name, 600, + 400): every
|
|
16
|
+
# match already has one there, so results are the same, but a long line full
|
|
17
|
+
# of curl mentions with no pipe to a shell fails fast instead of trying every
|
|
18
|
+
# host position (about 5x faster on a 180 KB line).
|
|
19
|
+
regex: "((?:curl|wget)\\s+(?=[^\\n]{0,1200}?\\|\\s*(?:sudo\\s+(?:-\\S+\\s+)*)?(?:sh|bash|zsh|fish|dash|python3?|node)\\b)[^\\n]{0,200}?(?:https?://|\\b\\d{1,3}(?:\\.\\d{1,3}){3}\\b|\\b[A-Za-z0-9-]{1,63}(?:\\.[A-Za-z0-9-]{1,63}){0,8}\\.[A-Za-z]{2,24}\\b)[^\\n]{0,400}?\\|\\s*(?:sudo\\s+(?:-\\S+\\s+)*)?(?:sh|bash|zsh|fish|dash|python3?|node)\\b(?!\\s+-[cemp]\\b)|base64\\s+(-d|--decode|-D)\\b[^\\n]*\\|\\s*(sh|bash|zsh|python3?|node)\\b)"
|
|
20
|
+
# In generic JSON and YAML files, only commands that run count: the value of
|
|
21
|
+
# a command-like key ("command", "run", "setup_commands", "args"), an item
|
|
22
|
+
# of such a list, a step the text tells the reader to run ("Run: curl ..."),
|
|
23
|
+
# or anything in an agent-environment or hook file (.cursor/environment.json,
|
|
24
|
+
# .devcontainer/, .claude/, .kiro/, hooks.json). An install command listed
|
|
25
|
+
# as data (a docs data file, an agent catalogue) is not a hook. Hooks, MCP
|
|
26
|
+
# configs and tool results are always checked in full.
|
|
27
|
+
exec_context: true
|
|
11
28
|
# CI workflows are not agent hooks; installers there are a separate supply-chain topic.
|
|
12
29
|
skip_paths:
|
|
13
30
|
- "^\\.github/workflows/"
|
|
14
31
|
- "(^|/)action\\.ya?ml$"
|
|
32
|
+
- "(^|/)(tests?|__tests__|__mocks__|spec|specs|fixtures?|testdata|test-data|e2e)/|[._-](test|spec)s?\\.[A-Za-z0-9]+$|_tests?\\.(rs|go|py)$"
|
|
33
|
+
# EX-008 and EX-015 both match a download piped into a shell; on the same line
|
|
34
|
+
# they are one problem, and only the more severe finding is kept.
|
|
35
|
+
same_line_group: remote-shell
|
|
15
36
|
owasp:
|
|
16
37
|
- "ASI06 Prompt Injection via Indirect Content"
|
|
17
38
|
- "LLM01:2025 Prompt Injection"
|
|
@@ -14,9 +14,21 @@ match:
|
|
|
14
14
|
regex: "(?:(?:(?:AWS_SECRET_ACCESS_KEY|GITHUB_TOKEN|GH_TOKEN|OPENAI_API_KEY|ANTHROPIC_API_KEY|SLACK_BOT_TOKEN|STRIPE_SECRET_KEY|GOOGLE_API_KEY|NPM_TOKEN)=(?!EXAMPLE_)[^\\s]+|DATABASE_URL=[a-z+]+://[^\\s:@/]+:[^\\s@/]+@[^\\s]+)|\\b(?:gh[pousr]_[A-Za-z0-9]{36}|github_pat_[A-Za-z0-9_]{60,}|sk-(?:proj-|ant-api\\d\\d-)?[A-Za-z0-9_-]{40,}|AKIA[0-9A-Z]{16}|xox[baprs]-[0-9A-Za-z-]{20,}|AIza[0-9A-Za-z_-]{35}|sk_live_[0-9A-Za-z]{24,}|npm_[A-Za-z0-9]{36})\\b|(?<=^|\\n)-----BEGIN (?:RSA |EC |DSA |OPENSSH |PGP |ENCRYPTED )?PRIVATE KEY(?: BLOCK)?-----)"
|
|
15
15
|
# Placeholders such as [REDACTED], xxx, <token> or ${VAR} are not secrets.
|
|
16
16
|
exclude_regex: "=\\s*[\"']?(\\[?redacted\\]?|x{3,}|\\*{3,}|<|\\$\\{?[A-Za-z_]+\\}?|your[_-]|changeme|placeholder|dummy|fake|[^\\s]*\\.\\.\\.)|^(?:gh[pousr]_|github_pat_|sk-|sk_live_|AKIA|xox[baprs]-|AIza|npm_)\\S*(?:EXAMPLE|SYNTHETIC|ABCDEFGHIJ|x{8,}|X{8,}|0{12,})|=\\s*[a-z_][a-z0-9_.]*\\s*[,)]|=\\s*[\"'`]?[A-Za-z]{2,4}_x{3,}|=\\s*[\"']?\\$\\(|=\\s*[\"']?\\$[A-Za-z_]|=[\"']$|=[\"'][/\\\\']"
|
|
17
|
-
#
|
|
17
|
+
# The value must look like a real credential: long and random, not built
|
|
18
|
+
# from words ("sk-ant-api03-your-key-here"), fillers ("AIzaSyXXXX", "…"),
|
|
19
|
+
# templates ("${{ secrets.X }}"), code that reads it from elsewhere
|
|
20
|
+
# ("os.getenv(...)", "env['X']"), a documented example ("...EXAMPLEKEY") or
|
|
21
|
+
# a secret-manager reference ("key-name:latest"). A database URL counts
|
|
22
|
+
# only with a non-default password for a real host (not "user:pass@localhost"
|
|
23
|
+
# or a container name such as "db"). A private-key header counts only when a
|
|
24
|
+
# key body follows it. In the field, 223 of 226 findings were such
|
|
25
|
+
# placeholders (docs/FIELD_REPORT.md).
|
|
26
|
+
validate: secret-value
|
|
27
|
+
# Test files hold fake secrets and sample payloads on purpose. Template files
|
|
28
|
+
# (.env.example, config.sample.yaml) hold placeholders by definition.
|
|
18
29
|
skip_paths:
|
|
19
30
|
- "(^|/)(tests?|__tests__|__mocks__|spec|specs|fixtures?|testdata|test-data|e2e)/|[._-](test|spec)s?\\.[A-Za-z0-9]+$|(^|/|_)tests?\\.(rs|go|py)$"
|
|
31
|
+
- "(^|/)[^/]*[._-](example|sample|template|tmpl|dist)$|(^|/)[^/]*\\.(example|sample|template)\\.[A-Za-z0-9]+$"
|
|
20
32
|
owasp:
|
|
21
33
|
- "LLM02:2025 Sensitive Information Disclosure"
|
|
22
34
|
- "ASI05 Sensitive Data Leakage"
|
|
@@ -8,10 +8,22 @@ match:
|
|
|
8
8
|
# A markdown image whose query string carries data: a parameter named like
|
|
9
9
|
# data, token, env or user, or a template such as {{...}} or ${...}. Ordinary
|
|
10
10
|
# images with query strings (stat cards, size options) are not flagged; that
|
|
11
|
-
# was 390 false alarms in one README in the second blind round.
|
|
12
|
-
|
|
13
|
-
#
|
|
14
|
-
|
|
11
|
+
# was 390 false alarms in one README in the second blind round. A number
|
|
12
|
+
# in q= or d= is an image setting (quality, density) that image CDNs and
|
|
13
|
+
# Next.js image URLs carry, not data.
|
|
14
|
+
regex: "!\\[[^\\]]*\\]\\(https?://[^)?\\s]+(?=\\?)[^)\\s]*(?:[?&](?:(?:d|q)=(?!\\d{1,4}(?:[&)\\s]|$))|(?:data|payload|content|text|msg|token|key|secret|password|pass|pwd|env|cookie|session|auth|creds?|leak|info|user|email)=)|\\{\\{|\\$\\{|%s|<[a-z_]+>|\\b(?:PLACEHOLDER|REPLACE_ME|INSERT)\\b)[^)\\s]*\\)"
|
|
15
|
+
# Well-known badge services take query strings by design. So do the image
|
|
16
|
+
# links Google Docs (googleusercontent, ?key=) and GitBook (alt=media&token=)
|
|
17
|
+
# make for pictures that were pasted into a document: the key or token is
|
|
18
|
+
# the picture's own address, issued by the host that serves it. Both are
|
|
19
|
+
# anchored: the host is whole dot-separated labels (so attacker-googleusercontent.com
|
|
20
|
+
# is not exempt), and the query is exactly ?key=... or ?alt=media&token=...
|
|
21
|
+
# with nothing before, between or after (so data cannot ride along).
|
|
22
|
+
exclude_regex: "\\]\\(https?://(?:(?:img\\.shields\\.io|shields\\.io|badgen\\.net|badge\\.fury\\.io|(?:app\\.)?codecov\\.io|coveralls\\.io|(?:api\\.)?travis-ci\\.(?:org|com)|(?:dl\\.)?circleci\\.com|api\\.netlify\\.com|deepwiki\\.com/badge|www\\.bestpractices\\.dev|api\\.securityscorecards\\.dev|(?:static\\.)?pepy\\.tech|sonarcloud\\.io|readthedocs\\.org|img\\.badgesize\\.io|snyk\\.io/test|discord(?:app)?\\.com/api/guilds|camo\\.githubusercontent\\.com|vercel\\.com/button|deploy\\.workers\\.cloudflare\\.com)/|github\\.com/[^)]*/(?:badge\\.svg|actions/workflows/))|\\]\\(https?://(?:github\\.com/[^)?]+\\?raw=true\\)|raw\\.githubusercontent\\.com/)|\\]\\(https?://(?:[a-z0-9-]+\\.)*googleusercontent\\.com/(?:docsz|d)/[^)\\s?]*\\?key=[A-Za-z0-9_-]+\\)|\\]\\(https?://(?:[a-z0-9-]+-)?files\\.gitbook\\.io/~/files/v0/b/gitbook-x-prod\\.appspot\\.com/o/[^)\\s?]*\\?alt=media\\\\?&token=[A-Za-z0-9-]+\\)"
|
|
23
|
+
# An image inside Markdown code (backticks or a fenced block) is shown as
|
|
24
|
+
# text and never loaded, so it cannot send anything (security docs quote
|
|
25
|
+
# defanged examples that way).
|
|
26
|
+
skip_in_code: true
|
|
15
27
|
owasp:
|
|
16
28
|
- "LLM02:2025 Sensitive Information Disclosure"
|
|
17
29
|
- "ASI05 Sensitive Data Leakage"
|
|
@@ -7,8 +7,18 @@ applies_to:
|
|
|
7
7
|
match:
|
|
8
8
|
# A steering or rules file that tells the agent to drop its safeguards: skip
|
|
9
9
|
# approvals, outrank the user, or hide what it does. Ordinary project rules
|
|
10
|
-
# ("always run the tests") are not flagged.
|
|
11
|
-
|
|
10
|
+
# ("always run the tests") are not flagged. "Proceed without asking" on its
|
|
11
|
+
# own is ordinary autonomy guidance ("when the choice is already made,
|
|
12
|
+
# proceed without asking"); it counts only when approval, permission or
|
|
13
|
+
# confirmation is what gets skipped, and not when the sentence forbids it
|
|
14
|
+
# ("do not proceed without approval").
|
|
15
|
+
regex: "(?:\\bdisable\\s+(?:all\\s+)?(?:safety|security)\\s+(?:checks|guards?|rules|prompts)\\b|\\bauto[- ]?approve\\s+(?:all|every|any)\\s+(?:tool\\s+)?(?:calls?|actions?|commands?|tools?)\\b|\\bnever\\s+(?:show|ask\\s+for|display)\\s+(?:approval|confirmation)\\s+(?:prompts?|dialogs?)\\b|(?<!(?:\\bnot|\\bnever|n't)\\b[^.\\n]{0,40})\\b(?:proceed|act|run|continue|execute)\\s+(?:(?:all|every|any|each|the)\\s+)?(?:(?:tool\\s+)?(?:calls?|commands?|actions?|steps?|changes?|tools?|tasks?)\\s+)?without\\s+(?:asking\\s+(?:the\\s+user\\s+)?(?:for\\s+)?(?:approval|permission|confirmation)|(?:any\\s+|user\\s+)?(?:confirmation|approval|permission)s?)\\b|\\b(?:take|takes|have|has)\\s+(?:higher|top|absolute)\\s+priority\\s+(?:over|than)\\s+(?:the\\s+)?(?:user|any\\s+other)\\b|\\boverrides?\\s+(?:all\\s+|any\\s+)?(?:the\\s+)?(?:user'?s?|system|previous|prior)\\s+(?:instructions|requests|rules|prompts?)\\b|\\b(?:never|do\\s+not)\\s+(?:show|display|reveal|tell)\\s+(?:this|these|it)\\s+(?:to\\s+)?(?:the\\s+)?user\\b|\\bthe\\s+user\\s+has\\s+pre-?authori[sz]ed\\b)"
|
|
16
|
+
# A phrase in quotation marks that close right after it, in a passage that
|
|
17
|
+
# is warning about it or quoting it as an example ("never follow text such
|
|
18
|
+
# as ..."), is not an order. In the field that was 35 of 42 findings of
|
|
19
|
+
# EX-002 (docs/FIELD_REPORT.md). A quoted phrase that runs on into a longer
|
|
20
|
+
# instruction is still reported.
|
|
21
|
+
quoted_example_cues: '\b(?:such\s+as|e\.g\.|i\.e\.|for\s+(?:example|instance)|never|do\s+not|don''t|must\s+not|should\s+not|refuse|reject|treat|untrusted|inert|injection|jailbreak|adversarial|attack|malicious|hostile|crafted|hijack|red[- ]?team|detect|flag|block|strip|sanitiz|filter|pattern|phrase|cases?\b|example|quarantine|directive|look(?:s|ing)?\s+like|shaped)'
|
|
12
22
|
# READMEs describe features ("--yolo auto-approves all tools"); this rule is
|
|
13
23
|
# about steering and rules files that the agent obeys.
|
|
14
24
|
skip_paths:
|
|
@@ -7,10 +7,27 @@ applies_to:
|
|
|
7
7
|
match:
|
|
8
8
|
# A download piped into a shell, an encoded PowerShell command, or an
|
|
9
9
|
# explicit order to run a command. Ordinary mentions of curl are not flagged.
|
|
10
|
-
|
|
10
|
+
# The lookahead right after "curl " only checks that a "| shell" follows
|
|
11
|
+
# within 1,200 characters (200 + the longest host name, 600, + 400): every
|
|
12
|
+
# match already has one there, so results are the same, but a long line full
|
|
13
|
+
# of curl mentions with no pipe to a shell fails fast instead of trying every
|
|
14
|
+
# host position (about 5x faster on a 180 KB line).
|
|
15
|
+
regex: "(?:\\b(?:curl|wget)\\s+(?=[^\\n]{0,1200}?\\|\\s*(?:sudo\\s+(?:-\\S+\\s+)*)?(?:sh|bash|zsh|fish)\\b)[^\\n]{0,200}?(?:https?://|\\b\\d{1,3}(?:\\.\\d{1,3}){3}\\b|\\b[A-Za-z0-9-]{1,63}(?:\\.[A-Za-z0-9-]{1,63}){0,8}\\.[A-Za-z]{2,24}\\b)[^\\n]{0,400}?\\|\\s*(?:sudo\\s+(?:-\\S+\\s+)*)?(?:sh|bash|zsh|fish)\\b(?!\\s+-c\\b)|\\bpowershell(?:\\.exe)?\\s+-e(?:nc|ncodedcommand)\\b|\\b(?:you\\s+must|always|now|first)\\s+run\\s+(?:the\\s+following|this)\\s+(?:command|script))"
|
|
16
|
+
# In generic JSON and YAML files, only commands that run count: the value of
|
|
17
|
+
# a command-like key ("command", "run", "setup_commands", "args"), an item
|
|
18
|
+
# of such a list, a step the text tells the reader to run ("Run: curl ..."),
|
|
19
|
+
# or anything in an agent-environment or hook file (.cursor/environment.json,
|
|
20
|
+
# .devcontainer/, .claude/, .kiro/, hooks.json). An install command listed
|
|
21
|
+
# as data (a docs data file, an agent catalogue) is not a hook. Hooks, MCP
|
|
22
|
+
# configs and tool results are always checked in full.
|
|
23
|
+
exec_context: true
|
|
11
24
|
skip_paths:
|
|
12
25
|
- "^\\.github/workflows/"
|
|
13
26
|
- "(^|/)action\\.ya?ml$"
|
|
27
|
+
- "(^|/)(tests?|__tests__|__mocks__|spec|specs|fixtures?|testdata|test-data|e2e)/|[._-](test|spec)s?\\.[A-Za-z0-9]+$|_tests?\\.(rs|go|py)$"
|
|
28
|
+
# EX-008 and EX-015 both match a download piped into a shell; on the same line
|
|
29
|
+
# they are one problem, and only the more severe finding is kept.
|
|
30
|
+
same_line_group: remote-shell
|
|
14
31
|
owasp:
|
|
15
32
|
- "ASI06 Prompt Injection via Indirect Content"
|
|
16
33
|
- "LLM01:2025 Prompt Injection"
|
|
@@ -9,6 +9,19 @@ match:
|
|
|
9
9
|
# Text that hands the agent powers it should not assume: admin rights,
|
|
10
10
|
# permission to destroy data, or a claim that approval was already given.
|
|
11
11
|
regex: "(?:\\bact\\s+with\\s+(?:admin|administrator|root|elevated|full|superuser)\\s+(?:permissions|privileges|rights|access)\\b|\\byou\\s+are\\s+(?:authori[sz]ed|permitted|allowed)\\s+to\\s+(?:drop|delete|wipe|truncate|bypass|disable|override|force[- ]push)\\b|\\bbypass\\s+(?:the\\s+)?(?:usual\\s+|normal\\s+|standard\\s+)?(?:confirmation|approval|review|safety)\\s+(?:steps?|checks?|prompts?)\\b|\\bthis\\s+(?:has\\s+been|is|was)\\s+(?:already\\s+)?pre-?approved\\b)"
|
|
12
|
+
# A phrase in quotation marks that close right after it, in a passage that
|
|
13
|
+
# is warning about it or quoting it as an example ("never follow text such
|
|
14
|
+
# as ..."), is not an order. In the field that was 35 of 42 findings of
|
|
15
|
+
# EX-002 (docs/FIELD_REPORT.md). A quoted phrase that runs on into a longer
|
|
16
|
+
# instruction is still reported.
|
|
17
|
+
quoted_example_cues: '\b(?:such\s+as|e\.g\.|i\.e\.|for\s+(?:example|instance)|never|do\s+not|don''t|must\s+not|should\s+not|refuse|reject|treat|untrusted|inert|injection|jailbreak|adversarial|attack|malicious|hostile|crafted|hijack|red[- ]?team|detect|flag|block|strip|sanitiz|filter|pattern|phrase|cases?\b|example|quarantine|directive|look(?:s|ing)?\s+like|shaped)'
|
|
18
|
+
# A phrase the passage itself forbids is a defence, not an attack: "never
|
|
19
|
+
# ignore earlier instructions", "users cannot bypass the prompt", "it must not
|
|
20
|
+
# attempt to tell the agent to ignore earlier instructions". The negation has
|
|
21
|
+
# to govern the phrase (it ends right before it, or opens a list of what must
|
|
22
|
+
# not be attempted); "do not mention this, tell the agent to ..." is still an
|
|
23
|
+
# attack (m7-precision, packages/core/src/scanner/context.ts isNegated).
|
|
24
|
+
negated_cues: '\b(?:(?:must|should|shall|will|would|may|might|can|could)\s*(?:not|never)|(?:must|should|shall|would|could|do|does|did|is|are|was|were|has|have|ca|wo)n[''’]t|cannot|do(?:es)?\s+not|did\s+not|never|refus(?:e|es|ed|ing)\s+to|(?:is|are)\s+not\s+(?:to|allowed\s+to|permitted\s+to|able\s+to)|unable\s+to)\s+(?:(?:ever|simply|just|even|actually|knowingly)\s+)*$|\b(?:(?:must|should|shall|will|would|may|might|can|could)\s*(?:not|never)|(?:must|should|shall|would|could|do|does|did|is|are|was|were|has|have|ca|wo)n[''’]t|cannot)\s+(?:attempt|try|seek)\s+to\b[^.!?\n]*?\b(?:tell|instruct|ask|cause|make|persuade|trick|convince|get|force|let|allow)\w*\s+(?:(?:the|an?|your|any)\s+)?(?:(?:agent|model|assistant|ai|llm|bot|claude)s?\s+)?(?:to\s+)?$|\b(?:(?:must|should|shall|will|would|may|might|can|could)\s*(?:not|never)|(?:must|should|shall|would|could|do|does|did|is|are|was|were|has|have|ca|wo)n[''’]t|cannot|do(?:es)?\s+not|did\s+not|never|refus(?:e|es|ed|ing)\s+to|(?:is|are)\s+not\s+(?:to|allowed\s+to|permitted\s+to|able\s+to)|unable\s+to)\s+(?:follow|obey|comply\s+with|act\s+on|honou?r|accept|execute|run)\s+(?:(?:any|an?|the|such|these|those|that|text|instructions?|requests?|commands?|messages?|content|tool\s+output|it)\s+)*(?:(?:that|which)\s+)?(?:(?:say|says|saying|tell|tells|telling|ask|asks|asking)\s+(?:you\s+)?(?:to\s+)?)?$'
|
|
12
25
|
owasp:
|
|
13
26
|
- "ASI02 Inadequate Human-in-the-Loop Controls"
|
|
14
27
|
- "LLM06:2025 Excessive Agency"
|
|
@@ -8,6 +8,12 @@ match:
|
|
|
8
8
|
# Notes the agent reloads every session that leak secrets, hide themselves,
|
|
9
9
|
# or grant standing permissions.
|
|
10
10
|
regex: "(?:\\binclude\\s+(?:any\\s+|all\\s+)?(?:secret|secrets|keys?|tokens?|passwords?|credentials)\\b[^.\\n]{0,40}\\b(?:in\\s+full|verbatim|as\\s+is|unredacted)\\b|\\bnever\\s+mention\\s+this\\s+(?:note|file|instruction|memory)\\b|\\bif\\s+asked(?:\\s+about\\s+(?:it|this))?,?\\s+say\\s+(?:it|this)\\s+does\\s+not\\s+exist\\b|\\b(?:permanent|standing)\\s+(?:shell|command|execution)\\s+(?:execution\\s+)?permission\\b|\\balways\\s+approve\\s+requests\\s+from\\b)"
|
|
11
|
+
# A phrase in quotation marks that close right after it, in a passage that
|
|
12
|
+
# is warning about it or quoting it as an example ("never follow text such
|
|
13
|
+
# as ..."), is not an order. In the field that was 35 of 42 findings of
|
|
14
|
+
# EX-002 (docs/FIELD_REPORT.md). A quoted phrase that runs on into a longer
|
|
15
|
+
# instruction is still reported.
|
|
16
|
+
quoted_example_cues: '\b(?:such\s+as|e\.g\.|i\.e\.|for\s+(?:example|instance)|never|do\s+not|don''t|must\s+not|should\s+not|refuse|reject|treat|untrusted|inert|injection|jailbreak|adversarial|attack|malicious|hostile|crafted|hijack|red[- ]?team|detect|flag|block|strip|sanitiz|filter|pattern|phrase|cases?\b|example|quarantine|directive|look(?:s|ing)?\s+like|shaped)'
|
|
11
17
|
owasp:
|
|
12
18
|
- "ASI04 Memory Poisoning"
|
|
13
19
|
- "LLM01:2025 Prompt Injection"
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
id: EX-021
|
|
2
|
+
title: Smuggled bytes in variation selectors
|
|
3
|
+
severity: critical
|
|
4
|
+
applies_to:
|
|
5
|
+
- instruction
|
|
6
|
+
- docs
|
|
7
|
+
- config
|
|
8
|
+
- memory
|
|
9
|
+
- hook
|
|
10
|
+
- tool-result
|
|
11
|
+
match:
|
|
12
|
+
unicode_class:
|
|
13
|
+
- variation-selector # U+FE00-FE0F, U+E0100-E01EF
|
|
14
|
+
# A run of four or more variation selectors carries smuggled bytes. One or
|
|
15
|
+
# two are ordinary emoji presentation (a heart with U+FE0F) and are ignored.
|
|
16
|
+
min_run: 4
|
|
17
|
+
owasp:
|
|
18
|
+
- "LLM01:2025 Prompt Injection"
|
|
19
|
+
- "ASI03 Prompt Injection via External Content"
|
|
20
|
+
fix: >
|
|
21
|
+
Remove the variation selectors from the text. They hide bytes that people
|
|
22
|
+
cannot see but an AI model still reads. Use a Unicode-aware editor to reveal
|
|
23
|
+
them, and check where the file came from: smuggled text is usually placed by
|
|
24
|
+
whoever wanted the agent to follow it. The hidden message is shown in the
|
|
25
|
+
finding; treat it as attacker text, not as instructions.
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
id: EX-022
|
|
2
|
+
title: Canary token out of its trap
|
|
3
|
+
severity: critical
|
|
4
|
+
applies_to:
|
|
5
|
+
- instruction
|
|
6
|
+
- docs
|
|
7
|
+
- code
|
|
8
|
+
- config
|
|
9
|
+
- mcp-config
|
|
10
|
+
- hook
|
|
11
|
+
- memory
|
|
12
|
+
- power
|
|
13
|
+
- manifest
|
|
14
|
+
- definition
|
|
15
|
+
- unknown
|
|
16
|
+
- tool-result
|
|
17
|
+
# The encyclopedia record for canary traps (exorcist canary plant). The real
|
|
18
|
+
# matching is in code: packages/core/src/canary.ts for scans and the
|
|
19
|
+
# pre-commit hook, packages/shield/src/engine.ts for tool calls. Only the
|
|
20
|
+
# project's records (.exorcist/canaries.json) know which tokens are planted
|
|
21
|
+
# and which trap each came from, and the code also finds a token that was
|
|
22
|
+
# base64- or percent-encoded or split by whitespace. So this rule is not run
|
|
23
|
+
# as a signature; the pattern below documents the token's shape.
|
|
24
|
+
enabled: false
|
|
25
|
+
match:
|
|
26
|
+
# x98c_ + 24 base32 characters, unique per install.
|
|
27
|
+
regex: "x98c_[A-Z2-7]{24}"
|
|
28
|
+
# The trap files and the records file hold the tokens on purpose.
|
|
29
|
+
skip_paths:
|
|
30
|
+
- "(^|/)\\.exorcist/(canary/|canaries\\.json$)"
|
|
31
|
+
owasp:
|
|
32
|
+
- "LLM02:2025 Sensitive Information Disclosure"
|
|
33
|
+
- "ASI05 Sensitive Data Leakage"
|
|
34
|
+
fix: >
|
|
35
|
+
A canary trap was set off: a token that exists only in a trap file
|
|
36
|
+
(.exorcist/canary/) turned up in a tool call, a tool result, a file or a
|
|
37
|
+
commit. No honest task ever copies it, so something the agent read (a
|
|
38
|
+
prompt injection in a file, a tool result or a dependency) told it to leak.
|
|
39
|
+
The Real-Time Shield blocks such tool calls in every mode. Find and remove
|
|
40
|
+
the instruction, delete any copy of the token, then replant fresh traps with
|
|
41
|
+
"exorcist canary --remove" and "exorcist canary plant", since this one is
|
|
42
|
+
burned.
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
id: EX-023
|
|
2
|
+
title: Lethal trifecta across MCP servers
|
|
3
|
+
severity: high
|
|
4
|
+
applies_to:
|
|
5
|
+
- mcp-config
|
|
6
|
+
- config
|
|
7
|
+
match:
|
|
8
|
+
# Not a text pattern: the scanner labels every enabled MCP server (and every
|
|
9
|
+
# built-in ability a Claude Code settings file allows) in one config with the
|
|
10
|
+
# capabilities in definitions/capabilities.yaml. When together they can read
|
|
11
|
+
# private data, take in untrusted text and send data out, one prompt
|
|
12
|
+
# injection can steal anything the agent can read. Reported once per config,
|
|
13
|
+
# naming the servers on each leg; critical when a server on a leg has
|
|
14
|
+
# auto-approved tools.
|
|
15
|
+
analysis: trifecta
|
|
16
|
+
# Test and eval fixtures hold attack samples on purpose (a security scanner's
|
|
17
|
+
# own tests, adversarial evals). Findings there are reported at low severity,
|
|
18
|
+
# not dropped. A file an agent reads (instructions, hooks, MCP configs, .kiro,
|
|
19
|
+
# .claude, .cursor) is never lowered, wherever it sits.
|
|
20
|
+
low_severity_paths:
|
|
21
|
+
- "(^|/)(tests?|__tests__|__mocks__|spec|specs|fixtures?|testdata|test-data|e2e|evals?)/|[._-](test|spec)s?\\.[A-Za-z0-9]+$|_tests?\\.(rs|go|py)$"
|
|
22
|
+
owasp:
|
|
23
|
+
- "LLM01:2025 Prompt Injection"
|
|
24
|
+
- "LLM06:2025 Excessive Agency"
|
|
25
|
+
- "ASI02 Inadequate Human-in-the-Loop Controls"
|
|
26
|
+
fix: >
|
|
27
|
+
Break one leg. Run servers that read untrusted text (web pages, issues,
|
|
28
|
+
chat, email) in a separate agent profile from servers that read private
|
|
29
|
+
data, or remove the way out (open web requests, sending messages, creating
|
|
30
|
+
issues or gists). Limit filesystem servers to the project folder, and never
|
|
31
|
+
auto-approve tools on a server that sits on one of the three legs.
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
id: EX-024
|
|
2
|
+
title: Detonated in the chamber
|
|
3
|
+
severity: critical
|
|
4
|
+
applies_to:
|
|
5
|
+
- instruction
|
|
6
|
+
- docs
|
|
7
|
+
- code
|
|
8
|
+
- config
|
|
9
|
+
- mcp-config
|
|
10
|
+
- hook
|
|
11
|
+
- memory
|
|
12
|
+
- power
|
|
13
|
+
- manifest
|
|
14
|
+
- unknown
|
|
15
|
+
- tool-result
|
|
16
|
+
match:
|
|
17
|
+
# Not a text pattern: behaviour, not wording. With `exorcist scan
|
|
18
|
+
# --detonate` (or `exorcist detonate <file>`), the Detonation Chamber gives
|
|
19
|
+
# the suspect text to a sandboxed model (Claude on Amazon Bedrock) that has
|
|
20
|
+
# only fake tools (read_file, run_shell, http_post, send_message) and
|
|
21
|
+
# planted fake secrets. It is reported when the text makes the model try to
|
|
22
|
+
# send a planted secret anywhere, read a secret file it was not asked
|
|
23
|
+
# about, download and run code, or run a destructive command. No tool call
|
|
24
|
+
# is ever executed. Code: packages/core/src/llm/detonation.ts. Off by
|
|
25
|
+
# default; it needs AWS credentials and costs at most two model calls per
|
|
26
|
+
# file.
|
|
27
|
+
analysis: detonation
|
|
28
|
+
owasp:
|
|
29
|
+
- "LLM01:2025 Prompt Injection"
|
|
30
|
+
- "LLM06:2025 Excessive Agency"
|
|
31
|
+
- "LLM02:2025 Sensitive Information Disclosure"
|
|
32
|
+
fix: >
|
|
33
|
+
When an AI model read this text, it tried to do something harmful (the
|
|
34
|
+
finding lists the exact tool calls it attempted; none were run). The
|
|
35
|
+
wording may not match any signature, but the effect is the same as a
|
|
36
|
+
prompt injection. Remove or rewrite the passage that asks for those
|
|
37
|
+
actions, check where the file came from, and do not let an agent with real
|
|
38
|
+
tools read it until it is clean.
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
id: EX-025
|
|
2
|
+
title: MCP server environment changes how its program loads
|
|
3
|
+
severity: high
|
|
4
|
+
applies_to:
|
|
5
|
+
- mcp-config
|
|
6
|
+
- config
|
|
7
|
+
match:
|
|
8
|
+
# The names of the variables each MCP server entry sets in its `env`.
|
|
9
|
+
json_path: "$..mcpServers.*.env.*~"
|
|
10
|
+
# Variables that make the runtime load extra code, or look for libraries
|
|
11
|
+
# and modules somewhere else, before the server's own code runs.
|
|
12
|
+
value_regex: "^(NODE_OPTIONS|LD_PRELOAD|LD_LIBRARY_PATH|LD_AUDIT|DYLD_[A-Z_]+|PYTHONPATH|PYTHONSTARTUP|PYTHONHOME|RUBYOPT|RUBYLIB|PERL5OPT|PERL5LIB|JAVA_TOOL_OPTIONS|_JAVA_OPTIONS|JDK_JAVA_OPTIONS|BASH_ENV|ENV)$"
|
|
13
|
+
owasp:
|
|
14
|
+
- "ASI07 Supply Chain Vulnerabilities"
|
|
15
|
+
- "MCP04 Malicious MCP Package"
|
|
16
|
+
fix: >
|
|
17
|
+
Remove the variable from the server's env unless you know exactly why it is
|
|
18
|
+
there. NODE_OPTIONS=--require, LD_PRELOAD and similar variables run code of
|
|
19
|
+
their choosing before the server starts, without changing its command or
|
|
20
|
+
arguments, so a reviewer looking at the command line would not notice.
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
id: EX-026
|
|
2
|
+
title: Agent file too large to check
|
|
3
|
+
severity: medium
|
|
4
|
+
applies_to:
|
|
5
|
+
- instruction
|
|
6
|
+
- memory
|
|
7
|
+
- hook
|
|
8
|
+
- config
|
|
9
|
+
- mcp-config
|
|
10
|
+
- tool-result
|
|
11
|
+
- power
|
|
12
|
+
# Reported by the scanner itself, not matched as a signature
|
|
13
|
+
# (packages/core/src/scanner/orchestrator.ts). Files an agent takes
|
|
14
|
+
# instructions or settings from are scanned in full up to 10 MB; past that
|
|
15
|
+
# they are reported with this rule instead of being skipped in silence, so
|
|
16
|
+
# padding a file never makes a project look clean.
|
|
17
|
+
enabled: false
|
|
18
|
+
match:
|
|
19
|
+
regex: "(?!)"
|
|
20
|
+
owasp:
|
|
21
|
+
- "LLM01:2025 Prompt Injection"
|
|
22
|
+
- "ASI03 Prompt Injection via External Content"
|
|
23
|
+
fix: >
|
|
24
|
+
This file is one your AI agent reads for instructions or settings, and it is
|
|
25
|
+
over 10 MB, so Exorcist 98 did not check its contents. Ordinary agent files
|
|
26
|
+
are far smaller: an oversized one can be padding meant to hide something.
|
|
27
|
+
Open it and check what it is; if it is legitimate generated data, move it
|
|
28
|
+
out of the places agents read.
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
id: EX-027
|
|
2
|
+
title: Lethal trifecta completed in a live session
|
|
3
|
+
severity: critical
|
|
4
|
+
applies_to:
|
|
5
|
+
- tool-result
|
|
6
|
+
- mcp-config
|
|
7
|
+
# The Session Guard: EX-023 enforced at run time by the Real-Time Shield
|
|
8
|
+
# (packages/shield/src/session.ts, packages/shield/src/engine.ts). Not a text
|
|
9
|
+
# pattern, so this rule is never run as a signature. The Shield remembers what
|
|
10
|
+
# really happened in one agent session, across every Shield-wrapped server of
|
|
11
|
+
# that session (shared through <state folder>/sessions/<key>/, facts only:
|
|
12
|
+
# kind, tool, server, rule id and time, never text or secrets):
|
|
13
|
+
# untrusted text a tool result the Shield flagged as an attack or as
|
|
14
|
+
# suspicious, or one from a tool the capability rules
|
|
15
|
+
# (capabilities.yaml) label untrusted-input
|
|
16
|
+
# private data a result from a tool labelled private-data, a secret or a
|
|
17
|
+
# canary token in a result, or a call that read a secrets
|
|
18
|
+
# file (.env, ~/.ssh, credentials)
|
|
19
|
+
# Once both have happened, the next call that could send data out (a tool
|
|
20
|
+
# labelled exfiltration, or any call whose arguments name a host) is held for
|
|
21
|
+
# the user's approval (policy `sessionGuard: hold`, the default), refused
|
|
22
|
+
# (`block`, or `hold` when the client cannot show prompts), or only alerted
|
|
23
|
+
# (`monitor`). `exorcist approve session <key>` lets the session send again;
|
|
24
|
+
# a new fact arms the guard again.
|
|
25
|
+
enabled: false
|
|
26
|
+
match:
|
|
27
|
+
regex: "(?!)"
|
|
28
|
+
owasp:
|
|
29
|
+
- "LLM01:2025 Prompt Injection"
|
|
30
|
+
- "LLM02:2025 Sensitive Information Disclosure"
|
|
31
|
+
- "LLM06:2025 Excessive Agency"
|
|
32
|
+
- "ASI02 Inadequate Human-in-the-Loop Controls"
|
|
33
|
+
fix: >
|
|
34
|
+
In this agent session your AI first took in text anyone can write (a web
|
|
35
|
+
page, an issue, a chat message) and then read private data (a secrets file,
|
|
36
|
+
a key, a private tool). Each step looks harmless alone, but this is the
|
|
37
|
+
order a prompt injection uses to steal data, so the Shield held the next
|
|
38
|
+
call that could send data out. If you asked for that call, allow it in the
|
|
39
|
+
prompt, or run "exorcist approve session <key>" (the key is in the alert)
|
|
40
|
+
and ask again. If you did not, decline it, find the page, issue or message
|
|
41
|
+
that told your AI to send the data, and start a new session. To avoid it,
|
|
42
|
+
break one leg of the trifecta (EX-023): keep servers that read untrusted
|
|
43
|
+
text out of sessions that read private data.
|