Repository navigation
fix(verify)!: issuer key authorization before the signature, and no VALID without a policy - #494
Conversation
rajnisht7
left a comment
There was a problem hiding this comment.
also there is no warning at verify_cose_manifest(), as it returns as verified=True even on wrong issuer
|
Thanks @imran-siddique for folding the guide into this PR, that saves a separate follow-up. I checked the page at 1e8872d against
Optional, for people upgrading: a box under "Applies to SDK 0.16.0", plus the CLI flag next to the Python example: !!! warning "Breaking change in SDK 0.16.0"
Up to SDK 0.15.0, a verifier that set `trusted_keys` without `trusted_key_issuers` skipped issuer authorization and could return `VALID`. From 0.16.0 the same configuration returns `UNVERIFIABLE`. If you upgrade, add `trusted_key_issuers` first.manifest verify signed.json --public-key pub.hex \
--authorized-issuer spiffe://trust.example/issuer/prod+1 to both points from @rajnisht7. The missing backslashes come from the |
carloshvp
left a comment
There was a problem hiding this comment.
Reviewed 1e8872d in an isolated Python 3.12 checkout. The issuer-authorization change behaves as intended: neither a missing policy nor an empty/unauthorized policy permits VALID, and the v0.1/COSE rejection paths leave signatures unverified. The COSE ordering and every-signer authorization checks agree with spec section 5.3.3.
Required repository correction, separate from the implementation: commit 142d338 has no Signed-off-by trailer. CONTRIBUTING.md requires sign-off on every commit; sign-offs on the merge and later documentation commit do not cover this first commit. Please add the missing DCO sign-off before approval.
Validation: the complete SDK suite passed (2316 passed, 10 skipped, 19 subtests passed); Ruff, mypy, Bandit and the locked-dependency audit passed. The normal docs build and built-asset link check passed, with eight changelog cross-reference warnings. Cross-repository validation also passed: cMCP #743 at 8fd3c150a86f2f387ff6ad80090c846324517994 ran its full CI test selection against this SDK head with 2446 passed and 29 skipped. These results do not claim execution of skipped optional/native fixtures.
Non-blocking cleanup: I agree with the existing CLI continuation and issuer-guide comments. Also, git diff --check reports five added CRLF lines in python/tests/vectors/AM-VEC-021.json:77-81; please normalize the touched vector formatting while updating the PR. I found no new blocking defect in the authorization implementation.
The cMCP issuer-policy change still needs to land before cMCP advances its locked SDK dependency to 0.16.0; publishing or merging either repository was outside this review. Requesting changes for the missing required DCO sign-off.
…ALID without a policy Spec 5.3.3 requires key resolution and issuer authorization to complete before the signature is verified, and forbids VALID when authorization cannot be determined. The SDK diverged from both, as litzki-systems found writing the issuer key authorization guide (#493): - trusted_key_issuers=None skipped the check, so a manifest could reach VALID with no issuer authorization. It now leaves the signature unverified and returns UNVERIFIABLE with a warning naming 5.3.3, distinct from the MISMATCH of a failed check. - On the v0.2 COSE path the envelope signature was verified before issuer authorization. Keys are now resolved and authorized from the decoded envelope first; an unauthorized key is refused unchecked (AM-VEC-COSE-009 now records signature_verified false). manifest verify gains --authorized-issuer. Every vector context that expects a verified signature carries trusted_key_issuers; AM-VEC-025 and AM-VEC-COSE-016 pin the no-policy case. A v0.1 manifest without issuer can no longer reach VALID. The issuer guide follows the 0.16.0 behaviour. Version 0.16.0, not tagged. BREAKING CHANGE: callers that pass trusted_keys without trusted_key_issuers now get UNVERIFIABLE instead of VALID. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: Imran Siddique <45405841+imran-siddique@users.noreply.github.com>
The issuer guide gains the missing-policy step in its flow, the UNVERIFIABLE warning, the v0.1 no-issuer outcome, an upgrade box for 0.16.0 and the --authorized-issuer CLI form. The verify docstring's multi-line example carries its continuation backslashes, and cli.md is regenerated from it. verify_cose_manifest() states that it does not check issuer key authorization. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: Imran Siddique <45405841+imran-siddique@users.noreply.github.com>
1e8872d to
f78ff22
Compare
|
Rebuilt on current main as two signed commits,
Could you re-review by Oct 16? |
|
Re-checked the guide at One sentence is now out of date. Under "Gate on the result, not on
Since 0.16.0,
I reviewed the guide only, not the implementation. |
… 0.16.0 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: Imran Siddique <45405841+imran-siddique@users.noreply.github.com>
|
@litzki-systems applied as written in |
carloshvp
left a comment
There was a problem hiding this comment.
Re-reviewed bf21623. The required DCO correction is complete: every commit in the replacement PR range carries Signed-off-by. The issuer guide, generated CLI continuations and low-level COSE API caveat now agree with the implementation.
Issuer authorization remains fail closed and precedes signature verification. An independent 17-case matrix with signature-verification spies confirmed missing policy gives UNVERIFIABLE, empty/unauthorized grants give MISMATCH, and refused paths make no cryptographic verification call. Authorized v0.1, COSE and real Ed25519/ML-DSA hybrid controls reach VALID; a hybrid with either signer unauthorized is refused before signature verification.
Validation on isolated Python 3.12: the complete SDK suite passed with 2405 passed, 10 skipped and 27 subtests passed, with 91.53% coverage. CI-equivalent Ruff, mypy, Bandit and locked-dependency audit passed. The normal docs build and built-asset checks passed; the same eight changelog cross-reference warnings reproduce on current main. Merge simulation against current main was clean. Cross-repository cMCP #743 at 283352cee6d5c7ede57d43ae7d26a56de1ac0d2e passed its complete CI selection against this SDK head: 2470 passed, 29 skipped. Skipped optional/native fixtures are not claimed as executed.
The five added CRLF lines in AM-VEC-021.json preserve the existing file convention: main has 83/83 CRLF lines and this head has 88/88. The CR-at-EOL-aware diff check is clean, so I am not treating whole-file line-ending normalization as an approval requirement.
Approving this head. cMCP's issuer-policy integration must land before its locked SDK dependency advances to 0.16.0; its unused signature-only helper also needs the documented migration follow-up.
Resolves the CHANGELOG.md conflict with #498 by keeping both entries under Changed. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: Imran Siddique <45405841+imran-siddique@users.noreply.github.com>
d260fb5
carloshvp
left a comment
There was a problem hiding this comment.
Re-reviewed exact head d260fb50205b5db79cc24cb81e0b89331862326b after the merge from main dismissed the earlier approvals. The merge adds main's documentation/spec updates; python/ and scripts/ are byte-unchanged from the previously approved bf21623f896c4ca1b8bec7e55a807331f10fbfa0. I checked the changelog conflict resolution and both entries remain. All four commits in the PR range carry Signed-off-by.
Fresh isolated Python 3.12 validation: the complete SDK suite passed with 2405 passed, 10 skipped and 27 subtests passed, with 91.53% coverage. The independent 17-case signature-spy matrix passed again for v0.1, COSE Sign1 and real Ed25519/ML-DSA hybrid envelopes: missing policy gives UNVERIFIABLE, empty/unauthorized grants give MISMATCH, refused paths make no signature-verification call, and every hybrid signer must be authorized before verification. Authorized controls reach VALID.
CI-equivalent Ruff, strict mypy, Bandit and the locked-dependency audit passed. The docs build and built-asset reference check passed; the same eight changelog cross-reference warnings reproduce on current main. The CR-at-EOL-aware diff check and merge simulation are clean. The skipped cases include unavailable AGT/native-hardware fixtures and are not claimed as executed.
The CLI example now includes both continuation backslashes in the source docstring and generated reference, so I resolved the addressed outdated thread. The companion cMCP issuer-policy integration #743 is now merged; cMCP must retain that integration when advancing its SDK pin to 0.16.0.
Approving this current head. I found no new blocking defect in the merge or the issuer-authorization implementation. All hosted checks were successful at the final refresh.
Spec §5.3.3 says a verifier MUST NOT return
VALIDunless the signing key is authorized for the manifest's declaredissuer, MUST complete that before verifying the signature, and MUST tell an authorization failure apart from authorization that cannot be determined. The SDK missed two of those. @litzki-systems found both while writing the issuer key authorization guide in #493.trusted_key_issuers=None._signature_key_issuer_mismatchreturned early, so trusted keys alone reachedVALID. Now the signature is not verified and the result isUNVERIFIABLE, with a warning naming §5.3.3. A key the policy does not authorize staysMISMATCH, so the two conditions stay distinct.Order on v0.2. The COSE envelope signature was verified first and issuer authorization ran afterwards.
_authorize_before_signaturenow decodes the envelope (steps 1 to 4, no signature), resolves eachkidagainsttrusted_keys, and authorizes it before step 5. An unauthorized key is refused unchecked: AM-VEC-COSE-009 now recordssignature_verified: false.signature_validstaystrue, because the bytes are sound.Knock-on changes:
manifest verify --authorized-issuer(repeatable). Without it the CLI result isUNVERIFIABLE.trusted_key_issuers. New AM-VEC-025 (v0.1) and AM-VEC-COSE-016 (v0.2) pin the no-policy case.issuercan no longer reachVALID, since there is no issuer to authorize the key for.This is breaking for any caller that sets
trusted_keyswithouttrusted_key_issuers. That includes cMCP, which passes no policy today: its main fails 23 tests against this branch. The cMCP PR for that is agentrust-io/cmcp#743, and it has to land before cMCP moves its pin offagent-manifest==0.15.0.Evidence: 2306 passed, 20 skipped (2292 before); ruff and mypy clean. Eight new tests, the two new vectors and the changed AM-VEC-COSE-009, eleven checks in all, fail with
_verify.pyandcli.pyrestored frombd37750. A signature-call spy shows no Ed25519 verification on the refused paths.Once this merges, the "known divergence" note in #493's guide is stale and comes out.
🤖 Generated with Claude Code