Full-codebase-audit 2026-05-30 outputs: - Audit report: 09 - Audits/Full Codebase Audit - 2026-05-30.md - 81 issue files ISSUE-055..135 (decisions + 1 skipped no-brainer). - Scanner docs from scratch (was zero): architecture, data model, API ref, payment flow, operations runbook + repo README. - Doc-sync updates across API reference, data models, flows, design system. - Secret Rotation Runbook (08 - Operations) for the exposed credentials. - Reusable workflow guide (07 - Development) + .claude/workflows/full-codebase-audit.js. Issues remain status:open intentionally — the code fixes are uncommitted-then-committed working-tree changes per repo and aren't "resolved" until merged/deployed. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
1.9 KiB
issue, title, severity, domain, labels, status, created, source
| issue | title | severity | domain | labels | status | created | source | ||||
|---|---|---|---|---|---|---|---|---|---|---|---|
| 056 | Backend: verifyPayment and paymentCallback routes unauthenticated — payment completion exploitable | critical | Payment |
|
open | 2026-05-30 | Full Codebase Audit 2026-05-30 |
Backend: verifyPayment and paymentCallback routes unauthenticated — payment completion exploitable
Severity: critical Domain: Payment Labels: security, backend, authentication, webhook
Description
POST /payments/verify and POST /payments/callback are registered without authenticateToken middleware. Additionally, a non-web3 bypass path (isWeb3Payment === false) allows marking a payment completed without any verifiable on-chain or provider proof.
An unauthenticated actor can call /payments/verify for any payment ID and trigger the completion side-effects (status change, offer acceptance, escrow release) without owning that payment. The callback endpoint is similarly unguarded, allowing fake webhook injection.
Options
- Require
authenticateToken+ ownership check on/verify; enforce HMAC signature verification on/callbackas a provider webhook; remove theisWeb3Payment=falsebypass so completion always requires verifiable proof. - Treat
/callbackas a provider webhook with HMAC only; add auth+ownership for/verify. - Remove the non-web3 bypass so payments without a verifiable tx cannot be marked completed.
Recommendation
Add authenticateToken + ownership to /verify, enforce HMAC/on-chain verification on /callback as a webhook endpoint, and remove the isWeb3Payment=false bypass so completion always requires verifiable proof.
Affected Files
backend/src/services/payment/paymentControllerRoutes.ts— lines 20–21
References
- Full Codebase Audit 2026-05-30 — DEC-23