What is the OWASP API Security Top 10?

The OWASP API Security Top 10 is an awareness list from the OWASP API Security Project that ranks the ten most critical security risks specific to APIs. The current edition, 2023, puts broken object level authorization (BOLA) first, and most of the list is about who may call what, not about injection.

Part of the roadmap: Stage 4, Recon

Why it matters

An API answers machines, not pages, so the bugs that matter most are different from the web list. A page hides what the user should not click; an API exposes every endpoint and every field to anyone who reads the traffic. The OWASP Top 10 for web apps does not separate these risks, so OWASP keeps a second list for APIs.

The 2023 list in short: API1 broken object level authorization (another user's object by ID), API2 broken authentication, API3 broken object property level authorization (fields you should not see or set, which merges 2019's excessive data exposure and mass assignment), API4 unrestricted resource consumption, API5 broken function level authorization (an endpoint you should not reach at all), API6 unrestricted access to sensitive business flows, API7 server-side request forgery, API8 security misconfiguration, API9 improper inventory management (old and forgotten API versions), API10 unsafe consumption of APIs (trusting a third-party API's data).

Example: CyberGym's API, read through the list

CyberGym, the legal practice target, runs OWASP Juice Shop, whose API has an example of several categories. Each was found with harmless requests and accounts we created ourselves:

API1  BOLA       GET /rest/basket/<id> returns another account's basket by number
API2  auth       ten wrong passwords in ten seconds: ten 401 responses, no 429
API3  property   GET /rest/memories returns each uploader's full user row, password hash included
API5  function   GET /rest/admin/application-version, an admin route, answers without a session

On your own API (https://your-app.example), start with an inventory, because API9 is the category you cannot test without one: list every endpoint, method and version, with the auth each one requires. Then take the list as a set of questions per endpoint. Can user B read user A's object (API1)? Does the response carry fields the client never shows (API3)? Can a regular user call the admin routes (API5)? What stops a script from calling it ten thousand times (API4)?

Common mistakes

  • Testing an API with the web list only. BOLA, property-level and function-level authorization each get their own category here. Test them per endpoint.
  • Confusing API1 and API5. API1 is the right endpoint with someone else's object. API5 is an endpoint the caller should not reach at all.
  • Trusting the client to hide fields. If the response contains it, the caller has it. Return only the fields each caller needs.
  • Forgetting old versions. A /v1/ left running after /v2/ shipped keeps the bugs you fixed. That is API9.

Related terms

Go deeper

Sources

Test only sites you own or have written permission to test. To practise without one, use CyberGym, a legal, deliberately vulnerable target. Practise on CyberGym.