Skip to content

docs(audit): M4.2 independent UPI payment security and production readiness audit - #29

Merged
Satelink-Protocol merged 1 commit into
launch-mvpfrom
feature/m4-2-upi-security-audit
Nov 3, 2026
Merged

Satelink-Protocol merged 1 commit into
launch-mvpfrom
feature/m4-2-upi-security-audit

Conversation

@Satelink-Protocol

Copy link
Copy Markdown
Contributor

Summary of Milestone M4.2 Audit

This PR delivers Milestone M4.2: an independent, zero-trust security and production-readiness audit of the merged M4.1 UPI-first checkout implementation.

Key Audit Findings

  1. Fatal Webhook Signature Incompatibility (Critical - SEC-01):

    • PhonePeAdapter.verifyWebhookSignature hashes the raw JSON body ({"response":"..."}) rather than PhonePe's official Base64 response string: SHA256(payload.response + saltKey) + "###" + saltIndex.
    • Empirically verified: authentic PhonePe callbacks are rejected 100% of the time with HTTP 401.
  2. Zero Amount Verification on Webhook (Critical - FIN-01):

    • processUpiWebhook and applySuccessfulUpiPayment discard verified.amountPaise and confirm bookings regardless of the amount debited, exposing NIGHTLIFEZ to underpayment attacks.
  3. Guest Checkout PostgreSQL Crash (High - DATA-01):

    • /checkout/:slug/upi does not require authentication. When an unauthenticated guest pays, applySuccessfulUpiPayment crashes with a NOT NULL constraint violation on bookings.user_id, taking money but issuing no ticket.
  4. Simultaneous Checkout Intent Capacity Bypass (High - CONCUR-01):

    • Active payment intents are not counted in seat holds; multiple buyers can generate QR codes for a sold-out event and overbook the venue upon simultaneous payment.
  5. Unauthenticated Information Disclosure on Status API (High - AUTH-01):

    • Flawed truthy conditional in getUpiPaymentStatus allows unauthenticated callers to bypass ownership checks and query order and booking pass details.
  6. QR Generator Spec Non-Compliance (Medium - QR-01):

    • Dark Module at (size - 8, 8) is overwritten during format placement, and multi-block capacity math in Version 8 drops trailing data codewords.
  7. PayU Fallback Audit:

    • Zero lines of PayU code exist in the repository; PayU is purely architecturally proposed, not implemented.
  8. Payment Readiness Decision:

    • NOT READY FOR LIVE PRODUCTION (Mock / Simulated Ready Only).
    • Strict recommendation: Maintain ENABLE_LIVE_PAYMENTS=false across all environments until all critical and high-severity engineering items are remediated and commercial merchant onboarding is complete.

Deliverables

  • docs/UPI_SECURITY_AUDIT.md
  • docs/UPI_PROVIDER_READINESS.md
  • Updated docs/PROJECT_STATE.md

…sment for M4.1 UPI integration

- Author docs/UPI_SECURITY_AUDIT.md detailing 2 Critical, 3 High, 2 Medium, and 2 Low findings:
  * SEC-01 (Critical): Real PhonePe webhook signature calculation mismatch (hashes raw body instead of Base64 response)
  * FIN-01 (Critical): Missing amount verification on webhook ingestion (underpayment vulnerability)
  * DATA-01 (High): Unauthenticated guest checkout crashes on webhook (NOT NULL bookings.user_id constraint)
  * CONCUR-01 (High): Simultaneous checkout intent capacity bypass (overbooking risk)
  * AUTH-01 (High): Unauthenticated information disclosure & polling IDOR on /api/checkout/upi/status/:id
  * QR-01 (Medium): QR generator overwrites ISO 18004 Dark Module and drops Version 8 codewords
  * UI-01 (Medium): Missing viewport CSS isolation renders mobile buttons and desktop QR simultaneously
- Author docs/UPI_PROVIDER_READINESS.md classifying PhonePe PG as mock/uninitiated, PayU as not implemented, and issuing readiness verdict of NOT READY FOR LIVE PAYMENTS
- Update docs/PROJECT_STATE.md with M4.2 milestone tracking and document links
- Maintain strict safety boundary: ENABLE_LIVE_PAYMENTS=false
@vercel

vercel Bot commented Nov 3, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
strangersmeetup Ready Ready Preview Nov 3, 2026 5:00am UTC

@Satelink-Protocol
Satelink-Protocol merged commit c71ec8d into launch-mvp Nov 3, 2026
3 checks passed
@Satelink-Protocol
Satelink-Protocol deleted the feature/m4-2-upi-security-audit branch November 3, 2026 05:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant