Every modern web application is an API with a website on top. Yet in most assessments, the website gets tested and the API gets trusted. The result is predictable: the same vulnerabilities that were fixed in the web interface are still wide open one layer down, where no human ever looks.
Broken Object-Level Authorization (BOLA)
BOLA has topped the OWASP API Security list for years, and it is still the flaw I find most often. The pattern is always the same: an endpoint like
GET /api/v1/orders/1042
returns the order — and the server never checks whether the logged-in user actually owns order 1042. Change the number to 1043, 1044, 1045, and you are reading other customers’ orders, invoices, and personal data. The web interface hides the ID behind a button, so nobody notices. The API does not hide anything.
The fix is unglamorous but non-negotiable: every endpoint that takes an object ID must verify ownership (or an explicit permission) on the server, on every request. Authorization checks belong in the API layer, not in the user interface.
The other usual suspects
- No rate limiting. Login, password-reset, and OTP endpoints without limits invite credential stuffing and enumeration. An attacker can try thousands of passwords or check which email addresses have accounts.
- Excessive data exposure. APIs return full database objects — including fields the interface never displays, like internal flags, hashes, or other users’ data. The frontend filters what it shows; the attacker reads the raw JSON.
- Leaked keys and tokens. API keys committed to public repositories, or long-lived tokens stored in mobile apps and JavaScript bundles. Once leaked, they are used until someone notices — usually nobody does.
- Missing authentication on “internal” endpoints. Endpoints assumed to be unreachable because the interface does not link them. Attackers enumerate APIs from JavaScript files and mobile apps in minutes.
A minimum API security checklist
- Authorize every object access. Check ownership or permission for every ID in every request — BOLA first, always.
- Rate-limit sensitive endpoints. Login, reset, OTP, and registration at minimum, with lockout or CAPTCHA after repeated failures.
- Return only what the client needs. Build explicit response objects instead of serializing database rows.
- Rotate and scope keys. Short-lived tokens, per-client scopes, and a revocation path. Scan repositories for leaked secrets.
- Inventory your API. Keep a list of every endpoint — including old versions (
/v1/still running beside/v2/) — and test them all, not just the ones the interface uses.
APIs are the real attack surface of a modern application. If your security testing stops at the web pages, you have tested the shop window and left the warehouse door open.