01Pre-launch review · B2B billing portal
Every invoice was one number away
- Day one
- High
- Any logged-in customer could read every invoice on the platform.
- After the fix
- Closed
- Ownership checked server-side; ids no longer sequential. Retested: fixed.
- → GET /api/invoices/10422 Authorization: Bearer <customer A>
- ← 200 OK { id: 10422, customer: "A", total: "₹2,40,000" }
- → GET /api/invoices/10423 Authorization: Bearer <customer A> ← next id, same token
- ← 200 OK { id: 10423, customer: "B", total: "₹1,10,000" }
- The id is sequential and the server never checks who is asking.
- Severity: High (CVSS 7.5) · Broken object-level authorisation (OWASP API1)
The fix. One authorisation check at the data layer — invoice.ownerId === session.userId — and ids moved to non-guessable values. Two files.




