Skip to content

fix: harden payment challenge handling#562

Merged
brendanjryan merged 3 commits into
mainfrom
brendanjryan/issue-545-hardening
Jun 17, 2026
Merged

fix: harden payment challenge handling#562
brendanjryan merged 3 commits into
mainfrom
brendanjryan/issue-545-hardening

Conversation

@brendanjryan

@brendanjryan brendanjryan commented Jun 17, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • Enforced a 32-byte minimum for server challenge secret keys.
  • Capped oversized WWW-Authenticate request parameters before decode and parse.
  • Updated docs, examples, fixtures, and release notes for the stricter server secret requirement.

Motivation

Weak HMAC keys reduce challenge ID binding strength, and unbounded auth-param parsing lets oversized headers reach decode and JSON parsing work.

Key design considerations

  • Validates both explicit secretKey config and MPP_SECRET_KEY env fallback through the same Mppx.create path.
  • Keeps the size cap on the encoded request auth-param so oversized values are rejected before allocation-heavy parsing.
  • Leaves low-level challenge HMAC helpers usable for deterministic protocol vectors while enforcing the operational key policy at server construction.

Conformance-PR: tempoxyz/mpp-tools#35

@pkg-pr-new

pkg-pr-new Bot commented Jun 17, 2026

Copy link
Copy Markdown

Open in StackBlitz

npm i https://pkg.pr.new/mppx@562

commit: 454c9e4

@brendanjryan brendanjryan merged commit ec1ad50 into main Jun 17, 2026
14 of 15 checks passed
@brendanjryan brendanjryan deleted the brendanjryan/issue-545-hardening branch June 17, 2026 16:04
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