feat: request body digest binding#300
Closed
brendanjryan wants to merge 1 commit intobrendan/binding-semantics-hardeningfrom
Closed
feat: request body digest binding#300brendanjryan wants to merge 1 commit intobrendan/binding-semantics-hardeningfrom
brendanjryan wants to merge 1 commit intobrendan/binding-semantics-hardeningfrom
Conversation
commit: |
HTTP transport now captures body bytes and computes SHA-256 digest during captureRequest. The digest is included in the challenge HMAC binding and verified against the current request body on credential presentation. This prevents replay attacks where a credential issued for one request body is presented with a different body. GET/bodiless requests omit the digest gracefully.
fa9a919 to
7e96ff5
Compare
bbaa7da to
45a8016
Compare
This was referenced Apr 6, 2026
Collaborator
Author
|
Closing as redundant and not worth the tradeoffs |
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
Binds the HTTP request body to the payment challenge via SHA-256 digest, preventing replay attacks where a credential issued for one request body is presented with a different body.
Changes
src/server/Transport.ts: HTTP transport'scaptureRequestnow reads body bytes and computes abodyDigest(sha-256=...). AddedsafeBodyByteshelper for graceful body extraction.src/server/Mppx.ts: PassescapturedRequest.bodyDigestas the challenge'sdigestfield (HMAC-bound via the 6-slot binding: realm|method|intent|request|expires|digest). After HMAC and scope verification pass, verifies the echoed challenge's digest matches the current request body digest.Verification flow
Tests added
sha-256=...digest when request has a bodyStack
PR 3 of 3 in the mppx hardening stack (stacked on PR #299):