MCP scan allowlist ignores `tool:` field, so entries apply server-wide

Aperta
#1,256 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 11 giorni

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
3/5
Tempo stimato
1-2 giorni
Idoneità per principianti
76/100
Tipo di issue
Bug
Chiarezza
Specificata chiaramente
Stato di attività
Attiva
Stack tecnologico
python
Ambito
security, testing

Direzione di ricerca

Start with scripts/mcp-scan/process_scan_results.py, especially load_security_config() and is_issue_allowed(), then inspect the scanner tests. Add coverage for per-tool matches, duplicate codes across tools, and entries without tool:. Done means tool-scoped entries only allow matching findings, server-wide entries retain their current behavior, and each match reports its own reason.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

needs-triage

security.allowed_issues entries in MCP server specs commonly include a tool: field, which reads as scoping the entry to one tool. scripts/mcp-scan/process_scan_results.py never reads it. load_security_config() builds a dict keyed only by code (line 84), and is_issue_allowed() checks only the finding's AITech/AISubtech codes against that dict (lines 91-127). So every entry allowlists its code for every tool on the server, including tools added in future versions.

Impact

  • 7 specs use tool: across 17 entries (heroku, phoenix, sentry, server-everything, arxiv, clickhouse, redis). All of them are broader than they look.
  • npx/heroku-mcp-server/spec.yaml has eight separate AISubtech-12.1.2 entries, one per tool. They collapse into a single dict key, so 12.1.2 is allowlisted on every Heroku tool, and only the last entry's reason survives into the scan output.
  • Prefix matching widens this further. An AITech-12.1 entry also covers every AISubtech-12.1.x on every tool.
  • It makes narrow allowlists for LLM-analyzer flakes unsafe. For example, supabase's main build just failed on a nondeterministic AITech-8.2 (data exfiltration) finding on get_publishable_keys. Allowlisting that would also silence any future 8.2 finding on execute_sql.

Proposed fix

  • Store allowlist entries as a list of (code, tool, reason) rather than a dict keyed by code.
  • When an entry has tool, match only findings whose tool_name equals it. Entries without tool keep today's server-wide behavior, so existing specs without tool: don't change.
  • Keep each matched entry's own reason in the output.
  • Add tests for per-tool matching, duplicate codes across tools, and the no-tool fallback.

Rollout note

Turning this on will narrow 17 existing entries. A spec whose allowlist was quietly covering other tools could start failing its scan. Running the scanner over those 7 specs before merging would show which entries need to be widened or duplicated.

Lingua principale
Go
Stelle
8
Fork
7
Merge medio
6g 15h
PR unite (30g)
74

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di stacklok/dockyard

Tutte le issue di stacklok/dockyard

Issue simili

Altre issue su Go

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.