spec(webhooks): fix vectors 004/005 to apply full @target-uri canonicalization#2470
Merged
Conversation
…alization Positive webhook-signing vectors 004-default-port-stripped and 005-percent-encoded-path shipped with signatures that only verified if the signer skipped canonicalization steps 4 (strip default ports) and 6 (uppercase %xx / decode percent-encoded unreserved). The shared rules in request-signing/canonicalization.json mandate both, so the two sets contradicted each other. - 004: signature base now uses canonical @target-uri without :443. - 005: input URL changed from op%2dabc (%2d is unreserved '-', which step 6 requires to decode — the old example overloaded "uppercase hex" with "decode unreserved") to op_%e2%98%83 (reserved UTF-8 bytes, same pattern as request-signing positive/008). Canonical @target-uri uppercases to %E2%98%83. Both Ed25519 signatures regenerated and verified against test-ed25519-webhook-2026. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Empty frontmatter silently no-ops during version. Populate per the project convention for published-spec changes (the test vectors ship at adcontextprotocol.org/test-vectors/). Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
EmmaLouise2018
approved these changes
Apr 20, 2026
This was referenced Apr 20, 2026
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
@target-uricanonicalization steps 4 (strip default ports) and 6 (uppercase%xx/ decode percent-encoded unreserved). The shared rules inrequest-signing/canonicalization.jsonmandate both, so the two vector sets contradicted each other.:443stripped (input URL unchanged).op%2dabc(%2dis unreserved-, which step 6 requires to decode — the old example overloaded "uppercase hex" with "decode unreserved") toop_%e2%98%83(reserved UTF-8 bytes, same pattern asrequest-signing/positive/008). Canonical@target-uriuppercases to%E2%98%83.test-ed25519-webhook-2026keypair.Implementor note
Any verifier that previously passed the old 004/005 has a latent canonicalization bug: it accepted signatures produced over the as-received URL rather than the canonical
@target-uri. That verifier will silently disagree with a correctly-canonicalizing producer on any URL containing:443,:80, or lowercase%xxin the path, causingwebhook_signature_invalidat step 10. Re-run the positive suite after pulling.Test plan
npm run test:unit(587/587) +npm run typecheckpassing locallytest-ed25519-webhook-2026public key:443,%2d, or lowercase-hex path encoding🤖 Generated with Claude Code