Skip to content

fix(HttpSignature): require content-digest when request body present - #9

Open
SashaMIT wants to merge 1 commit into
interledger:mainfrom
SashaMIT:fix/require-content-digest-when-body-present
Open

fix(HttpSignature): require content-digest when request body present#9
SashaMIT wants to merge 1 commit into
interledger:mainfrom
SashaMIT:fix/require-content-digest-when-body-present

Conversation

@SashaMIT

@SashaMIT SashaMIT commented Aug 8, 2026

Copy link
Copy Markdown

Changes proposed in this pull request

When a request has a body, validateSigInputComponents now requires content-digest to be covered by Signature-Input and verified (along with content-length / content-type). Previously, omitting content-digest failed open: a Signature-Input covering only @method / @target-uri / etc. could validate while the body was swapped.

Context

Sibling of interledger/open-payments-go#50 and the matching Node fix in open-payments-node (@interledger/http-signature-utils). Tip verified at 7cca666907f2376f8dd51d9f707e0a4da722f292.

Test plan

  • CI green on this PR
  • Confirm PHP callers that validate bodied signed requests include content-digest in Signature-Input (expected for Open Payments / GNAP)

Made with Cursor

Signature-Input that omitted content-digest previously validated when a
body was present (fail-open), allowing the body to be swapped under an
otherwise valid signature. Align with open-payments-go: if the request
has a body, content-digest must be covered and verified.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant