fix(security): require CMCP_POLICY_HASH and CMCP_CATALOG_HASH in production - #198
Merged
Merged
Conversation
…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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
CMCP_POLICY_HASHorCMCP_CATALOG_HASHis unset outside of dev mode (closes CRITICAL: Policy bundle hash verification skipped when CMCP_POLICY_HASH is unset (POLICY-001) #136, CRITICAL: Tool catalog hash verification skipped when CMCP_CATALOG_HASH is unset (POLICY-002) #137)CMCP_DEV_MODE=1bypasses the check for local development onlyTest plan
test_startup_fails_when_policy_hash_unset_and_not_dev_mode— asserts exit 1 whenCMCP_POLICY_HASHunsettest_startup_fails_when_catalog_hash_unset_and_not_dev_mode— asserts exit 1 whenCMCP_CATALOG_HASHunset🤖 Generated with Claude Code