Skip to content

feat: scanner rules upgrade — 60 → 108 patterns from 5 scanner source codes#15

Open
ithiria894 wants to merge 6 commits intomainfrom
feature/scanner-rules-upgrade
Open

feat: scanner rules upgrade — 60 → 108 patterns from 5 scanner source codes#15
ithiria894 wants to merge 6 commits intomainfrom
feature/scanner-rules-upgrade

Conversation

@ithiria894
Copy link
Copy Markdown
Member

Summary

Cherry-picked detection patterns from reading actual source code of 5 runtime MCP security scanners:

  • Cisco YARA (865 stars) — tool poisoning, coercive injection, script injection, SQL injection
  • AgentSeal scan-mcp (151 stars) — cross-server detection, annotation checks, credential combos
  • MCP-Shield (550 stars) — additional shadowing patterns
  • Nova Proximity (287 stars) — impersonation, deserialization, wildcard permissions

What changed

  • 60 → 108 detection patterns (+80% coverage)
  • 4 new categories: coercive injection (11 rules), impersonation (3), script injection (3), deserialization
  • Extended existing: tool poisoning +10, data exfiltration +5, prompt injection +5, credential harvest +4, tool shadowing +4, supply chain +1
  • Cross-server analysis: tool name collision + tool reference detection (with 4-char minimum to reduce FP)
  • Annotation permission check: flags servers where >50% tools are destructive
  • False positive exclusions: template text, linter comments, test frameworks, security research docs
  • Credential tool allowlist: skip login/oauth/connect tools for suspicious param check

Why this matters

Before: CCO had ZERO coverage of tool poisoning secondary behaviors, coercive injection, impersonation, cross-server shadowing, and annotation abuse.

Test plan

  • Playwright E2E: 182 findings from 33 servers, 452 tools, zero JS errors
  • Module load test: 108 patterns across 15 categories
  • False positive exclusions verified (template/test/docs text skipped)
  • Manual: verify no false positives on known-good MCP servers

🤖 Generated with Claude Code

ithiria894 and others added 6 commits March 28, 2026 16:39
…se positive exclusions

Cherry-picked from 5 runtime MCP scanners (reading actual source code):
Cisco YARA (865★), AgentSeal scan-mcp (151★), MCP-Shield (550★), Nova (287★)

New categories: Tool Poisoning extended (+10), Coercive Injection (+11),
Impersonation (+3), Script Injection (+3). Extended: Prompt Injection (+5),
Data Exfiltration (+5). False positive exclusions from Cisco YARA negation
+ cc-audit patterns (templates, linters, test frameworks, security research).

Tested: 97 findings from 33 servers, 452 tools. Zero JS errors.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…n, annotation checks

Cherry-picked from AgentSeal scan-mcp, MCP-Shield, Nova Proximity:

New detection capabilities:
- Cross-server tool name collision (MCPR-103): flags when same tool name on 2+ servers
- Cross-server tool reference: flags when one tool's description references another server's tool
  (with 4-char minimum name length to reduce FP, from AgentSeal)
- Excessive destructive permissions (MCPR-108): flags servers where >50% tools are destructive
- Credential read-then-send combo patterns (from AgentSeal MCPR-102)
- Unsafe deserialization (pickle.load, yaml.load) from Nova
- Wildcard permission detection (Bash(*), Write(*)) from Nova
- Extended tool shadowing (data forwarding, BCC leak, output redirect)
- Extended exfil endpoints (pastebin, transfer.sh, file.io)
- Extended supply chain (unpinned uvx/pip)
- Extended credential patterns (wallet.dat, keychain, mcp.json)
- Credential tool allowlist (skip login/oauth/connect tools for MCPR-105)
- Extended suspicious param names (+10: env_file, dotenv, session_token, etc.)

Total: 60 → 108 patterns, 15 categories, cross-server analysis, annotation checks.
Tested: 182 findings from 33 servers, 452 tools. Zero JS errors.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…rompt

Each security finding now shows description + clickable "Fix with Claude →"
that copies a detailed prompt to clipboard including: finding details, rule ID,
severity, matched text, context, server name, and instructions to evaluate
whether it's real or false positive.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…xclusion, fix-with-claude UI

False positive reduction:
- CH-009: removed "access" verb (FP on "access level, password protection"),
  reduced match range 120→40 chars, require specific action verbs (read/cat/steal)
- CH-010: reduced match range 120→40 chars, require specific send verbs
- TS-009: raised MIN_CROSS_REF_NAME_LEN to 8 + added 40 common tool words
  exclusion (search, fill, click, hover, etc.) — eliminates FP on Playwright/S2
- TS-009: downgraded from high to medium severity

Results: ClickUp 5 FP → 0. Semantic-scholar 10 FP → 3. Playwright FP eliminated.

Also added: Fix with Claude → on every finding (copy prompt to clipboard),
finding cards with description + rule ID.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Root cause analysis of every non-test-server finding:
- ClickUp: "access level, password protection" matched CH-009 → fixed by removing
  "access" verb and tightening range 120→40 chars
- Context7: "You MUST call this function before" matched CI-004 → fixed by removing
  "You MUST call" pattern (legitimate API workflow ordering)
- Teams: "Search emails" matched TP-011 → fixed by removing "search" verb and
  requiring "all/any/every" qualifier
- Playwright: 22 self-collisions → fixed by using Set() for server dedup
  (same server in multiple scopes no longer counts as collision)
- semantic-scholar/arxiv/paper-distill: "search_papers" collision → added to
  COMMON_TOOL_WORDS exclusion list
- devto/twitter: "get_user_by_username" collision → added to exclusion list

Also fixed: COMMON_TOOL_WORDS was const inside function (temporal dead zone
error) → moved to module level.

Result: 95 findings, ALL on intentionally-malicious test servers.
ZERO false positives on real MCP servers (ClickUp, Context7, Teams, Playwright,
Tavily, Firecrawl, Exa, Semantic Scholar, etc.)

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…rect

- .sec-tag: changed from dark bg to rgba(255,255,255,0.1) with border for visibility
- Verified ALL 95 findings against actual test server source code — 100% correct
- Zero false positives on real MCP servers (ClickUp, Context7, Teams, Playwright, etc.)
- Zero false positives on clean test servers (clean-server, time-server)

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant