OWASP API Security Top 10
Table of Contents
Related: Web Security OWASP Broken Object Level Authorisation Mass Assignment CORS Misconfigurations [[Denote query for ‘20260709T193500’]] PT1 Vulnerability Classification Cheat Sheet
Description
The Open Web Application Security Project (OWASP) maintains several critical resources, including the foundational OWASP Top 10 for web applications. As APIs have become the dominant architecture for modern web, mobile, and IoT applications, a dedicated list was created to address the unique vulnerabilities inherent in API design and implementation.
Purpose and Function
The list is consensus-driven, combining data from security experts, organizations, and vulnerability statistics. Its primary goals are:
- Awareness: To educate developers and security teams about the highest-risk, most common vulnerabilities found in APIs.
- Guidance: To provide a starting point for organizations to audit their API security posture and implement effective defensive strategies.
- Prioritization: Since APIs often handle sensitive data and critical business logic (e.g., payment processing, user authentication), the list helps prioritize where to focus limited security resources.
Unlike traditional web applications where presentation logic is handled server-side, APIs often expose data and functions directly, making them more susceptible to issues like Broken Object Level Authorization (BOLA) and Excessive Data Exposure.
Key Differences from General OWASP Top 10
While there is overlap (e.g., both address Injection flaws), the API Top 10 places greater emphasis on:
- Authorization and Access Control: API endpoints are often stateless and require robust, per-request authorization checks for every resource ID.
- Rate Limiting and Resource Management: APIs are frequently abused by automated bots, making strict consumption limits a top priority.
- Data Handling: The ease with which APIs can over-expose data to clients (e.g., accidentally returning database fields) necessitates dedicated focus.
Top 10
The following is the current (as of 2023) list of the ten most critical API security risks:
| Rank | API Security Risk | Aliases/Description | Key Mitigation Strategy |
|---|---|---|---|
| API1 | Broken Object Level Authorisation | BOLA / IDOR. Failure to check if a user is authorized to access the specific resource requested by ID. | Implement robust authorization checks on every request that handles an object ID. |
| API2 | Broken Authentication | Flaws in token generation, password strength enforcement, or credential stuffing defense. | Use standard, strong authentication mechanisms (e.g., OAuth 2.0, OpenID Connect); enforce rate limiting on login attempts. |
| API3 | Mass Assignment (Broken Object Property Level Authorization) | The ability to modify properties the user should not have access to (e.g., changing another user's role by manipulating a hidden JSON field). | Schema-based validation and whitelist allowed properties in write operations. |
| API4 | Unrestricted Resource Consumption | Failure to limit the number of requests, data size, or execution time, leading to Denial of Service (DoS). | Implement strict rate limiting per user/IP/API key and set payload size limits. |
| API5 | Broken Function Level Authorization | Failure to check if a user is authorized to use a specific function (e.g., a low-privileged user accessing an admin endpoint). | Enforce granular, role-based access control (RBAC) at the function/endpoint level. |
| API6 | Unrestricted Access to Sensitive Business Flows | Allowing unlimited or unmonitored use of unique business logic (e.g., creating accounts, placing high-discount orders). | Implement anti-automation, fraud detection, and transaction limits on critical business endpoints. |
| API7 | Server-Side Request Forgery (SSRF) | The API accepts a URL and fetches a remote resource without proper validation, allowing an attacker to target internal systems. | Strictly validate or whitelist user-supplied URLs and IPs. |
| API8 | [[Denote query for ‘20260709T193500’]] | Broad category including insecure default settings, misconfigured CORS, or exposing unnecessary error messages. | Ensure least privilege configuration; remove debugging information from production. |
| API9 | Improper Inventory Management | Failure to manage different API versions or environments, leaving older, vulnerable versions exposed. | Implement lifecycle management for all APIs; deprecate and remove old versions promptly. |
| API10 | Unsafe Consumption of APIs | The application relies on external APIs (e.g., third-party services) without properly validating the data received from them. | Treat all external data (including external API responses) as untrusted input. |