GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — fix(verify): reject unsupported receiptVersion values (closes #53) by akuraposo · Pull Request #9 · permission-protocol/pp-cli

Conversation

@akuraposo

@akuraposo akuraposo commented Jun 4, 2026

Copy link
Copy Markdown

Summary

Fixes #53: the local reference verifier in pp-cli only checked
receiptVersion as a required signed field, not as a required v1
constant. A signed, unexpired receipt with receiptVersion: "v2" (or
any other unsupported value) was accepted by pp verify as long as
canonicalization was jcs_v1, signatureAlg was ed25519, the
signature verified, and the receipt was not expired or revoked.

That means a verifier claiming pp-receipt-v1 compatibility could
silently accept receipts from an unsupported receipt-version
namespace, downgrading the local trust boundary.

Fix

Added a RECEIPT_VERSION = 'v1' constant in src/verify.ts and an
explicit version check after the canonicalization check. The
verifier now fails closed with MALFORMED_RECEIPT and exit code 3
if any value other than "v1" is supplied.

The constant value matches the v1 receipt spec at
https://github.com/permission-protocol/receipt-spec, which states:

receiptVersion for this specification is "v1".
Constraints: MUST equal "v1" for this spec

Validation

  • npm test -- --run — all 6 tests pass (5 pre-existing + 1 new
    regression test that forges receiptVersion: "v2" on a valid
    receipt and expects MALFORMED_RECEIPT)
  • npm run build — clean
  • git diff --check — clean

Bounty

Submitted for assessment under #36 as a distinct Ed25519
verification-flow flaw. Payout details can be provided privately
after validation.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
akuraposo
fix(verify): reject unsupported receiptVersion values (closes #53)
abdfdbc
The local reference verifier only checked `receiptVersion` as a required
signed field, not as a required v1 constant. A signed, unexpired receipt
with `receiptVersion: "v2"` (or any other unsupported value) was
accepted by `pp verify` as long as `canonicalization` was `jcs_v1`,
`signatureAlg` was `ed25519`, the signature verified, and the receipt
was not expired or revoked.

That means a verifier claiming `pp-receipt-v1` compatibility could
silently accept receipts from an unsupported receipt-version namespace,
downgrading the local trust boundary.

This patch adds an explicit `receiptVersion === 'v1'` check (matching
the v1 spec) and fails closed with a `MALFORMED_RECEIPT` error if any
other value is supplied.

- Added `RECEIPT_VERSION = 'v1'` constant in `src/verify.ts`
- Added explicit version check after the canonicalization check
- Added regression test that forges receiptVersion='v2' on a valid
  receipt and expects MALFORMED_RECEIPT
- All 6 tests pass (5 pre-existing + 1 new)
- `npm run build` clean

Closes #53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

No reviews

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

1 participant

@akuraposo
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.