Skip to content

fix(core): reject malformed payment signature headers early#2005

Open
Bortlesboat wants to merge 3 commits intox402-foundation:mainfrom
Bortlesboat:codex/x402-header-validation-800
Open

fix(core): reject malformed payment signature headers early#2005
Bortlesboat wants to merge 3 commits intox402-foundation:mainfrom
Bortlesboat:codex/x402-header-validation-800

Conversation

@Bortlesboat
Copy link
Copy Markdown
Contributor

Fixes #800.

Summary

  • validate decoded PAYMENT-SIGNATURE payloads up front with the existing schema
  • return a 400 payment error for malformed base64, JSON, or payload shapes before route pricing runs
  • add focused HTTP resource server coverage to prove malformed headers never reach verification

Verification

  • pnpm --dir typescript/packages/core test -- test/unit/http/x402HTTPResourceService.test.ts
  • pnpm --dir typescript/packages/core test -- test/unit/http
  • pnpm --dir typescript/packages/core exec prettier --check src/http/index.ts src/http/x402HTTPResourceServer.ts test/unit/http/x402HTTPResourceService.test.ts
  • pnpm --dir typescript/packages/core exec eslint src/http/index.ts src/http/x402HTTPResourceServer.ts test/unit/http/x402HTTPResourceService.test.ts

@vercel
Copy link
Copy Markdown

vercel bot commented Apr 11, 2026

@Bortlesboat is attempting to deploy a commit to the Coinbase Team on Vercel.

A member of the Team first needs to authorize it.

@github-actions github-actions bot added typescript sdk Changes to core v2 packages labels Apr 11, 2026
@Bortlesboat Bortlesboat marked this pull request as ready for review April 11, 2026 21:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

sdk Changes to core v2 packages typescript

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Missing validation for malformed payment request headers

1 participant