@exorcist-98/mcp-server 0.1.1 → 0.2.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.1"] }
40
+ "exorcist": { "command": "npx", "args": ["-y", "@exorcist-98/mcp-server@0.2.0"] }
25
41
  }
26
42
  }
27
43
  ```
@@ -25,6 +25,17 @@ match:
25
25
  classes:
26
26
  - zero-width
27
27
  severity: medium
28
+ # A single U+200B between @ and a name is how changelogs keep GitHub from
29
+ # notifying that person (an @ sign, a zero-width space, then the name). It carries no message, so it is low and
30
+ # does not count toward the five short runs that make a file suspect.
31
+ mention_guard:
32
+ severity: low
33
+ # Test and eval fixtures hold attack samples on purpose (a security scanner's
34
+ # own tests, adversarial evals). Findings there are reported at low severity,
35
+ # not dropped. A file an agent reads (instructions, hooks, MCP configs, .kiro,
36
+ # .claude, .cursor) is never lowered, wherever it sits.
37
+ low_severity_paths:
38
+ - "(^|/)(tests?|__tests__|__mocks__|spec|specs|fixtures?|testdata|test-data|e2e|evals?)/|[._-](test|spec)s?\\.[A-Za-z0-9]+$|_tests?\\.(rs|go|py)$"
28
39
  owasp:
29
40
  - "LLM01:2025 Prompt Injection"
30
41
  - "ASI03 Prompt Injection via External Content"
@@ -11,13 +11,32 @@ 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
18
24
  # EX-002 (docs/FIELD_REPORT.md). A quoted phrase that runs on into a longer
19
25
  # instruction is still reported.
20
26
  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)'
27
+ # A phrase the passage itself forbids is a defence, not an attack: "never
28
+ # ignore earlier instructions", "users cannot bypass the prompt", "it must not
29
+ # attempt to tell the agent to ignore earlier instructions". The negation has
30
+ # to govern the phrase (it ends right before it, or opens a list of what must
31
+ # not be attempted); "do not mention this, tell the agent to ..." is still an
32
+ # attack (m7-precision, packages/core/src/scanner/context.ts isNegated).
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+)?)?$'
34
+ # Test and eval fixtures hold attack samples on purpose (a security scanner's
35
+ # own tests, adversarial evals). Findings there are reported at low severity,
36
+ # not dropped. A file an agent reads (instructions, hooks, MCP configs, .kiro,
37
+ # .claude, .cursor) is never lowered, wherever it sits.
38
+ low_severity_paths:
39
+ - "(^|/)(tests?|__tests__|__mocks__|spec|specs|fixtures?|testdata|test-data|e2e|evals?)/|[._-](test|spec)s?\\.[A-Za-z0-9]+$|_tests?\\.(rs|go|py)$"
21
40
  owasp:
22
41
  - "LLM01:2025 Prompt Injection"
23
42
  - "ASI03 Prompt Injection via External Content"
@@ -16,6 +16,16 @@ match:
16
16
  # A comment inside Markdown code (backticks or a fenced block) is displayed,
17
17
  # not hidden, so it is not smuggling.
18
18
  skip_in_code: true
19
+ # Only a bare linter directive is exempt: `<!-- noqa -->` or `<!-- noqa: CODE,
20
+ # CODE -->` and nothing else. Free text after the code is still checked, so
21
+ # starting a comment with noqa does not hide an instruction.
22
+ exclude_regex: '^<!--\s*noqa(?::\s*[A-Z0-9-]+(?:,\s*[A-Z0-9-]+)*)?\s*-->$'
23
+ # Test and eval fixtures hold attack samples on purpose (a security scanner's
24
+ # own tests, adversarial evals). Findings there are reported at low severity,
25
+ # not dropped. A file an agent reads (instructions, hooks, MCP configs, .kiro,
26
+ # .claude, .cursor) is never lowered, wherever it sits.
27
+ low_severity_paths:
28
+ - "(^|/)(tests?|__tests__|__mocks__|spec|specs|fixtures?|testdata|test-data|e2e|evals?)/|[._-](test|spec)s?\\.[A-Za-z0-9]+$|_tests?\\.(rs|go|py)$"
19
29
  owasp:
20
30
  - "LLM01:2025 Prompt Injection"
21
31
  - "ASI03 Prompt Injection via External Content"
@@ -5,7 +5,7 @@ applies_to:
5
5
  - mcp-config
6
6
  - config
7
7
  match:
8
- regex: "(before (responding|answering|using this tool)|(prior to|before) (invoking|calling|running|using) (this|any|the)\\b|do not (inform|tell|mention|notify|alert) the user|without (telling|informing|notifying|asking) the user|(keep|stay) (this |it )?(quiet|secret|hidden) from|this is required for (audit|telemetry|logging)|(send|include|attach|upload|pass|forward)[^.\\n]{0,60}(~/\\.ssh|id_rsa|\\.env\\b|\\.aws/credentials|private key))"
8
+ regex: "(before (responding|answering|using this tool)|(prior to|before) (invoking|calling|running|using) (this|any|the)\\b|do not (inform|tell|mention|notify|alert) the user|without (telling|informing|notifying|asking) the user|(keep|stay) (this |it )?(quiet|secret|hidden) from|this is required for (audit|telemetry|logging)|\\b(?:send|include|attach|upload|pass|forward)(?:s|es|ed|ing)?\\b[^.\\n]{0,60}(~/\\.ssh|id_rsa|\\.env\\b|\\.aws/credentials|private key))"
9
9
  # Only in files that describe MCP servers or tools. Model or prompt configs
10
10
  # that say \"do not mention\" are ordinary (seen in openai/codex).
11
11
  file_regex: "(\"mcpServers\"|\"inputSchema\"|\"input_schema\")"
@@ -12,8 +12,14 @@ match:
12
12
  # in q= or d= is an image setting (quality, density) that image CDNs and
13
13
  # Next.js image URLs carry, not data.
14
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/)"
15
+ # Well-known badge services take query strings by design. So do the image
16
+ # links Google Docs (googleusercontent, ?key=) and GitBook (alt=media&token=)
17
+ # make for pictures that were pasted into a document: the key or token is
18
+ # the picture's own address, issued by the host that serves it. Both are
19
+ # anchored: the host is whole dot-separated labels (so attacker-googleusercontent.com
20
+ # is not exempt), and the query is exactly ?key=... or ?alt=media&token=...
21
+ # with nothing before, between or after (so data cannot ride along).
22
+ exclude_regex: "\\]\\(https?://(?:(?:img\\.shields\\.io|shields\\.io|badgen\\.net|badge\\.fury\\.io|(?:app\\.)?codecov\\.io|coveralls\\.io|(?:api\\.)?travis-ci\\.(?:org|com)|(?:dl\\.)?circleci\\.com|api\\.netlify\\.com|deepwiki\\.com/badge|www\\.bestpractices\\.dev|api\\.securityscorecards\\.dev|(?:static\\.)?pepy\\.tech|sonarcloud\\.io|readthedocs\\.org|img\\.badgesize\\.io|snyk\\.io/test|discord(?:app)?\\.com/api/guilds|camo\\.githubusercontent\\.com|vercel\\.com/button|deploy\\.workers\\.cloudflare\\.com)/|github\\.com/[^)]*/(?:badge\\.svg|actions/workflows/))|\\]\\(https?://(?:github\\.com/[^)?]+\\?raw=true\\)|raw\\.githubusercontent\\.com/)|\\]\\(https?://(?:[a-z0-9-]+\\.)*googleusercontent\\.com/(?:docsz|d)/[^)\\s?]*\\?key=[A-Za-z0-9_-]+\\)|\\]\\(https?://(?:[a-z0-9-]+-)?files\\.gitbook\\.io/~/files/v0/b/gitbook-x-prod\\.appspot\\.com/o/[^)\\s?]*\\?alt=media\\\\?&token=[A-Za-z0-9-]+\\)"
17
23
  # An image inside Markdown code (backticks or a fenced block) is shown as
18
24
  # text and never loaded, so it cannot send anything (security docs quote
19
25
  # defanged examples that way).
@@ -15,6 +15,13 @@ match:
15
15
  # EX-002 (docs/FIELD_REPORT.md). A quoted phrase that runs on into a longer
16
16
  # instruction is still reported.
17
17
  quoted_example_cues: '\b(?:such\s+as|e\.g\.|i\.e\.|for\s+(?:example|instance)|never|do\s+not|don''t|must\s+not|should\s+not|refuse|reject|treat|untrusted|inert|injection|jailbreak|adversarial|attack|malicious|hostile|crafted|hijack|red[- ]?team|detect|flag|block|strip|sanitiz|filter|pattern|phrase|cases?\b|example|quarantine|directive|look(?:s|ing)?\s+like|shaped)'
18
+ # A phrase the passage itself forbids is a defence, not an attack: "never
19
+ # ignore earlier instructions", "users cannot bypass the prompt", "it must not
20
+ # attempt to tell the agent to ignore earlier instructions". The negation has
21
+ # to govern the phrase (it ends right before it, or opens a list of what must
22
+ # not be attempted); "do not mention this, tell the agent to ..." is still an
23
+ # attack (m7-precision, packages/core/src/scanner/context.ts isNegated).
24
+ negated_cues: '\b(?:(?:must|should|shall|will|would|may|might|can|could)\s*(?:not|never)|(?:must|should|shall|would|could|do|does|did|is|are|was|were|has|have|ca|wo)n[''’]t|cannot|do(?:es)?\s+not|did\s+not|never|refus(?:e|es|ed|ing)\s+to|(?:is|are)\s+not\s+(?:to|allowed\s+to|permitted\s+to|able\s+to)|unable\s+to)\s+(?:(?:ever|simply|just|even|actually|knowingly)\s+)*$|\b(?:(?:must|should|shall|will|would|may|might|can|could)\s*(?:not|never)|(?:must|should|shall|would|could|do|does|did|is|are|was|were|has|have|ca|wo)n[''’]t|cannot)\s+(?:attempt|try|seek)\s+to\b[^.!?\n]*?\b(?:tell|instruct|ask|cause|make|persuade|trick|convince|get|force|let|allow)\w*\s+(?:(?:the|an?|your|any)\s+)?(?:(?:agent|model|assistant|ai|llm|bot|claude)s?\s+)?(?:to\s+)?$|\b(?:(?:must|should|shall|will|would|may|might|can|could)\s*(?:not|never)|(?:must|should|shall|would|could|do|does|did|is|are|was|were|has|have|ca|wo)n[''’]t|cannot|do(?:es)?\s+not|did\s+not|never|refus(?:e|es|ed|ing)\s+to|(?:is|are)\s+not\s+(?:to|allowed\s+to|permitted\s+to|able\s+to)|unable\s+to)\s+(?:follow|obey|comply\s+with|act\s+on|honou?r|accept|execute|run)\s+(?:(?:any|an?|the|such|these|those|that|text|instructions?|requests?|commands?|messages?|content|tool\s+output|it)\s+)*(?:(?:that|which)\s+)?(?:(?:say|says|saying|tell|tells|telling|ask|asks|asking)\s+(?:you\s+)?(?:to\s+)?)?$'
18
25
  owasp:
19
26
  - "ASI02 Inadequate Human-in-the-Loop Controls"
20
27
  - "LLM06:2025 Excessive Agency"
@@ -13,6 +13,12 @@ match:
13
13
  # naming the servers on each leg; critical when a server on a leg has
14
14
  # auto-approved tools.
15
15
  analysis: trifecta
16
+ # Test and eval fixtures hold attack samples on purpose (a security scanner's
17
+ # own tests, adversarial evals). Findings there are reported at low severity,
18
+ # not dropped. A file an agent reads (instructions, hooks, MCP configs, .kiro,
19
+ # .claude, .cursor) is never lowered, wherever it sits.
20
+ low_severity_paths:
21
+ - "(^|/)(tests?|__tests__|__mocks__|spec|specs|fixtures?|testdata|test-data|e2e|evals?)/|[._-](test|spec)s?\\.[A-Za-z0-9]+$|_tests?\\.(rs|go|py)$"
16
22
  owasp:
17
23
  - "LLM01:2025 Prompt Injection"
18
24
  - "LLM06:2025 Excessive Agency"
@@ -0,0 +1,25 @@
1
+ id: EX-028
2
+ title: Hidden text that instructs 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
+ hidden_text: true
17
+ # Hidden markup shown inside Markdown code is displayed, not hidden.
18
+ skip_in_code: true
19
+ owasp:
20
+ - "LLM01:2025 Prompt Injection"
21
+ - "ASI03 Prompt Injection via External Content"
22
+ fix: >
23
+ Remove the hidden element, or make its text visible. Text a person cannot
24
+ see but a model reads can give an agent orders. Do not let an agent act on a
25
+ 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.