Skip to content

x402 stats endpoint returns data without payment and preflight omits X-PAYMENT #2

@TateLyman

Description

@TateLyman

I ran a no-payment public check against the x402 stats endpoint advertised in the app.

Scope:

  • public repo copy in src/app/api/page.tsx marks GET /v1/x402/stats as tier: "x402";
  • public x402 page says clients should set the X-PAYMENT header;
  • live endpoint: https://api.solsentry.app/v1/x402/stats.

Repro, with no payment headers, no wallet signatures, and no paid call:

npx --yes x402-surface-check@latest --endpoint --method GET https://api.solsentry.app/v1/x402/stats --origin https://solsentry.app

curl -si https://api.solsentry.app/v1/x402/stats \
  -H 'Origin: https://solsentry.app'

curl -si -X OPTIONS https://api.solsentry.app/v1/x402/stats \
  -H 'Origin: https://solsentry.app' \
  -H 'Access-Control-Request-Method: GET' \
  -H 'Access-Control-Request-Headers: X-PAYMENT, Content-Type'

Observed:

  • the no-payment GET returns 200 OK with ledger data;
  • the same response advertises X-Payment-Required: true, X-Price-USDC: 0.001, X-Payment-Enforce: true, treasury wallet, network, token, and protocol headers;
  • browser preflight returns 204, but Access-Control-Allow-Headers is only Content-Type, Authorization, X-Client-ID, so a browser client following the page copy and sending X-PAYMENT would fail preflight.

This may be intentional if /v1/x402/stats is meant to stay public as a live ledger. If so, I would make the docs and headers say that clearly, for example "public ledger endpoint; payment headers describe the paid API family." If it is meant to be paid, the 402 challenge should happen before returning the stats payload, and preflight should allow the payment header documented by the page.

Main launch-readiness mismatch:

  1. docs and headers say x402/enforced;
  2. live no-payment response returns the data;
  3. browser preflight does not allow the documented payment header.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions