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

Đang mở
#1,256 0 bình luận 0 reaction 0 người được giao Xem trên GitHub

Maintainer thường phản hồi trong vòng 11 ngày

Chưa có ai nhận issue này.

Đánh giá

Độ khó
3/5
Thời gian dự kiến
1-2 ngày
Mức phù hợp với người mới
76/100
Loại issue
Lỗi
Độ rõ ràng
Đặc tả rõ ràng
Mức độ hoạt động
Sôi nổi
Công nghệ
python
Lĩnh vực
security, testing

Hướng nghiên cứu

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.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

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.

Ngôn ngữ chính
Go
Star
8
Fork
7
Merge trung bình
6 ngày 15 giờ
Pull request đã merge (30 ngày)
74

Chuẩn bị môi trường

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của stacklok/dockyard

Tất cả issue của stacklok/dockyard

Issue tương tự

Thêm issue về Go

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.