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

未关闭
#1,256 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

维护者通常 11 天内回复

还没有人认领这个 Issue。

评估

难度
3/5
预计耗时
1-2 天
新手友好度
76/100
Issue 类型
缺陷
描述清晰度
描述清楚
活跃度
活跃
技术栈
python
领域
security, testing

调研方向

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.

由索引模型根据 Issue 内容生成。

描述

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.

主要语言
Go
星标
8
派生
7
平均合并
6 天 15 小时
30 天内合并 PR
74

环境准备

  • 没有 Dockerfile 或 Docker Compose 文件
  • 没有 Pull Request 模板
  • 阅读贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

stacklok/dockyard 的其他 Issue

查看 stacklok/dockyard 的全部 Issue

相似的 Issue

更多 Go Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。