Skip to content

fix(security): require CMCP_POLICY_HASH and CMCP_CATALOG_HASH in production - #198

Merged
imran-siddique merged 2 commits into
mainfrom
fix/security-critical-hash-enforcement
Jun 6, 2026
Merged

imran-siddique merged 2 commits into
mainfrom
fix/security-critical-hash-enforcement

Conversation

@imran-siddique

Copy link
Copy Markdown
Member

Summary

Test plan

  • test_startup_fails_when_policy_hash_unset_and_not_dev_mode — asserts exit 1 when CMCP_POLICY_HASH unset
  • test_startup_fails_when_catalog_hash_unset_and_not_dev_mode — asserts exit 1 when CMCP_CATALOG_HASH unset
  • All 230 existing tests pass

🤖 Generated with Claude Code

imran-siddique and others added 2 commits June 6, 2026 13:31
…uction

Closes #136, #137.

Without pinned hashes, a compromised policy bundle or tool catalog would
load silently. Gateway now exits with code 1 if either env var is unset
and CMCP_DEV_MODE is not set, making tampered artifacts detectable at
startup rather than at runtime.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@imran-siddique
imran-siddique merged commit 5efcf9b into main Jun 6, 2026
7 checks passed
@imran-siddique
imran-siddique deleted the fix/security-critical-hash-enforcement branch June 6, 2026 20:38
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.

CRITICAL: Policy bundle hash verification skipped when CMCP_POLICY_HASH is unset (POLICY-001)

1 participant