@exorcist-98/mcp-server 0.1.2 → 0.3.0

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 CHANGED
@@ -13,7 +13,23 @@ Tools:
13
13
  - `quarantine`: disable a server in an MCP config, with a backup to restore.
14
14
 
15
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
16
+ folders your client shares as MCP roots and the folders in `EXORCIST_ROOTS`
17
+ (separated like `PATH`). Relative paths, and `.`, start in the first folder the
18
+ client shares, else the first `EXORCIST_ROOTS` folder, else the start folder.
19
+ Some clients start the server in a folder that is not your project (Kiro does
20
+ this for a Power, in `~/.kiro/powers/installed/`). If the client shares no folder
21
+ and the start folder holds no project, the tools say so instead of reporting a
22
+ clean scan.
23
+
24
+ Kiro shares no roots but supports elicitation. When a tool gets an absolute path
25
+ outside every allowed folder, the server asks the person in a form ("Allow
26
+ Exorcist 98 to read this folder for this session?"). Yes adds the folder until the
27
+ server stops; no reads nothing. Only the form answer counts, never the agent. The
28
+ filesystem root, the home folder and the folders above it, `~/.ssh`, `~/.aws`,
29
+ `~/.gnupg` and similar credential folders, and system folders are refused without
30
+ asking. Without elicitation and roots, the fixes are `EXORCIST_ROOTS` in the
31
+ server's env, or adding the server to the workspace `.kiro/settings/mcp.json`,
32
+ where Kiro starts it in the project folder. Quoted text from scanned files is left
17
33
  out of results unless you ask for it, and is then marked as untrusted.
18
34
 
19
35
  ## Use it
@@ -21,7 +37,7 @@ out of results unless you ask for it, and is then marked as untrusted.
21
37
  ```json
22
38
  {
23
39
  "mcpServers": {
24
- "exorcist": { "command": "npx", "args": ["-y", "@exorcist-98/mcp-server@0.1.2"] }
40
+ "exorcist": { "command": "npx", "args": ["-y", "@exorcist-98/mcp-server@0.3.0"] }
25
41
  }
26
42
  }
27
43
  ```
@@ -11,7 +11,13 @@ 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\\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?)"
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?|\\b(?:send|upload|post|forward|e-?mail|mail|paste|submit|copy|transmit|exfiltrate)\\s+(?:(?!\\n\\s*\\n)(?:[^.!?]|\\.(?=\\w))){0,40}?(?:\\.env\\b|(?:environment|env)\\s+files?|credentials?|secrets?|(?:api\\s+|access\\s+|auth\\s+|bearer\\s+)?tokens?|(?:api|ssh|private|secret)\\s+keys?)(?:(?!\\n\\s*\\n)(?:[^.!?]|\\.(?=\\w))){0,30}?\\b(?:to|at|into|via)(?:\\s*(?:…|\\.{3})|\\s+(?:https?://|ftp://|[\\w.+-]+@[\\w-]+\\.[\\w.-]+|(?:[a-z0-9-]+\\.)+(?!(?:json|ya?ml|toml|txt|md|env|jsx?|tsx?|py|sh|cfg|ini|conf|properties|example|local|lock|log|xml|html?|css)\\b)[a-z]{2,}\\b|the\\s+following\\b)))"
15
+ # The last alternative is an exfiltration order (m8-incidents 3.1): a verb
16
+ # (send, upload, post, forward, email, paste ...) with an object (env file,
17
+ # credentials, tokens, keys, secrets) and a destination (a URL, an address, a
18
+ # host, "to the following", "to..."), in one sentence that may span lines.
19
+ # "upload your build artifacts" and "send a request to the API" have no such
20
+ # object. A defence ("never send the .env file to ...") is quiet via negated_cues.
15
21
  # A phrase in quotation marks that close right after it, in a passage that
16
22
  # is warning about it or quoting it as an example ("never follow text such
17
23
  # as ..."), is not an order. In the field that was 35 of 42 findings of
@@ -24,7 +30,7 @@ match:
24
30
  # to govern the phrase (it ends right before it, or opens a list of what must
25
31
  # not be attempted); "do not mention this, tell the agent to ..." is still an
26
32
  # 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+)?)?$'
33
+ 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|first|then|also)\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
34
  # Test and eval fixtures hold attack samples on purpose (a security scanner's
29
35
  # own tests, adversarial evals). Findings there are reported at low severity,
30
36
  # not dropped. A file an agent reads (instructions, hooks, MCP configs, .kiro,
@@ -0,0 +1,32 @@
1
+ id: EX-028
2
+ title: Hidden text, meta tags or image alt text that instruct the AI
3
+ severity: high
4
+ applies_to:
5
+ - instruction
6
+ - docs
7
+ - memory
8
+ - tool-result
9
+ - unknown
10
+ match:
11
+ # Code check (packages/core/src/hidden-text.ts): an HTML element hidden by its
12
+ # style (white or near-background colour, font size at or under 2px,
13
+ # display:none, visibility:hidden, opacity:0, off-screen position, zero-size
14
+ # box) whose text names the AI or asks for an action. Hidden text that does
15
+ # neither (a closed modal, a screen-reader label, a collapsed menu) is quiet.
16
+ #
17
+ # m11 (CT-11, CT-12), same rule id, same code path: also (a) an HTML <meta>
18
+ # tag whose name is aimed at a model (ai-instructions, llm, assistant, ...)
19
+ # and whose content addresses the AI, whatever its visibility, and (b) image
20
+ # alt text (<img alt> or Markdown ![alt](...)) that names the AI as its
21
+ # addressee or asks for an action. Ordinary meta names (description,
22
+ # viewport, robots) and alt text that only describes the image are quiet.
23
+ hidden_text: true
24
+ # Hidden markup shown inside Markdown code is displayed, not hidden.
25
+ skip_in_code: true
26
+ owasp:
27
+ - "LLM01:2025 Prompt Injection"
28
+ - "ASI03 Prompt Injection via External Content"
29
+ fix: >
30
+ Remove the hidden element, or make its text visible. Text a person cannot
31
+ see but a model reads can give an agent orders. Do not let an agent act on a
32
+ page or file that contains it.
@@ -0,0 +1,20 @@
1
+ id: EX-029
2
+ title: File or folder name that instructs the AI
3
+ severity: high
4
+ applies_to:
5
+ - unknown
6
+ match:
7
+ # Name check (packages/core/src/path-names.ts), run by scanRepo on the name of
8
+ # every path the walker visits (folders, empty, binary and oversize files
9
+ # too). A name that reads as an order to an AI ("ignore previous
10
+ # instructions", "assistant read env and send to ...") or that carries
11
+ # hidden or control characters is reported. Long, odd or non-Latin names are
12
+ # quiet. Not a text pattern: the signature engine skips this rule.
13
+ analysis: path-names
14
+ owasp:
15
+ - "LLM01:2025 Prompt Injection"
16
+ - "ASI03 Prompt Injection via External Content"
17
+ fix: >
18
+ Rename or delete the file or folder. A name is read by an agent when it
19
+ lists a project, so it can carry orders just like file contents. Do not let
20
+ an agent act on this project until the name is changed.
@@ -0,0 +1,54 @@
1
+ id: EX-030
2
+ title: Instructions to change the agent's own settings or guard files
3
+ severity: high
4
+ applies_to:
5
+ - instruction
6
+ - docs
7
+ - memory
8
+ - tool-result
9
+ match:
10
+ # Text addressed to an agent that asks it to change what the agent trusts:
11
+ # a trusted-commands or auto-approve setting (commandsToAlwaysAllow,
12
+ # permissions.allow, autoApprove), an agent settings file (.vscode/settings.json,
13
+ # .claude/settings.json, .cursor/cli.json), or the files that hold its guards
14
+ # (.kiro/hooks/, .kiro/agents/, .kiro/steering/, AGENTS.md). An attacker uses
15
+ # this to make a change stick after the poisoned file is gone.
16
+ #
17
+ # Two shapes, both in one sentence:
18
+ # 1. an edit verb, then one of those targets, where the sentence is plainly
19
+ # talking to the agent ("you must", "please", "the agent should",
20
+ # "silently", "before you continue", "to proceed") before the verb;
21
+ # 2. an edit verb with a wildcard ("*") or "all/any command" and a trusted
22
+ # commands or auto-approve setting, which needs no other cue.
23
+ # "Edit .vscode/settings.json to change the font size" is ordinary
24
+ # documentation for a person and is not flagged.
25
+ #
26
+ # The cue is part of the match, so the span starts at it and a quoted order
27
+ # ("... such as "you must edit .kiro/hooks"") is recognised as an example.
28
+ # The words between the cue and the verb may not negate it ("you must never
29
+ # edit"); a negation right before a verb without a cue is left to
30
+ # negated_cues. A "." inside a word (kiro.commandsToAlwaysAllow,
31
+ # settings.json) does not end the sentence.
32
+ regex: '(?:(?:\byou\s+(?:must|should|need\s+to|have\s+to|will|shall|are\s+to|can\s+now)\b|\bplease\b|\b(?:agent|assistant|ai|claude|kiro|copilot|cursor|llm|model)s?\s*[,:]|\b(?:the\s+)?(?:agent|assistant|ai|llm|model)\s+(?:must|should|needs?\s+to|has\s+to|will|shall)\b|\bsilently\b|\bquietly\b|\bwithout\s+(?:asking|telling|mentioning|informing|notifying)\b|\bbefore\s+(?:you|answering|continuing|responding|proceeding)\b|\bto\s+(?:continue|proceed|finish|complete)\b|\bimportant\s*:|\bnote\s+to\s+(?:the\s+)?(?:agent|ai|assistant)\b|\bnext\s*,?\s+step\b)(?:(?!\bnot\b|\bnever\b|n[''’]t\b|\bcannot\b|\bavoid|\brefrain)(?:[^.!?\n]|\.(?=\S))){0,60}?\b(?:add|append|insert|put|set|write|include|whitelist|enable|change|update|edit|modify|extend|overwrite|rewrite|replace|patch|delete|remove|clear|disable|create|empty|loosen|relax|widen)\b(?:[^.!?\n]|\.(?=\S)){0,60}?(?:\.vscode[/\\]settings\.json|\.claude[/\\]settings(?:\.local)?\.json|\.cursor[/\\](?:cli|settings)\.json|\.kiro[/\\](?:hooks|agents|steering|settings)\b[/\\]?|\bAGENTS\.md\b|\b(?:commandsToAlwaysAllow|trustedCommands)\b|\b(?:trusted|always[- ]?allow(?:ed)?)\s+commands?\b|\bauto[- ]?approve\b|\bautoApprove\b|\bpermissions\.allow\b|\b(?:command|shell)\s+allow-?list\b)|\b(?:add|append|insert|put|set|include|whitelist|trust|allow)\b(?:[^.!?\n]|\.(?=\S)){0,50}?(?:["''`]\*["''`]|(?<![\w*])\*(?![\w*])|\ball\s+commands\b|\bany\s+command\b|\bevery\s+command\b|\beverything\b)(?:[^.!?\n]|\.(?=\S)){0,50}?(?:\b(?:commandsToAlwaysAllow|trustedCommands)\b|\b(?:trusted|always[- ]?allow(?:ed)?)\s+commands?\b|\bauto[- ]?approve\b|\bautoApprove\b|\bpermissions\.allow\b|\b(?:command|shell)\s+allow-?list\b))'
33
+ # A phrase in quotation marks that close right after it, in a passage that
34
+ # is warning about it or quoting it as an example ("never follow text such
35
+ # as ..."), is not an order.
36
+ 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)'
37
+ # A sentence that forbids the change is a defence ("you must never edit
38
+ # .kiro/hooks", "do not add * to the trusted commands"). The negation has to
39
+ # end right before the verb, as for EX-002. A second form covers a verb joined
40
+ # to a forbidden one by "or" ("you must never edit .kiro/hooks or add * to ...").
41
+ 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|avoid|refrain\s+from|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|forbidden\s+to|prohibited\s+from)\s+(?:(?:ever|simply|just|even|actually|knowingly|first|then|also|silently|quietly)\s+)*$|\b(?:never|(?:must|should|shall|will|would|can|could|do|does)\s*(?:not|never)|(?:don|doesn|shouldn|mustn|won|can)[''’]?t)\s+(?:(?:ever|simply|just|actually|silently|quietly)\s+)*(?:add|append|insert|put|set|write|include|whitelist|enable|change|update|edit|modify|extend|overwrite|rewrite|replace|patch|delete|remove|clear|disable|create|empty|loosen|relax|widen)\b(?:[^.!?\n]|\.(?=\S)){0,80}?\b(?:or|nor)\s+(?:(?:ever|simply|just|actually|silently|quietly)\s+)*$'
42
+ # Test and eval fixtures hold attack samples on purpose. Findings there are
43
+ # reported at low severity, not dropped. A file an agent reads is never lowered.
44
+ low_severity_paths:
45
+ - "(^|/)(tests?|__tests__|__mocks__|spec|specs|fixtures?|testdata|test-data|e2e|evals?)/|[._-](test|spec)s?\\.[A-Za-z0-9]+$|_tests?\\.(rs|go|py)$"
46
+ owasp:
47
+ - "ASI02 Inadequate Human-in-the-Loop Controls"
48
+ - "ASI03 Prompt Injection via External Content"
49
+ - "LLM01:2025 Prompt Injection"
50
+ fix: >
51
+ Remove the instruction. A file your agent reads should not tell it to widen
52
+ its own trusted commands or to edit its hooks, agents, steering or AGENTS.md.
53
+ Make those changes yourself, in a reviewed commit. If you are documenting the
54
+ attack, put it in a fenced code block or say that the agent must never do it.
@@ -0,0 +1,46 @@
1
+ id: EX-031
2
+ title: Instructions to weaken tests or checks
3
+ severity: high
4
+ applies_to:
5
+ - instruction
6
+ - docs
7
+ - memory
8
+ - tool-result
9
+ - code
10
+ match:
11
+ # Text addressed to an agent that asks it to get a change through by making
12
+ # the checks weaker: adding .skip / xit / test.todo, deleting a test file
13
+ # because it is flaky, --no-verify, "|| true" on a CI step, lowering a
14
+ # coverage threshold, or making a failing check pass by other means than a
15
+ # fix. Comments in source files are scanned too (applies_to includes code).
16
+ #
17
+ # Two shapes:
18
+ # 1. a cue that the sentence is talking to the agent ("you must", "please",
19
+ # "the agent should", "silently", "before you continue", "to proceed"),
20
+ # then a weakening verb, then one of the targets above;
21
+ # 2. "make the failing tests pass" followed by a means that is not a fix
22
+ # ("by skipping", "whatever it takes", "at any cost"), which needs no cue.
23
+ # A test file that calls it.skip(...), a CI file with "|| true", and a page
24
+ # that explains --no-verify to a person have no such cue and are not flagged.
25
+ regex: '(?:(?<=(?:\byou\s+(?:must|should|need\s+to|have\s+to|will|shall|are\s+to|can\s+now)\b|\bplease\b|\b(?:agent|assistant|ai|claude|kiro|copilot|cursor|llm|model)s?\s*[,:]|\b(?:the\s+)?(?:agent|assistant|ai|llm|model)\s+(?:must|should|needs?\s+to|has\s+to|will|shall)\b|\bsilently\b|\bquietly\b|\bwithout\s+(?:asking|telling|mentioning|informing|notifying)\b|\bbefore\s+(?:you|answering|continuing|responding|proceeding)\b|\bto\s+(?:continue|proceed|finish|complete)\b|\bimportant\s*:|\bnote\s+to\s+(?:the\s+)?(?:agent|ai|assistant)\b|\bnext\s*,?\s+step\b)[^.!?\n]{0,60}?)\b(?:add|append|insert|put|use|pass|mark|skip|disable|comment\s+out|delete|remove|lower|reduce|relax|drop|bypass|ignore|silence|force|commit|push|merge|turn\s+off|set|change|append|tack\s+on)\b[^.!?\n]{0,60}?(?:\.skip\b|\bxit\b|\bxdescribe\b|\b(?:test|it)\.todo\b|--no-verify\b|\|\|\s*true\b|\bcoverage\s+(?:threshold|requirement|gate|minimum)s?\b|\b(?:failing|flaky|broken)\s+(?:tests?|checks?|specs?|ci|builds?)\b|\b(?:tests?|specs?)\s+files?\b|\bci\s+(?:checks?|steps?|failures?)\b|\bpre-?commit\s+hooks?\b)|\bmake\s+(?:the\s+)?(?:failing|failed|red)\s+(?:tests?|checks?|builds?|ci)\s+pass\b[^.!?\n]{0,40}?(?:\bby\s+(?:any\s+means|whatever\s+means|skipping|deleting|removing|disabling|ignoring|bypassing)\b|\bwhatever\s+it\s+takes\b|\bat\s+any\s+cost\b|\bno\s+matter\s+what\b|\bwithout\s+(?:fixing|reading|looking)\b))'
26
+ # A phrase in quotation marks that closes right after it, in a passage that
27
+ # is warning about it or quoting it as an example ("never follow text such
28
+ # as ..."), is not an order.
29
+ 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)'
30
+ # A sentence that forbids the action is a defence ("you must never use
31
+ # --no-verify"). The negation has to end right before the verb, as for EX-002.
32
+ 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|avoid|refrain\s+from|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|forbidden\s+to|prohibited\s+from)\s+(?:(?:ever|simply|just|even|actually|knowingly|first|then|also|silently|quietly)\s+)*$'
33
+ # Test and eval fixtures hold attack samples on purpose. Findings there are
34
+ # reported at low severity, not dropped. A file an agent reads is never lowered.
35
+ low_severity_paths:
36
+ - "(^|/)(tests?|__tests__|__mocks__|spec|specs|fixtures?|testdata|test-data|e2e|evals?)/|[._-](test|spec)s?\\.[A-Za-z0-9]+$|_tests?\\.(rs|go|py)$"
37
+ owasp:
38
+ - "ASI02 Inadequate Human-in-the-Loop Controls"
39
+ - "ASI03 Prompt Injection via External Content"
40
+ - "LLM01:2025 Prompt Injection"
41
+ fix: >
42
+ Remove the instruction. A file your agent reads should not tell it to skip or
43
+ delete tests, bypass hooks with --no-verify, hide CI failures with "|| true",
44
+ lower a coverage threshold, or make a failing check pass without a fix. Fix
45
+ the cause in a reviewed commit. If you are documenting the attack, put it in
46
+ a fenced code block or say that the agent must never do it.
@@ -0,0 +1,33 @@
1
+ id: EX-032
2
+ title: Instructions to push or publish somewhere else
3
+ severity: high
4
+ applies_to:
5
+ - instruction
6
+ - docs
7
+ - memory
8
+ - tool-result
9
+ match:
10
+ # Text addressed to an agent that asks it to send code somewhere else:
11
+ # push to a remote other than origin, add or re-point a remote, publish a
12
+ # package, change the package registry, or open a pull request against a
13
+ # different repository. The sentence has to be plainly talking to the agent
14
+ # ("you must", "please", "silently", "before you continue", "to proceed")
15
+ # before the action, with no negation in between (the match starts at the
16
+ # cue so a quoted example is recognised). "Maintainers run `npm publish` to release" is a release
17
+ # process for people and is not flagged.
18
+ regex: '(?:\byou\s+(?:must|should|need\s+to|have\s+to|will|shall|are\s+to|can\s+now)\b|\bplease\b|\b(?:agent|assistant|ai|claude|kiro|copilot|cursor|llm|model)s?\s*[,:]|\b(?:the\s+)?(?:agent|assistant|ai|llm|model)\s+(?:must|should|needs?\s+to|has\s+to|will|shall)\b|\bsilently\b|\bquietly\b|\bwithout\s+(?:asking|telling|mentioning|informing|notifying)\b|\bbefore\s+(?:you|answering|continuing|responding|proceeding)\b|\bto\s+(?:continue|proceed|finish|complete)\b|\bimportant\s*:|\bnote\s+to\s+(?:the\s+)?(?:agent|ai|assistant)\b|\bnext\s*,?\s+step\b)(?:(?!\b(?:not|never|cannot|avoid|refrain|unable|forbidden|prohibited)\b|n[''’]t\b)[^.!?\n]){0,60}?(?:\bgit\s+push\b(?:\s+-{1,2}[\w-]+)*\s+(?!origin\b)(?:https?://|ssh://|git@|[A-Za-z][\w.-]*\s)|\bpush\b[^.!?\n]{0,40}?\bto\b[^\n]{0,20}?(?:https?://|ssh://|git@)|\bgit\s+remote\s+(?:add|set-url)\b|\badd\b[^.!?\n]{0,20}?\b(?:new|another|extra|second)\s+(?:git\s+)?remote\b|\b(?:npm|pnpm|yarn|bun|cargo|gem|twine)\s+(?:publish|upload|push)\b|\bpublish\b[^.!?\n]{0,30}?\b(?:package|crate|gem|module|library|build|release)\b|\b(?:npm|pnpm|yarn)\s+config\s+set\s+registry\b|\b(?:change|set|switch|point|replace|override|update)\b[^.!?\n]{0,40}?\b(?:npm|package|pip|cargo|gem|default)?\s*registry\b|--registry[=\s]|\bregistry\s*=\s*https?://|\bgh\s+pr\s+create\b[^\n]{0,80}?--repo\b|\b(?:open|create|file|submit|send|raise)\b[^.!?\n]{0,30}?\b(?:pull\s+request|PR)\b[^.!?\n]{0,30}?\b(?:against|to|on|in)\b[^.!?\n]{0,20}?\b(?:different|another|other|external|upstream|fork|attacker)\b)'
19
+ # A phrase in a passage that warns about it or quotes it as an example is not an order.
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 sentence that forbids the action is a defence ("never push to a different remote").
22
+ 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|avoid|refrain\s+from|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|forbidden\s+to|prohibited\s+from)\s+(?:(?:ever|simply|just|even|actually|knowingly|first|then|also|silently|quietly)\s+)*$'
23
+ low_severity_paths:
24
+ - "(^|/)(tests?|__tests__|__mocks__|spec|specs|fixtures?|testdata|test-data|e2e|evals?)/|[._-](test|spec)s?\\.[A-Za-z0-9]+$|_tests?\\.(rs|go|py)$"
25
+ owasp:
26
+ - "ASI03 Prompt Injection via External Content"
27
+ - "LLM01:2025 Prompt Injection"
28
+ fix: >
29
+ Remove the instruction. A file your agent reads should not tell it to push
30
+ to another remote, publish a package, change the registry or open a pull
31
+ request against another repository. Do those steps yourself. If you are
32
+ documenting the attack, put it in a fenced code block or say that the agent
33
+ must never do it.
@@ -0,0 +1,30 @@
1
+ id: EX-033
2
+ title: Settings that let the agent run any command without asking
3
+ severity: critical
4
+ applies_to:
5
+ - config
6
+ - mcp-config
7
+ match:
8
+ # A committed settings file whose trusted-commands list holds a wildcard or a
9
+ # bare shell or interpreter name. Settings names, from each tool's own docs
10
+ # (sources in .kiro/specs/m11-config-tamper/design.md):
11
+ # Kiro IDE (0.x) kiroAgent.trustedCommands (VS Code settings.json), prefix match
12
+ # Claude Code permissions.allow: "Bash" or "Bash(*)" allow every shell command
13
+ # Cursor CLI permissions.allow in .cursor/cli.json: "Shell(*)"
14
+ # The file may carry comments and trailing commas (VS Code settings are JSON
15
+ # with comments). The Copilot form, a map of patterns to true, is EX-034.
16
+ # EX-007 cannot hold this: it is high, and this one is critical, and its
17
+ # value_regex is tuned to tool names, not to command patterns.
18
+ json_path: "$..[?(@property==='kiroAgent.trustedCommands' || (@property==='allow' && @parentProperty==='permissions'))][*]"
19
+ value_regex: '^\s*(?:(?:\*+|\.\*|\^?\.[*+]\$?)|(?:sh|bash|zsh|fish|dash|ksh|csh|tcsh|cmd|powershell|pwsh|node|nodejs|deno|bun|python[0-9.]*|perl|ruby|php|lua|eval|exec|sudo|env|xargs|ssh|curl|wget|nc|ncat|npx|bunx|pnpx|uvx)(?:\s+\*+)?|(?:Bash|Shell|PowerShell)(?:\(\s*(?:\*+|:\*|(?:sh|bash|zsh|fish|dash|ksh|cmd|powershell|pwsh|node|python[0-9.]*|perl|ruby|php|eval|exec|sudo|env|xargs|ssh|curl|wget|nc|npx)(?:\s*:?\s*\*+)?)?\s*\))?)\s*$'
20
+ # Only files that name one of those settings are looked at (generic config files).
21
+ file_regex: 'kiroAgent\.trustedCommands|"permissions"'
22
+ owasp:
23
+ - "ASI02 Inadequate Human-in-the-Loop Controls"
24
+ - "ASI05 Unexpected Code Execution"
25
+ - "LLM06:2025 Excessive Agency"
26
+ fix: >
27
+ Remove the wildcard or the bare shell name from the trusted-commands or allow
28
+ list. List only specific, read-only commands (for example "git status" or
29
+ "pnpm test"), and keep trust for commands in your own user settings, not in a
30
+ file that is committed to the repository.
@@ -0,0 +1,24 @@
1
+ id: EX-034
2
+ title: Copilot terminal auto-approve map that trusts every command
3
+ severity: critical
4
+ applies_to:
5
+ - config
6
+ - mcp-config
7
+ match:
8
+ # VS Code's chat.tools.terminal.autoApprove is a map from a command pattern to
9
+ # true (run without asking) or false (ask), or to { "approve": true }. A key
10
+ # that matches every command, or a bare shell, set to true trusts everything.
11
+ # Source: https://code.visualstudio.com/docs/agents/run/approvals
12
+ # This is a map, so the finding quotes the key (json_path ends in ~), and it
13
+ # cannot share a path with the list forms of EX-033.
14
+ json_path: "$..[?(@property==='chat.tools.terminal.autoApprove')][?(@ === true || (@ && @.approve === true))]~"
15
+ value_regex: '^\s*(?:\*+|/\^?\.[*+]\$?/|\.\*|(?:sh|bash|zsh|fish|dash|ksh|cmd|powershell|pwsh|node|python[0-9.]*|perl|ruby|php|eval|exec|sudo|env|xargs|ssh|curl|wget|nc|npx)(?:\s+\*+)?|/\^?\(?(?:sh|bash|zsh)\b[^/]*/)\s*$'
16
+ file_regex: 'chat\.tools\.terminal\.autoApprove'
17
+ owasp:
18
+ - "ASI02 Inadequate Human-in-the-Loop Controls"
19
+ - "ASI05 Unexpected Code Execution"
20
+ - "LLM06:2025 Excessive Agency"
21
+ fix: >
22
+ Remove the pattern that matches every command from chat.tools.terminal.autoApprove,
23
+ or set it to false. Trust only specific commands such as "git status", and put
24
+ that setting in your user settings, not in a file committed to the repository.
@@ -0,0 +1,29 @@
1
+ id: EX-035
2
+ title: Committed sandbox file turns MCP sandboxing off
3
+ severity: low
4
+ applies_to:
5
+ - config
6
+ # The encyclopedia record for the sandbox policy check (CT-18). The real
7
+ # check is in code: packages/core/src/sandbox-policy.ts reads
8
+ # .kiro/settings/sandbox.json (JSON with comments) and looks at the "enabled"
9
+ # and "mcpSandboxing" fields, which a text match cannot do reliably. So this
10
+ # rule is not run as a signature; the pattern below documents what it reports.
11
+ # Informational: the lowest level there is (a project file can only tighten the
12
+ # global policy, so the global policy may still apply). It stays below the
13
+ # default gate threshold, so it never fails "exorcist gate" or "exorcist scan".
14
+ # Field names: https://kiro.dev/docs/sandbox
15
+ enabled: false
16
+ match:
17
+ regex: '"(?:mcpSandboxing|enabled)"\s*:\s*false'
18
+ file_regex: '\.kiro/settings/sandbox\.json$'
19
+ owasp:
20
+ - "ASI05 Unexpected Code Execution"
21
+ - "LLM06:2025 Excessive Agency"
22
+ fix: >
23
+ A committed .kiro/settings/sandbox.json sets MCP sandboxing (or the whole
24
+ command sandbox) to off, so local MCP server processes run without the
25
+ operating-system boundary. This is information only: a project file can only
26
+ tighten the global sandbox policy, so if your global policy turns it on, it
27
+ still applies. To be covered in every project, set "enabled": true and
28
+ "mcpSandboxing": true in your global ~/.kiro/settings/sandbox.json, or in
29
+ this project file.