@exorcist-98/cli 0.2.0 → 0.3.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.
- package/README.md +8 -8
- package/definitions/EX-028-hidden-text.yaml +8 -1
- package/definitions/EX-030-settings-tamper-instruction.yaml +54 -0
- package/definitions/EX-031-weaken-checks-instruction.yaml +46 -0
- package/definitions/EX-032-redirect-publish-instruction.yaml +33 -0
- package/definitions/EX-033-trusts-all-commands.yaml +30 -0
- package/definitions/EX-034-trusts-all-commands-map.yaml +24 -0
- package/definitions/EX-035-sandbox-mcp-off.yaml +29 -0
- package/definitions/EX-036-lifecycle-script-exfiltration.yaml +27 -0
- package/dist/index.mjs +2897 -659
- package/package.json +1 -1
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.
|
|
14
|
+
npx -y @exorcist-98/cli@0.3.1 scan .
|
|
15
15
|
```
|
|
16
16
|
|
|
17
17
|
Every finding shows the file, line, the exact text, how serious it is and how
|
|
@@ -39,7 +39,7 @@ request.
|
|
|
39
39
|
## Map the haunted house
|
|
40
40
|
|
|
41
41
|
```sh
|
|
42
|
-
npx -y @exorcist-98/cli@0.
|
|
42
|
+
npx -y @exorcist-98/cli@0.3.1 map .
|
|
43
43
|
```
|
|
44
44
|
|
|
45
45
|
For every MCP config in the folder, lists which servers sit in the three rooms
|
|
@@ -52,8 +52,8 @@ data. The rules are in `definitions/capabilities.yaml`.
|
|
|
52
52
|
## Disinfect (exorcise)
|
|
53
53
|
|
|
54
54
|
```sh
|
|
55
|
-
npx -y @exorcist-98/cli@0.
|
|
56
|
-
npx -y @exorcist-98/cli@0.
|
|
55
|
+
npx -y @exorcist-98/cli@0.3.1 exorcise . # dry run: prints a unified diff
|
|
56
|
+
npx -y @exorcist-98/cli@0.3.1 exorcise . --write # apply, with a vault backup first
|
|
57
57
|
```
|
|
58
58
|
|
|
59
59
|
Only threats with one safe, mechanical fix are repaired: hidden characters
|
|
@@ -67,7 +67,7 @@ human"), and `exorcist vault restore <id>` puts every file back byte for byte.
|
|
|
67
67
|
## Protect your MCP servers
|
|
68
68
|
|
|
69
69
|
```sh
|
|
70
|
-
npx -y @exorcist-98/cli@0.
|
|
70
|
+
npx -y @exorcist-98/cli@0.3.1 wrap .kiro/settings/mcp.json
|
|
71
71
|
```
|
|
72
72
|
|
|
73
73
|
`wrap` puts every server in the file, local or remote, behind the Real-Time
|
|
@@ -79,9 +79,9 @@ instruct your agent. `unwrap` restores the file exactly. See
|
|
|
79
79
|
## Share approved tools with your team: exorcist.lock
|
|
80
80
|
|
|
81
81
|
```sh
|
|
82
|
-
npx -y @exorcist-98/cli@0.
|
|
83
|
-
npx -y @exorcist-98/cli@0.
|
|
84
|
-
npx -y @exorcist-98/cli@0.
|
|
82
|
+
npx -y @exorcist-98/cli@0.3.1 lock # write exorcist.lock, then commit it
|
|
83
|
+
npx -y @exorcist-98/cli@0.3.1 lock --check # exit 1 if any tool or program changed
|
|
84
|
+
npx -y @exorcist-98/cli@0.3.1 lock --check --static # starts nothing: names, programs, URLs only
|
|
85
85
|
```
|
|
86
86
|
|
|
87
87
|
`exorcist.lock` records the fingerprint of every tool your MCP servers list,
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
id: EX-028
|
|
2
|
-
title: Hidden text that
|
|
2
|
+
title: Hidden text, meta tags or image alt text that instruct the AI
|
|
3
3
|
severity: high
|
|
4
4
|
applies_to:
|
|
5
5
|
- instruction
|
|
@@ -13,6 +13,13 @@ match:
|
|
|
13
13
|
# display:none, visibility:hidden, opacity:0, off-screen position, zero-size
|
|
14
14
|
# box) whose text names the AI or asks for an action. Hidden text that does
|
|
15
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 ) 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.
|
|
16
23
|
hidden_text: true
|
|
17
24
|
# Hidden markup shown inside Markdown code is displayed, not hidden.
|
|
18
25
|
skip_in_code: true
|
|
@@ -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.
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
id: EX-036
|
|
2
|
+
title: Lifecycle script sends secrets out through a local file
|
|
3
|
+
severity: critical
|
|
4
|
+
applies_to:
|
|
5
|
+
- manifest
|
|
6
|
+
match:
|
|
7
|
+
# Code check (packages/core/src/lifecycle-scripts.ts), run by scanRepo on every
|
|
8
|
+
# walked package.json. A script that a package manager runs by itself
|
|
9
|
+
# (preinstall, install, postinstall, prepare, prepublish, and the pre/post
|
|
10
|
+
# hook of any script such as pretest) is followed into the local file it runs
|
|
11
|
+
# (node x.js, sh x.sh, python x.py, ./x). It is reported only when that file
|
|
12
|
+
# holds both a secret source (.env, .npmrc, ~/.aws, ~/.ssh, a private key
|
|
13
|
+
# file, the whole of process.env) and a sender (http, https, fetch, a socket,
|
|
14
|
+
# curl or wget). A script that only builds, lints or starts a local server,
|
|
15
|
+
# reads .env and never sends, or sends and reads no secret, is quiet.
|
|
16
|
+
# Not a text pattern: the signature engine skips this rule.
|
|
17
|
+
analysis: lifecycle-scripts
|
|
18
|
+
owasp:
|
|
19
|
+
- "ASI07 Supply Chain Vulnerabilities"
|
|
20
|
+
- "LLM02:2025 Sensitive Information Disclosure"
|
|
21
|
+
- "ASI05 Sensitive Data Leakage"
|
|
22
|
+
fix: >
|
|
23
|
+
Do not run this project's scripts until you have read the file named in the
|
|
24
|
+
finding. A script like this runs when you (or your AI agent) install the
|
|
25
|
+
project or run its tests, and it sends your .env or credentials to another
|
|
26
|
+
computer with no instruction for the agent to obey. Remove the script, or
|
|
27
|
+
remove the code in the file that reads secrets or sends data out.
|