- Risk
- Leadership reads thisRisk and impact in plain words.Our rating: High
CVSS 3.1 base score 6.5 (Medium). We raised it because every customer's invoices are exposed.CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:N/A:N
- Affected
GET /api/v2/invoices/{id}
- Impact
- Anyone with a customer account can download every other customer's invoices, including names, addresses and amounts, by changing one number in the request. Invoice IDs are sequential, so every invoice can be reached by counting through them. We confirmed this with two test accounts created for the engagement.
- Steps to reproduce
- Engineers work from thisExact requests, so the fix can be tested.
- Sign in as test user A and open one of their invoices.
- Send the same request with the ID of an invoice that belongs to test user B.
- The API returns user B's invoice. It should return 403 or 404.
Request, as test user A
GET /api/v2/invoices/48213 HTTP/1.1
Host: app.[redacted].com
Authorization: Bearer [user A token, redacted]
Response
HTTP/1.1 200 OK
{"id":48213,"customer":"[user B, redacted]"}
- Fix
- On every request to
/invoices/{id}, check on the server that the invoice belongs to the signed-in account. Put that check in one shared authorisation layer and add a regression test. Random IDs make guessing harder, but they do not fix this.
- References
- CWE-639 · OWASP API1:2023 · WSTG-ATHZ-04
- Retest
- We check it againAfter you fix, we confirm it.Fixed. Verified on day 12