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

Ouverte
#1,256 0 commentaires 0 réactions 0 personnes assignées Voir sur GitHub

Les mainteneurs répondent en général sous 11 jours

Personne n'a encore pris cette issue.

Évaluation

Difficulté
3/5
Temps estimé
1-2 jours
Accessibilité débutants
76/100
Type d'issue
Bug
Clarté
Clairement spécifiée
Activité
Active
Stack technique
python
Domaine
security, testing

Piste de recherche

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.

Rédigé par le modèle d'indexation à partir du texte de l'issue.

Description

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.

Langage dominant
Go
Étoiles
8
Forks
7
Merge moyen
6 j 15 h
PR mergées (30 j)
74

Préparer son environnement

Par où commencer

  1. Lisez l'issue en entier, puis le guide de contribution du projet.
  2. Signalez en commentaire que vous la prenez — cela évite que deux personnes fassent le même travail.
  3. Forkez le dépôt et travaillez sur une branche.
  4. Ouvrez une pull request qui référence le numéro de l'issue.

Autres issues de stacklok/dockyard

Toutes les issues de stacklok/dockyard

Issues similaires

Plus d'issues Go

Recevez les nouvelles issues par e-mail

Un résumé court des issues GitHub adaptées aux débutants.