Broken object level authorization on the invoice endpoint
- Severity
- High. CVSS 3.1 base 6.5, raised one step: every customer invoice is readable.
- Asset
- api.example.com, GET /v1/invoices/{id}
- Status
- Verified by analyst on the live system
Evidence, excerpt
GET /v1/invoices/1041 HTTP/1.1 Host: api.example.com Authorization: Bearer <token of test account A> HTTP/1.1 200 OK {"invoice":"1041","customer":"test account B","total":"[redacted]"}
Reproduction
- Log in as test account A and note the bearer token.
- Request an invoice that belongs to test account B with that token.
- The API returns the invoice instead of 403 Forbidden.
Remediation
Enforce the ownership check in the service layer for every object access, not only in the listing. Use non-sequential identifiers as a second line. Add an authorization test per endpoint to the pipeline.
Retest: open. Reference: OWASP API Security Top 10, API1.