API
Application Programming Interface — a defined way for software components to communicate with each other.
Auth Token
A credential (JWT, API key, OAuth token) that proves identity when making API requests.
Rate Limiting
Restricting how many API requests a client can make in a given time period — critical for preventing brute force and scraping.
BOLA
Broken Object Level Authorisation — the most common API vulnerability, where users can access other users' objects by changing an ID.

Why APIs are a prime attack target

APIs have properties that make them particularly attractive to attackers:

  • Direct data access: APIs are designed to return structured data — often exactly the sensitive fields that attackers want (personal data, financial records, authentication tokens).
  • Machine-readable and automatable: Unlike a website, an API can be probed at machine speed. An attacker can test millions of object IDs, credentials, or parameter combinations in minutes.
  • Undocumented endpoints: Many APIs have "shadow" or legacy endpoints that developers forgot to secure or decommission. Attackers actively search for these.
  • Third-party exposure: Mobile applications and partner integrations expose APIs to a much wider audience than internal web apps, increasing the attack surface dramatically.
83%
Of web traffic is now API calls, making APIs the dominant communication layer for modern applications.
681%
Growth in API attacks between 2021 and 2022, according to Salt Security's State of API Security report.
91%
Of organisations experienced an API security incident in 2022, according to industry surveys.

The OWASP API Security Top 10

OWASP maintains a separate Top 10 specifically for API security risks. The most critical categories:

  1. API1
    Broken Object Level Authorisation (BOLA) — The most common API flaw. An API endpoint that accepts a user ID parameter doesn't verify whether the caller is authorised to access that specific object. Changing /api/users/123/account to /api/users/124/account returns another user's data. Affects 78% of APIs.
  2. API2
    Broken Authentication — Weak or missing authentication: API keys in URLs, no token expiry, accepting expired tokens, or credentials transmitted without HTTPS. Any authenticated API is only as secure as its authentication mechanism.
  3. API3
    Broken Object Property Level Authorisation — APIs returning more data than the user is permitted to see, or accepting properties that the user shouldn't be allowed to set. A user updating their profile could elevate their own role if the API accepts a "role" field without checking permissions.
  4. API4
    Unrestricted Resource Consumption — APIs without rate limiting or request size controls allow attackers to launch DoS attacks, scrape entire datasets, or brute-force credentials through the API at machine speed.
  5. API5
    Broken Function Level Authorisation — Administrative API functions exposed without proper access controls. Attackers guess admin endpoints (/api/admin/users, /api/v2/admin/reset) and access them with a standard user token.

Building secure APIs

API security must be built in from design, not bolted on afterwards:

  • Authenticate every request: Use industry-standard authentication (OAuth 2.0 + JWT). Never pass credentials or tokens in URLs. Set short token expiry times.
  • Authorise at the object level: For every data-returning endpoint, verify not just that the user is authenticated but that they are permitted to access the specific resource being requested.
  • Return only what is needed: Never return entire database objects. Filter API responses to include only the fields the caller is authorised to see.
  • Implement rate limiting: Limit requests per API key, per endpoint, and per IP address. Return 429 Too Many Requests with a Retry-After header.
  • Inventory your APIs: Maintain a complete registry of all API endpoints, versions, and who can access them. Decommission unused endpoints. The most exploited APIs are often ones the team forgot about.
  • Test with automated scanners: Tools like OWASP ZAP, Burp Suite, and Postman can test APIs for the OWASP API Top 10 during development and in CI/CD pipelines.
The T-Mobile breach (2023): A buffer overflow in an API allowed attackers to access 37 million customer records. The API lacked sufficient input validation. The breach was discovered by T-Mobile — not reported by a third party — and is believed to have been ongoing for months.
Study API security in CEH v13

CEH v13 covers web API attacks, REST security testing with tools like Burp Suite, and OWASP API Top 10 exploitation techniques.

Explore CEH v13