Skip to content

Fix registry and MCP safety gaps - #50

Closed
cursor[bot] wants to merge 1 commit into
mainfrom
cursor/critical-bug-investigation-00ea
Closed

cursor[bot] wants to merge 1 commit into
mainfrom
cursor/critical-bug-investigation-00ea

Conversation

@cursor

@cursor cursor Bot commented Sep 17, 2026

Copy link
Copy Markdown
Contributor

Bug and impact

  • Registry fetch could crash after accepting a valid remote snapshot when the local SSOT was corrupt or quarantine staging failed, instead of returning a fail-closed result.
  • Corrupt, empty, or sparse generated threat-registry projections could silently disable packaged detector rules.
  • Projection generation dropped semantic_aliases and mythic_framing records.
  • MCP-exposed JSON/raw inputs could be parsed or stripped before shared size limits, creating resource-exhaustion paths.
  • A symlinked registry_fetch/ quarantine layout could expose, purge, or receive writes outside the quarantine root.
  • Fresh installs could resolve MCP 2.x even though this code imports the MCP 1.x FastMCP API.

Root cause

Recent registry/quarantine hardening added new layout and projection paths, but several failure boundaries still trusted first-found local files, followed symlinked layout directories, or parsed unbounded MCP strings before applying existing limits. Package metadata also lacked the MCP <2 compatibility bound.

Fix

  • Return fail-closed registry fetch errors for corrupt SSOT and quarantine write failures.
  • Skip invalid/empty registry candidates and overlay generated projections onto packaged rules.
  • Preserve semantic_aliases and mythic_framing in generated projections.
  • Apply SCP_MAX_INPUT_CHARS before MCP/core JSON parsing and raw contribution stripping.
  • Reject or skip unsafe symlinked registry-fetch layout dirs in quarantine write/list/purge/quota paths.
  • Bound MCP dependency to mcp>=1.2.0,<2.0.0.

Validation

  • RED/GREEN regressions added for each concrete trigger.
  • python3 -m compileall -q src/scp && git diff --check && PYTHONPATH=src python3 -m pytest tests/test_registry_fetch_r4.py tests/test_registry_load_order_r5.py tests/test_pattern_record_r1.py tests/test_security_regressions.py tests/test_appsec_antigen_mcp_gates.py tests/test_registry_contribute_r6.py -q -> 88 passed.
  • PYTHONPATH=src python3 -m pytest -q -> 367 passed / 3 skipped / 2 failed; failures are pre-existing vendored contract hash mismatches for scp_mcp_v1 and scp_mcp_v1.1.
Open in Web View Automation 

@ManintheCrowds

Copy link
Copy Markdown
Owner

Audit: symlink layout + quarantine write fail-closed + related registry guards covered by #60. Projection-bucket work already on main via #43. MCP size-limit / contribute extras not required for this consolidation. Closing as superseded by #60.

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.

2 participants