Skip to content

settlement-engine webhook signing uses the raw JSON body string ordering #567

Description

@therealjhay

ProblemsignPayload signs JSON.stringify({ event }); property order is deterministic for the same object, but any reserialization (logging, storing, resending) changes the body and invalidates the signature.

  1. Signing depends on serialization order.
  2. Re-delivery with re-serialized body fails signature.
  3. No canonicalization.

Solution

  • Canonicalize the payload before signing and on verification.
  • Sign and verify with the same canonical form.
  • Test reserialization stability.

Acceptance Criteria

  • Signature survives canonical re-serialization.
  • Verification matches.
  • pnpm --filter @bettapay/webhook-delivery build passes.

Note for Contributors: Write a clear PR description. Show a canonicalization test.

Metadata

Metadata

Labels

GrantFox OSSIssue tracked in GrantFox OSSMaybe RewardedIssue may be eligible for a GrantFox rewardThird CampaignCampaign: Third Campaign

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions