API security fundamentals every developer should know
Modern products are APIs with a UI stapled on — which makes API security the appsec frontier. A thorough primer on the OWASP API Top 10 risks, why they happen, and how to prevent them.
By Ravi Menon · 10 Oct 2026 · 15 min read
Modern products are, increasingly, APIs with a UI stapled on. The browser app, the mobile app, the partner integration and the internal service all talk to the same APIs — and those APIs expose business logic directly, without the implicit guardrails a server-rendered page used to provide. That makes API security the appsec frontier, and it's why APIs have their own dedicated OWASP Top 10. Here's what every developer and tester should understand.
Why APIs break differently from web pages
In a traditional web app, the server rendered the page and the user only saw what the server chose to show. An API is different: the client is a program, it can send any request in any order, and it often receives raw data objects it's trusted to filter. The old implicit protections are gone, so authorization and data handling have to be explicit on every single endpoint. Most API vulnerabilities trace back to forgetting that.
Authorization is the number-one risk
Broken Object-Level Authorization (BOLA)
The single most common serious API flaw. An endpoint accepts an object ID and returns (or modifies) it without checking the caller actually owns it:
GET /api/v1/invoices/7731 → returns invoice 7731 to anyone authenticated
Change the ID, get someone else's invoice. The fix is boringly consistent and must be applied everywhere: re-check authorization for the specific object on every request, using the identity derived from the verified token — never from a parameter the client controls.
Broken Function-Level Authorization (BFLA)
BOLA's sibling. Administrative or privileged functions are reachable by ordinary users because the check lived only in the UI or the API gateway, not in the endpoint itself. Test every privileged action by calling it directly as a low-privilege user.
Broken Authentication
Weak token validation, long-lived tokens that never expire, or endpoints that accept unsigned JWTs. Validate tokens properly — pinned algorithms, verified signatures, checked exp/iss/aud.
Don't over-share or over-accept
- Excessive data exposure. APIs often return the whole object and rely on the client to display only some fields. An attacker reads the raw response and sees everything — internal flags, other users' data, secrets. Filter server-side, returning only the fields the client needs.
- Mass assignment. The inverse problem: an endpoint binds the whole request body to a model, so a user can set fields they shouldn't —
"role": "admin","isVerified": true. Bind only the fields you explicitly intend to accept.
Treat availability as a security property
APIs are trivially automatable, so resource abuse is a real risk. Rate-limit every endpoint, paginate list responses, and bound expensive operations (large exports, deep queries, costly computations). Unbounded resource consumption is both a denial-of-service vector and a cost problem.
Know every endpoint you expose
Shadow APIs (undocumented, forgotten endpoints) and zombie APIs (old versions left running) are where breaches hide, because nobody is testing or monitoring them. Maintain an accurate inventory of every API and version, deprecate old ones deliberately, and threat-model each endpoint: who can call it, what it exposes, what it changes.
A developer's checklist
- Authorization checked server-side, per object, on every request.
- Privileged functions re-check the caller's role at the endpoint.
- Responses return only necessary fields; requests bind only intended fields.
- Tokens validated strictly; sessions expire.
- Every endpoint rate-limited and paginated.
- A living inventory of all APIs and versions.
Go deep in the API Security Testing course, read the BOLA knowledge-base entry, and prove the concept hands-on in the API BOLA lab.