@exorcist-98/mcp-server 0.0.0-stage → 0.1.1

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.
Files changed (29) hide show
  1. package/README.md +28 -2
  2. package/definitions/EX-001-hidden-unicode.yaml +34 -0
  3. package/definitions/EX-002-ai-instructions.yaml +28 -0
  4. package/definitions/EX-003-encoded-payload.yaml +41 -0
  5. package/definitions/EX-004-html-comment-smuggling.yaml +26 -0
  6. package/definitions/EX-005-tool-description-poisoning.yaml +19 -0
  7. package/definitions/EX-006-mcp-rug-pull.yaml +17 -0
  8. package/definitions/EX-007-overbroad-autoapprove.yaml +18 -0
  9. package/definitions/EX-008-remote-code-hook.yaml +42 -0
  10. package/definitions/EX-009-install-script-exfiltration.yaml +19 -0
  11. package/definitions/EX-010-unpinned-mcp-server.yaml +21 -0
  12. package/definitions/EX-011-secrets-in-agent-reach.yaml +38 -0
  13. package/definitions/EX-012-markdown-image-exfil.yaml +27 -0
  14. package/definitions/EX-013-typosquat-mcp-package.yaml +21 -0
  15. package/definitions/EX-014-steering-override.yaml +33 -0
  16. package/definitions/EX-015-shell-in-tool-output.yaml +37 -0
  17. package/definitions/EX-018-confused-deputy.yaml +25 -0
  18. package/definitions/EX-019-memory-poisoning.yaml +23 -0
  19. package/definitions/EX-020-suspicious-power.yaml +18 -0
  20. package/definitions/EX-021-smuggled-bytes.yaml +25 -0
  21. package/definitions/EX-022-canary-token.yaml +42 -0
  22. package/definitions/EX-023-lethal-trifecta.yaml +25 -0
  23. package/definitions/EX-024-detonated.yaml +38 -0
  24. package/definitions/EX-025-loader-env.yaml +20 -0
  25. package/definitions/EX-026-too-large-to-check.yaml +28 -0
  26. package/definitions/EX-027-session-trifecta.yaml +43 -0
  27. package/definitions/capabilities.yaml +311 -0
  28. package/dist/index.mjs +28952 -0
  29. package/package.json +49 -4
package/README.md CHANGED
@@ -1,3 +1,29 @@
1
- # Temporary Holding Version
1
+ # @exorcist-98/mcp-server
2
2
 
3
- This version is a temporary placeholder for this package. An operational version to replace this has been submitted for review and is awaiting a staged release.
3
+ An MCP server from [Exorcist 98](https://github.com/pranavsaji/exorcist-98),
4
+ an antivirus for AI coding agents. It lets your agent check a project before
5
+ trusting it.
6
+
7
+ Tools:
8
+
9
+ - `scan_repo`: scan a folder or file for attacks on AI agents (hidden
10
+ instructions, poisoned tool descriptions, dangerous hooks, leaked secrets).
11
+ - `scan_mcp_config`: check an MCP config for risky servers.
12
+ - `explain_finding`: a plain-language explanation of a rule.
13
+ - `quarantine`: disable a server in an MCP config, with a backup to restore.
14
+
15
+ The tools only read inside the folder the server was started in, plus the
16
+ folders your client shares as MCP roots. Quoted text from scanned files is left
17
+ out of results unless you ask for it, and is then marked as untrusted.
18
+
19
+ ## Use it
20
+
21
+ ```json
22
+ {
23
+ "mcpServers": {
24
+ "exorcist": { "command": "npx", "args": ["-y", "@exorcist-98/mcp-server@0.1.1"] }
25
+ }
26
+ }
27
+ ```
28
+
29
+ Needs Node 20 or newer. Licence: Apache-2.0.
@@ -0,0 +1,34 @@
1
+ id: EX-001
2
+ title: Hidden Unicode instructions
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
+ - zero-width # U+200B, U+200C, U+200D, U+FEFF
14
+ - bidi-override # U+202A-U+202E, U+2066-U+2069
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
+ owasp:
29
+ - "LLM01:2025 Prompt Injection"
30
+ - "ASI03 Prompt Injection via External Content"
31
+ fix: >
32
+ Remove the hidden characters. Use a Unicode-aware editor or run `cat -A` to
33
+ reveal them. Consider adding a linter rule that bans these code points in
34
+ text files.
@@ -0,0 +1,28 @@
1
+ id: EX-002
2
+ title: Instructions addressed to AI
3
+ severity: high
4
+ applies_to:
5
+ - instruction
6
+ - docs
7
+ - memory
8
+ - tool-result
9
+ match:
10
+ # Phrases that only make sense when talking to an AI agent. Any amount of
11
+ # whitespace may separate the words. Ordinary text such as "you are now
12
+ # logged in" is not flagged. A phrase split by hidden characters still
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\\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
+ owasp:
22
+ - "LLM01:2025 Prompt Injection"
23
+ - "ASI03 Prompt Injection via External Content"
24
+ fix: >
25
+ Remove or rewrite the flagged phrase. Legitimate documentation does not need
26
+ to address the AI agent directly. If the phrase is in a code example, wrap it
27
+ in a fenced code block with a language tag so it is not parsed as an
28
+ instruction.
@@ -0,0 +1,41 @@
1
+ id: EX-003
2
+ title: Encoded payload
3
+ severity: high
4
+ applies_to:
5
+ - instruction
6
+ - docs
7
+ - config
8
+ - code
9
+ - hook
10
+ - mcp-config
11
+ match:
12
+ # A run of 40 or more base64 characters. Two ordinary kinds of long base64
13
+ # are skipped: package integrity hashes ("sha512-...") that fill lockfiles,
14
+ # and inline data URIs ("data:image/png;base64,...").
15
+ # A run of 40+ base64 characters, or 48+ hex digits (plain, 0x or \\x escaped).
16
+ regex: "(?:(?<!sha(?:1|256|384|512)-)(?<!base64,)(?<![A-Za-z0-9+/=])[A-Za-z0-9+/=]{40,}(?![A-Za-z0-9+/=])|(?:\\\\x[0-9a-fA-F]{2}){24,})"
17
+ # Only runs that decode to readable text count. URL paths, hashes, git SHAs
18
+ # and identifiers decode to binary noise; before this check they were about
19
+ # 99% of all findings on ordinary repositories (docs/BENCHMARK.md).
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\|>'
32
+ skip_paths:
33
+ - "(^|/)(tests?|__tests__|__mocks__|spec|specs|fixtures?|testdata|test-data|e2e)/|[._-](test|spec)s?\\.[A-Za-z0-9]+$|_tests?\\.(rs|go|py)$"
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)$"
35
+ owasp:
36
+ - "LLM01:2025 Prompt Injection"
37
+ - "ASI03 Prompt Injection via External Content"
38
+ fix: >
39
+ Investigate the base64 blob. If it decodes to a URL or instruction string,
40
+ remove it. If it is a legitimate asset (e.g. an icon), move it to a binary
41
+ file and reference it by path instead of embedding it inline.
@@ -0,0 +1,26 @@
1
+ id: EX-004
2
+ title: HTML comment smuggling
3
+ severity: high
4
+ applies_to:
5
+ - instruction
6
+ - docs
7
+ match:
8
+ # The match stays inside one comment ((?!-->) stops it at the closing marker).
9
+ # Ordinary words like "fetch" or "send to" are not enough on their own.
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
+ owasp:
20
+ - "LLM01:2025 Prompt Injection"
21
+ - "ASI03 Prompt Injection via External Content"
22
+ fix: >
23
+ Remove the HTML comment or replace its contents with a benign description.
24
+ Legitimate comments in Markdown should not contain imperative instructions
25
+ aimed at AI agents. Consider running a linter rule that bans instruction
26
+ keywords inside HTML comments.
@@ -0,0 +1,19 @@
1
+ id: EX-005
2
+ title: Tool description poisoning
3
+ severity: critical
4
+ applies_to:
5
+ - mcp-config
6
+ - config
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)|(send|include|attach|upload|pass|forward)[^.\\n]{0,60}(~/\\.ssh|id_rsa|\\.env\\b|\\.aws/credentials|private key))"
9
+ # Only in files that describe MCP servers or tools. Model or prompt configs
10
+ # that say \"do not mention\" are ordinary (seen in openai/codex).
11
+ file_regex: "(\"mcpServers\"|\"inputSchema\"|\"input_schema\")"
12
+ owasp:
13
+ - "MCP01 Tool Poisoning Attack"
14
+ - "LLM01:2025 Prompt Injection"
15
+ fix: >
16
+ Review the tool description field. A legitimate tool description explains
17
+ what the tool does, not what the agent should do before or after calling it.
18
+ Remove any instructions embedded in descriptions and replace with a plain
19
+ functional summary.
@@ -0,0 +1,17 @@
1
+ id: EX-006
2
+ title: MCP rug pull (description change pattern)
3
+ severity: critical
4
+ applies_to:
5
+ - mcp-config
6
+ - config
7
+ match:
8
+ regex: "(do not (inform|tell|mention)|attach.*contents|for telemetry purposes)"
9
+ file_regex: "(\"mcpServers\"|\"inputSchema\"|\"input_schema\")"
10
+ owasp:
11
+ - "MCP02 Tool Rug-Pull"
12
+ - "LLM01:2025 Prompt Injection"
13
+ fix: >
14
+ The tool description contains language associated with rug-pull attacks, where
15
+ instructions are added to a description after the user approved the original
16
+ tool. Remove any instruction text from the description field. Enable the
17
+ Real-Time Shield (packages/shield) to pin tool hashes and alert on changes.
@@ -0,0 +1,18 @@
1
+ id: EX-007
2
+ title: Over-broad auto-approve
3
+ severity: high
4
+ applies_to:
5
+ - mcp-config
6
+ - config
7
+ match:
8
+ json_path: "$..autoApprove[*]"
9
+ # Only tools that write, delete, execute or run shell commands are flagged.
10
+ # Read-only tools in autoApprove are fine.
11
+ value_regex: "(^\\*$|write|delete|remove|rm_|exec|run_|shell|terminal|command|bash|edit|create|move|rename|deploy|install)"
12
+ owasp:
13
+ - "ASI02 Inadequate Human-in-the-Loop Controls"
14
+ - "MCP05 Excessive Tool Permissions"
15
+ fix: >
16
+ Remove write, delete, shell and execution tools from autoApprove. Auto-approve
17
+ should only be used for read-only, low-risk tools. For tools that need
18
+ frequent access, use a confirmation-based approval instead.
@@ -0,0 +1,42 @@
1
+ id: EX-008
2
+ title: Remote code in hook
3
+ severity: critical
4
+ applies_to:
5
+ - hook
6
+ - mcp-config
7
+ - config
8
+ - tool-result
9
+ match:
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
28
+ # CI workflows are not agent hooks; installers there are a separate supply-chain topic.
29
+ skip_paths:
30
+ - "^\\.github/workflows/"
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
36
+ owasp:
37
+ - "ASI06 Prompt Injection via Indirect Content"
38
+ - "LLM01:2025 Prompt Injection"
39
+ fix: >
40
+ Never pipe remote content directly into a shell. Download the script to a
41
+ known path, verify its checksum, and execute it separately. Better yet,
42
+ replace the remote script with a versioned local task in the repo.
@@ -0,0 +1,19 @@
1
+ id: EX-009
2
+ title: Install-script exfiltration
3
+ severity: critical
4
+ applies_to:
5
+ - manifest
6
+ - config
7
+ match:
8
+ # preinstall, install and postinstall all run automatically on install.
9
+ json_path: "$.scripts[preinstall,install,postinstall]"
10
+ # Flag scripts that reach the network or read secrets. A script such as
11
+ # "node scripts/build.js" is not flagged.
12
+ value_regex: "(curl|wget|https?:|fetch\\(|require\\(['\"]https?['\"]\\)|\\bnc\\b|/dev/tcp|process\\.env|\\.ssh|\\.npmrc|\\.env\\b)"
13
+ owasp:
14
+ - "ASI07 Supply Chain Vulnerabilities"
15
+ - "LLM01:2025 Prompt Injection"
16
+ fix: >
17
+ Audit preinstall, install and postinstall scripts. They should not read
18
+ environment variables or make outbound network requests. If a build step is
19
+ needed, use a local script tracked in the repo rather than a remote fetch.
@@ -0,0 +1,21 @@
1
+ id: EX-010
2
+ title: Unpinned MCP server
3
+ severity: medium
4
+ applies_to:
5
+ - mcp-config
6
+ - config
7
+ match:
8
+ # The package each package-runner server is told to run (flags such as -y
9
+ # and --package are understood; later arguments are paths or options).
10
+ json_path: "$..mcpServers[?(@.command=='npx' || @.command=='bunx' || @.command=='uvx' || @.command=='pnpx')].args"
11
+ select: package-arg
12
+ # A package name with no @version after it, e.g. "server" or "@scope/server".
13
+ # "server@1.2.3" and "@scope/server@1.2.3" do not match.
14
+ value_regex: "^(@[a-z0-9._-]+/)?[a-z0-9][a-z0-9._-]*$"
15
+ owasp:
16
+ - "ASI07 Supply Chain Vulnerabilities"
17
+ - "MCP04 Malicious MCP Package"
18
+ fix: >
19
+ Pin every MCP server to an exact version: replace `npx some-server` with
20
+ `npx some-server@1.2.3`. Verify the pinned version with a lockfile or a hash
21
+ check in CI.
@@ -0,0 +1,38 @@
1
+ id: EX-011
2
+ title: Secrets in agent reach
3
+ severity: high
4
+ applies_to:
5
+ - instruction
6
+ - docs
7
+ - config
8
+ - code
9
+ - unknown
10
+ match:
11
+ # Well-known secret variables, and secrets recognisable by their own format
12
+ # (GitHub, OpenAI, Anthropic, AWS, Slack, Google, Stripe and npm tokens, and
13
+ # private keys) wherever they appear (L-015).
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
+ # Placeholders such as [REDACTED], xxx, <token> or ${VAR} are not secrets.
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
+ # 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.
29
+ skip_paths:
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]+$"
32
+ owasp:
33
+ - "LLM02:2025 Sensitive Information Disclosure"
34
+ - "ASI05 Sensitive Data Leakage"
35
+ fix: >
36
+ Move the credential to a .env file and add .env to .gitignore and
37
+ .kiroignore. Use a secrets manager for production. Never hard-code secrets
38
+ in files an agent reads.
@@ -0,0 +1,27 @@
1
+ id: EX-012
2
+ title: Markdown image exfiltration
3
+ severity: high
4
+ applies_to:
5
+ - instruction
6
+ - docs
7
+ match:
8
+ # A markdown image whose query string carries data: a parameter named like
9
+ # data, token, env or user, or a template such as {{...}} or ${...}. Ordinary
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. 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.
16
+ 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/)"
17
+ # An image inside Markdown code (backticks or a fenced block) is shown as
18
+ # text and never loaded, so it cannot send anything (security docs quote
19
+ # defanged examples that way).
20
+ skip_in_code: true
21
+ owasp:
22
+ - "LLM02:2025 Sensitive Information Disclosure"
23
+ - "ASI05 Sensitive Data Leakage"
24
+ fix: >
25
+ Remove query strings from Markdown image URLs. A legitimate badge or image
26
+ does not need to send parameters to its host. If tracking is needed, use
27
+ a server-side redirect that does not expose data in the URL.
@@ -0,0 +1,21 @@
1
+ id: EX-013
2
+ title: Typosquat MCP package
3
+ severity: high
4
+ applies_to:
5
+ - mcp-config
6
+ - config
7
+ match:
8
+ # The package each package-runner server runs; only names that
9
+ # are one or two edits (or look-alike characters) away from a well-known MCP
10
+ # server package are kept (packages/core/src/known-packages.ts).
11
+ json_path: "$..mcpServers[?(@.command=='npx' || @.command=='bunx' || @.command=='uvx' || @.command=='pnpx')].args"
12
+ select: package-arg
13
+ value_regex: "^@?[a-z0-9][a-z0-9._-]*(/[a-z0-9._-]+)?(@[0-9a-z.^~*-]+)?$"
14
+ validate: typosquat
15
+ owasp:
16
+ - "LLM03:2025 Supply Chain"
17
+ - "MCP04 Supply Chain Compromise"
18
+ fix: >
19
+ Check the package name letter by letter against the official one and fix the
20
+ spelling. Prefer installing MCP servers from their publisher's documented
21
+ name, pinned to a version, and remove any package you did not mean to run.
@@ -0,0 +1,33 @@
1
+ id: EX-014
2
+ title: Steering override
3
+ severity: high
4
+ applies_to:
5
+ - instruction
6
+ - memory
7
+ match:
8
+ # A steering or rules file that tells the agent to drop its safeguards: skip
9
+ # approvals, outrank the user, or hide what it does. Ordinary project rules
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)'
22
+ # READMEs describe features ("--yolo auto-approves all tools"); this rule is
23
+ # about steering and rules files that the agent obeys.
24
+ skip_paths:
25
+ - "(^|/)README[^/]*$"
26
+ owasp:
27
+ - "ASI02 Inadequate Human-in-the-Loop Controls"
28
+ - "LLM01:2025 Prompt Injection"
29
+ fix: >
30
+ Remove the instruction. A steering or rules file should describe the
31
+ project, not switch off approvals or tell the agent to outrank or hide
32
+ things from you. Keep approval prompts on for tools that write, delete or
33
+ run commands.
@@ -0,0 +1,37 @@
1
+ id: EX-015
2
+ title: Shell in tool output
3
+ severity: high
4
+ applies_to:
5
+ - tool-result
6
+ - config
7
+ match:
8
+ # A download piped into a shell, an encoded PowerShell command, or an
9
+ # explicit order to run a command. Ordinary mentions of curl are not flagged.
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
24
+ skip_paths:
25
+ - "^\\.github/workflows/"
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
31
+ owasp:
32
+ - "ASI06 Prompt Injection via Indirect Content"
33
+ - "LLM01:2025 Prompt Injection"
34
+ fix: >
35
+ Treat tool output as data, never as instructions. Do not run commands that a
36
+ tool result asks for. If a tool legitimately returns a command, show it to the
37
+ user and let them decide.
@@ -0,0 +1,25 @@
1
+ id: EX-018
2
+ title: Confused-deputy request
3
+ severity: high
4
+ applies_to:
5
+ - instruction
6
+ - docs
7
+ - memory
8
+ match:
9
+ # Text that hands the agent powers it should not assume: admin rights,
10
+ # permission to destroy data, or a claim that approval was already given.
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
+ owasp:
19
+ - "ASI02 Inadequate Human-in-the-Loop Controls"
20
+ - "LLM06:2025 Excessive Agency"
21
+ fix: >
22
+ Remove the instruction. Documentation can say what a migration or script
23
+ does, but it should not grant the agent permissions or claim that a
24
+ destructive step is already approved. Keep confirmation prompts for
25
+ anything that deletes or rewrites data.
@@ -0,0 +1,23 @@
1
+ id: EX-019
2
+ title: Agent memory poisoning
3
+ severity: high
4
+ applies_to:
5
+ - memory
6
+ - instruction
7
+ match:
8
+ # Notes the agent reloads every session that leak secrets, hide themselves,
9
+ # or grant standing permissions.
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)'
17
+ owasp:
18
+ - "ASI04 Memory Poisoning"
19
+ - "LLM01:2025 Prompt Injection"
20
+ fix: >
21
+ Delete the planted lines from the agent's memory or notes file, then check
22
+ its history for who added them. Memory should record facts about the
23
+ project, never permissions, secrets or instructions to hide something.
@@ -0,0 +1,18 @@
1
+ id: EX-020
2
+ title: Suspicious Power
3
+ severity: critical
4
+ applies_to:
5
+ - power
6
+ - config
7
+ match:
8
+ # A Kiro Power (or a file shaped like one: hooks plus steering or an MCP
9
+ # server) that downloads and runs code, or tells the agent to stop asking.
10
+ regex: "(?:\\b(?:curl|wget)\\b[^\\n]*\\|\\s*(?:sh|bash|zsh|python3?|node)\\b|\\bapprove\\s+[^\\n]{0,40}\\bwithout\\s+asking\\b|\\bauto[- ]?approve\\s+(?:all|every)\\b)"
11
+ file_regex: "(?:^|\\n)hooks:[\\s\\S]*(?:^|\\n)(?:steering|mcp):|(?:^|\\n)(?:steering|mcp):[\\s\\S]*(?:^|\\n)hooks:"
12
+ owasp:
13
+ - "LLM03:2025 Supply Chain"
14
+ - "ASI06 Prompt Injection via Indirect Content"
15
+ fix: >
16
+ Do not install this Power. A Power should not download and run scripts on
17
+ file save or tell the agent to approve actions without asking. If you need
18
+ the feature, copy the parts you understand into your own steering and hooks.
@@ -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,25 @@
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
+ owasp:
17
+ - "LLM01:2025 Prompt Injection"
18
+ - "LLM06:2025 Excessive Agency"
19
+ - "ASI02 Inadequate Human-in-the-Loop Controls"
20
+ fix: >
21
+ Break one leg. Run servers that read untrusted text (web pages, issues,
22
+ chat, email) in a separate agent profile from servers that read private
23
+ data, or remove the way out (open web requests, sending messages, creating
24
+ issues or gists). Limit filesystem servers to the project folder, and never
25
+ auto-approve tools on a server that sits on one of the three legs.