BuidlZone-Labs/zicket-web
Unauthenticated Payment Reconciliation API Endpoint Allows Arbitrary Ticket Generation
开放
#172 创建于 2026年7月29日
Stellar Wavedifficulty: mediumhelp wantedsecurity
仓库指标
- 星标
- (4 个星标)
- PR 合并指标
- (平均合并 2天 13小时) (30 天内合并 9 个 PR)
描述
Category
Security
Priority
Critical
Description
The payment reconciliation API endpoint /api/payments/reconcile/route.ts accepts client-provided JSON payloads containing isPaid: true and isConfirmed: true without performing any server-side authentication, signature verification, payment gateway webhook validation, or rate limiting. Any user or automated script can issue POST requests to mint valid ticket IDs without paying.
Evidence from app/api/payments/reconcile/route.ts#L40-L45:
if (!body.isConfirmed || !body.isPaid) {
return NextResponse.json(
{ ok: false, error: "Payment is not yet fully confirmed." },
{ status: 409 },
);
}
Proposed Solution
- Require server-side verification of payment gateway webhooks or on-chain transaction logs before issuing tickets.
- Add JWT or session authentication headers to verify the requesting user.
- Validate transaction hashes on-chain or via payment gateway APIs (e.g. Stripe / Solana RPC / Aztec RPC) to confirm funds were received.
Acceptance Criteria
- Endpoint requires valid authorization headers or signed payload.
- On-chain transaction signature or payment processor charge ID is verified server-side.
- Unauthenticated or fake requests are rejected with 401/403 HTTP status.
- Integration tests added for payment reconciliation security.
Files
app/api/payments/reconcile/route.ts
Notes
Currently, anyone can bypass payment and receive valid ticket IDs.