Skip to content

Fix registry quarantine provenance and MCP dependency crash - #54

Closed
cursor[bot] wants to merge 2 commits into
mainfrom
cursor/critical-bug-investigation-8f29
Closed

cursor[bot] wants to merge 2 commits into
mainfrom
cursor/critical-bug-investigation-8f29

Conversation

@cursor

@cursor cursor Bot commented Sep 23, 2026

Copy link
Copy Markdown
Contributor

Bug and impact

  • A forged .json file under the registry_fetch quarantine layout could act as both the registry snapshot payload and its own sidecar metadata. With operator approval/consent, apply_merge() accepted it and merged untrusted pattern records, bypassing the intended requirement that merge inputs are .txt content files produced by scp_fetch_registry.
  • Fresh installs resolved mcp 2.x, but scp.antigen_mcp imports the MCP 1.x mcp.server.fastmcp API, causing Antigen MCP import/startup failure.

Root cause

  • _load_quarantine_snapshot() verified the path was under registry_fetch/ and that sidecar reason=registry_fetch, but did not require the merge input path to be a .txt content file. For a .json payload, with_suffix('.json') pointed back to the same file.
  • pyproject.toml declared mcp>=1.2.0 without an upper bound despite the code using the pre-2.0 FastMCP API.

Fix

  • Reject non-.txt registry-fetch quarantine merge inputs with quarantine_provenance_rejected.
  • Add a regression test for self-certifying .json payloads.
  • Constrain the runtime dependency to mcp>=1.2.0,<2.0.0.

Validation

  • RED: PYTHONPATH=src python3 -m pytest tests/test_registry_ssot.py::test_apply_merge_rejects_json_payload_self_certifying_as_sidecar -q failed before the fix because the forged payload merged.
  • GREEN: PYTHONPATH=src python3 -m pytest tests/test_registry_ssot.py tests/test_registry_fetch_r4.py tests/test_registry_load_order_r5.py tests/test_appsec_antigen_mcp_gates.py -q -> 47 passed.
  • python3 -m compileall -q src/scp && git diff --check -> passed.
  • Full PYTHONPATH=src python3 -m pytest -q was also run: 351 passed / 3 skipped / 7 failed. The failures were existing unrelated baselines: contract hash mismatches, RT11 residual, and optional coincurve setup tests without antigen extras.
Open in Web View Automation 

@ManintheCrowds

Copy link
Copy Markdown
Owner

Audit: self-certifying sidecar reject in #60; MCP pin skipped. 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