fix(cmcp-verify): cross-check enforcement_mode in TRACE claim re-verification - #590
Open
rajnisht7 wants to merge 1 commit into
Open
fix(cmcp-verify): cross-check enforcement_mode in TRACE claim re-verification#590rajnisht7 wants to merge 1 commit into
rajnisht7 wants to merge 1 commit into
Conversation
|
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
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.
What
Extends the enforcement_mode cross-check from #584 (startup-time binding) to claim-time re-verification:
verify_trace_claim's optional Agent Manifest binding check now also cross-checks the enforcement mode recorded at claim-creation time against a fresh re-verification of the manifest.Why
Found while verifying #584 would go fully green:
verify_trace_claim(src/cmcp_verify/verify.py) callsverify_agent_manifest_bindingtoo, but never passedenforcement_mode. It's wrapped in try/except so it doesn't crash, and no current test exercises a manifest that declares enforcement_modethrough this specific path, so #584 stays green either way but once agent-manifest ships the enforcement_mode check, any manifest built to spec (enforcement_mode is REQUIRED per 6.2) would start silently reportingagent_manifest.binding: unverifiedhere, with nothing actually wrong. This closes that gap before it can surface:AgentIdentityInfo/AgentIdentityOutnow carry the enforcement mode recorded at claim-creation time, andverify_trace_claimcross-checks it the same way it already does forintent_hash,policy_bundle_hash`, etc.Security impact
Yes. Same class of change as #584/#576, applied to the claim re-verification path instead of the startup path. Before this change, a claim's recorded enforcement mode was never checked against anything an attacker who could modify a claim or a bug that mis-recorded it) could assert any enforcement mode with no cross-check catching it. After this change, the claimed mode must match what a fresh, cryptographic re-verification of the manifest actually attests, or the binding is reported unverified. Also hardens against a garbled/invalid claimed value (
ValueErrorfrom an unrecognizedenforcement_modestring) now fails closed via the same except path as every other binding failure, instead of raising unhandled.Test plan
pytestpassesruff checkpassesmypypassesDCO sign-off
Developer Certificate of Origin (https://developercertificate.org).