Repository navigation
docs: update HMAC-SHA256 webhook spec to match reference implementation - #1382
Merged
EmmaLouise2018 merged 2 commits intoMar 11, 2026
Merged
Conversation
The HMAC-SHA256 section was missing several details that the @adcp/client
reference implementation already requires:
- Timestamp-based replay protection (X-ADCP-Timestamp header, 5-minute window)
- Signature format: sha256= prefix before hex digest
- Signed message format: {unix_timestamp}.{rawBody}
- Constant-time comparison for signature verification
- Raw body verification guidance (critical for cross-language interop)
These details are already implemented in @adcp/client (JS) test suite:
https://github.com/adcontextprotocol/adcp-client/blob/main/test/webhook-signature-verification.test.js
Also adds explicit guidance that implementations MUST sign the same
serialization sent on the wire, to prevent mismatches between signing
and verification when different JSON serializers produce different output.
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
The HMAC-SHA256 webhook authentication section is missing several details that the
@adcp/clientreference implementation already requires. This causes interoperability issues — implementers following the spec produce code that doesn't match what the reference client libraries actually do.Changes
Updates the HMAC-SHA256 section in
docs/building/implementation/webhooks.mdxto document:X-ADCP-Timestampheader — Unix timestamp in seconds for replay protection (5-minute window)sha256=signature prefix — the signature format issha256={hex_digest}, not bare hex{unix_timestamp}.{rawBody}, not justrawBodytimingSafeEqualto prevent timing attacksWhy this matters
The current spec says
HMAC-SHA256(secret, rawBody)with a bare hex signature and no timestamp. The@adcp/clientJS reference implementation doessha256=HMAC-SHA256(secret, "{timestamp}.{rawBody}")with asha256=prefix and a 5-minute replay window. This mismatch has caused real interop failures between orchestrators and sales agents — see:Reference
The
@adcp/clientJS library test suite defines the expected behavior:https://github.com/adcontextprotocol/adcp-client/blob/main/test/webhook-signature-verification.test.js