Skip to content

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

Merged
adrianboros merged 1 commit into
interledger:mainfrom
SashaMIT:fix/require-content-digest-when-body-present
Oct 7, 2026
Merged

adrianboros merged 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
Contributor

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.

@adrianboros adrianboros left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks. The fix is correct and matches open-payments-node#38. This PR has no tests and the repo has no CI. I will open a follow-up PR that adds tests and CI. It also fixes older bugs in content digest and JWK verification, which this fix depends on.

@adrianboros

Copy link
Copy Markdown
Collaborator

Follow-up with tests and fixes: #10. Please merge this PR first.

@adrianboros
adrianboros merged commit 717ac03 into interledger:main Oct 7, 2026
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.

2 participants