OWASP API Security Top 10 Explained with Examples
The OWASP API Security Top 10 risks — BOLA, broken authentication, property-level authorization, resource consumption and more — with fixes for each.
Published December 6, 2026
APIs expose business logic and data directly, without the guardrails a server-rendered UI sometimes provides by accident. That is why OWASP maintains a dedicated API Security Top 10. Most items are about authorization and resource limits, not exotic exploits, which makes them very fixable with consistent patterns.
The concept
The most common API flaw is Broken Object Level Authorization (BOLA): an endpoint returns or modifies an object by ID without checking the caller owns it. Close relatives are broken object property level authorization (returning sensitive fields or accepting writes to fields like isAdmin) and broken function level authorization (normal users calling admin endpoints).
Other categories cover broken authentication, unrestricted resource consumption (no rate limits, unbounded page sizes, expensive queries), unrestricted access to sensitive business flows (bots buying all tickets), SSRF, security misconfiguration, improper inventory management (forgotten v1 endpoints, undocumented debug APIs) and unsafe consumption of third-party APIs.
The list
| Risk (2023 list) | Example | Fix |
|---|---|---|
| API1 Broken Object Level Authorization | GET /accounts/{id} for any id | Ownership checks / scoped queries |
| API2 Broken Authentication | Weak tokens, no lockout | Standard auth (OIDC), rate limits, short tokens |
| API3 Broken Object Property Level Authorization | Response leaks passwordHash; PATCH sets role | Explicit response schemas; write allow-lists |
| API4 Unrestricted Resource Consumption | ?limit=1000000 | Rate limits, max page size, timeouts |
| API5 Broken Function Level Authorization | POST /admin/users as normal user | Role checks per route |
| API6 Unrestricted Access to Sensitive Business Flows | Bots scalping inventory | Bot detection, per-user limits |
| API7 SSRF | webhookUrl=http://169.254.169.254 | URL validation + network controls |
| API8 Security Misconfiguration | Verbose errors, permissive CORS | Hardened defaults |
| API9 Improper Inventory Management | Old /v1 without auth fixes | API catalogue, retire old versions |
| API10 Unsafe Consumption of APIs | Trusting partner API data blindly | Validate third-party responses |
From the OWASP API Security Top 10 (2023 edition).
Where checks belong
Baseline
- Inventory every API and version (OpenAPI specs)
- Enforce authn at the gateway; authz in services per object
- Define response schemas so only intended fields leave
- Rate limit and cap page sizes and query complexity
- Test with automated BOLA and fuzzing tests
Practical examples
Explicit response serializer
Never return ORM objects directly.
class AccountOut(BaseModel):
id: int
name: str
plan: str
# passwordHash, internalNotes intentionally absent
@app.get("/accounts/{account_id}", response_model=AccountOut)
def get_account(account_id: int, user=Depends(current_user)):
return repo.get_owned(account_id, owner_id=user.id) or raise_404()Write allow-list against mass assignment
Only these fields can be updated.
const ALLOWED = ['name', 'avatarUrl', 'timezone']
const updates = Object.fromEntries(Object.entries(req.body).filter(([k]) => ALLOWED.includes(k)))
await users.update(req.user.id, updates)Cap page size
Prevent resource exhaustion through huge limits.
limit = min(int(request.args.get("limit", 20)), 100)Common mistakes
- Returning entire database models in API responses.
- Relying on the gateway for object-level authorization it cannot know about.
- Unbounded limits, filters and GraphQL query depth.
- Forgotten old API versions still in production.
Key takeaways
- Authorization at object, property and function level is the core of API security.
- Explicit schemas control what goes in and out.
- Limit resource consumption everywhere.
- Keep an inventory and retire old versions.
FAQ
Does an API gateway solve API security?
It handles authentication, rate limiting and some validation; object-level authorization still belongs in the service that knows the data.
Does GraphQL change the risks?
The same risks apply, plus query depth/complexity limits and field-level authorization become critical.
How do I find shadow APIs?
Compare traffic logs and gateway routes against your documented OpenAPI inventory.