Back to HomeOWASP

OWASP API Security Top 10 Complete Guide: 2023 API Security Vulnerabilities and Protection [2026 Update]

12 min min read
#OWASP#API Security#BOLA#Authentication#Security Testing

OWASP API Security Top 10 Complete Guide: 2023 API Security Vulnerabilities and Protection

TL;DR

  • OWASP API Security Top 10 is the list of top ten security risks for APIs
  • 2023 version remains the latest as of 2026—OWASP has not yet released an update
  • API1 BOLA (Broken Object Level Authorization) remains #1 for two consecutive versions
  • 2024-2025 API attacks continue to rise—Dell, Trello, Roku all affected
  • API security needs to be considered from the design phase
  • Combining API Gateway and code-level protection effectively secures APIs

Version Note: This article covers OWASP API Security Top 10 2023 version, which remains the latest official version as of February 2026. While OWASP Web Application Top 10 released a 2025 update, API Security Top 10 remains at 2023. Both lists address different scenarios and should be used together.


Why is API Security Important?

APIs have become the foundation of modern applications. Mobile apps, web frontends, IoT devices, third-party integrations—all communicate through APIs.

According to statistics, over 80% of internet traffic comes from API calls. The volume and importance of data APIs carry has long surpassed traditional web pages.

API Attack Case Studies

Major API security incidents continue to rise. According to statistics, 37% of organizations experienced API security incidents in 2024, more than doubling from 17% in 2023.

2024-2025 Major Incidents

2024 Dell Data Breach (49 Million Records)

  • Attackers exploited API vulnerability in partner portal to access customer data
  • Lacked API rate limiting and anomaly detection mechanisms
  • Names, addresses, purchase history all leaked
  • Vulnerability Type: API4 (Unrestricted Resource Consumption) + API9 (Improper Inventory Management)

2024 Trello Data Breach (15 Million Records)

  • Public REST API endpoint allowed queries without authentication
  • Attackers tested 500 million emails, successfully obtained 15 million user records
  • Included emails, names, account settings
  • Vulnerability Type: API2 (Broken Authentication) + API1 (BOLA)

2024 Twilio Authy Breach (33.4 Million Phone Numbers)

  • Unauthenticated API endpoint exposed user phone numbers
  • Could be used for SIM swap and phishing attacks
  • Vulnerability Type: API2 (Broken Authentication)

2024 GitHub API Key Exposure (13 Million Keys)

  • Public repositories exposed nearly 13 million API keys and secrets
  • Attackers could use these credentials to access third-party services
  • Vulnerability Type: API8 (Security Misconfiguration)

2021-2023 Classic Cases

2023 T-Mobile Incident

  • API vulnerability exposed 37 million customers' data
  • Names, emails, phone numbers, birthdays were all obtained
  • Fifth major data breach for T-Mobile

2022 Twitter Incident

  • API vulnerability led to 5.4 million users' data being leaked
  • Attackers could query corresponding accounts using email or phone numbers

2021 Peloton Incident

  • Anyone could access other users' private data via API
  • Cause: Lack of object-level authorization checks (BOLA)

Common thread: Problems originated at the API layer, not traditional web vulnerabilities. 95% of organizations experienced API security incidents in the past year, yet only 7.5% have dedicated API security testing programs.

API Security vs Web Security: What's Different?

AspectTraditional WebAPI
Attack SurfaceLimited forms and linksNumerous endpoints and parameters
AuthenticationSession CookieToken, API Key, OAuth
Data FormatHTMLJSON, XML
UsersHumansPrograms, machines
Traffic PatternPredictableHigh-frequency, automated
Main RisksXSS, CSRFBOLA, Authentication failures

API security requires different thinking and tools. This is why OWASP specifically created the API Security Top 10.

To learn about the OWASP organization and other security projects, refer to the OWASP Complete Guide.


OWASP API Security Top 10 (2023 Version)

The 2023 version is the current latest API security risk list. Here's a detailed analysis of each item.

API1: Broken Object Level Authorization (BOLA)

Risk Description: Attackers can access data objects that don't belong to them. This is the most common and dangerous API vulnerability.

Attack Scenario:

Normal request: GET /api/users/123/orders
Attack request: GET /api/users/456/orders  ← Changed to someone else's ID

If the system doesn't verify "can user 123 access user 456's orders," BOLA occurs.

Real Cases:

  • Modifying URL IDs to see others' orders
  • Changing user_id parameter in requests to access others' data
  • Traversing all possible ID values through API

Protection Measures:

  1. Verify resource ownership for every request
  2. Use UUIDs instead of sequential IDs
  3. Implement centralized authorization checking mechanism
  4. Log all access behaviors
// Bad example
app.get('/api/orders/:orderId', async (req, res) => {
  const order = await Order.findById(req.params.orderId);
  res.json(order); // No ownership check
});

// Correct approach
app.get('/api/orders/:orderId', async (req, res) => {
  const order = await Order.findById(req.params.orderId);
  if (order.userId !== req.user.id) {
    return res.status(403).json({ error: 'Forbidden' });
  }
  res.json(order);
});

API2: Broken Authentication

Risk Description: API authentication mechanisms have vulnerabilities that let attackers impersonate other users.

Common Issues:

  • Tokens without expiration
  • Weak password policies
  • API Keys hardcoded in source code
  • Authentication bypass vulnerabilities
  • No protection against brute force attacks

Protection Measures:

  1. Use standard authentication protocols (OAuth 2.0, OpenID Connect)
  2. Implement token expiration and refresh mechanisms
  3. Multi-factor authentication (MFA)
  4. Login failure rate limiting
  5. Secure credential storage (salted hashing)

API3: Broken Object Property Level Authorization

Risk Description: Users can read or modify object properties they shouldn't have access to.

Attack Scenario:

// User updating profile
PUT /api/users/123
{
  "name": "John",
  "email": "[email protected]",
  "role": "admin"  ← Sneakily added this field
}

If the backend doesn't filter, users can make themselves administrators.

Two Sub-types:

  • Excessive Data Exposure: API returns too much data
  • Mass Assignment: API accepts too many input fields

Protection Measures:

  1. Explicitly define readable/writable fields
  2. Use DTO (Data Transfer Object) pattern
  3. Response only includes necessary fields
  4. Server-side filtering of sensitive properties

API4: Unrestricted Resource Consumption

Risk Description: API doesn't limit request volume or resource usage, potentially causing service disruption or cost explosion.

Attack Methods:

  • Mass requests causing DoS
  • Requesting huge file uploads
  • Batch operations processing too many items
  • Complex queries consuming computational resources

Protection Measures:

  1. Implement Rate Limiting
  2. Limit Payload size
  3. Pagination and result count limits
  4. Query complexity limits
  5. Resource quota management
// Rate Limiting example
const rateLimit = require('express-rate-limit');

const limiter = rateLimit({
  windowMs: 15 * 60 * 1000, // 15 minutes
  max: 100, // Maximum 100 requests
  message: 'Too many requests'
});

app.use('/api/', limiter);

API5: Broken Function Level Authorization

Risk Description: Regular users can access admin functions or other roles' APIs.

Attack Scenario:

Regular user API: GET /api/users/me
Admin API: GET /api/admin/users  ← Direct call

Without role verification, anyone can use admin functions.

Protection Measures:

  1. Default deny all access
  2. Clear role-permission mapping
  3. Centralized permission management
  4. Regular API permission audits

API6: Unrestricted Access to Sensitive Business Flows

Risk Description: Attackers automate sensitive business operations, causing business damage.

Attack Scenarios:

  • Auto-purchasing limited items
  • Batch creating fake accounts
  • Automated ticket scalping
  • Abusing referral rewards

Protection Measures:

  1. Identify sensitive business flows
  2. Add human verification (CAPTCHA)
  3. Device fingerprinting
  4. Behavioral analysis to detect anomalies
  5. Business logic rate limiting

API7: Server Side Request Forgery (SSRF)

Risk Description: Attackers make the server send requests to unintended targets.

Attack Scenario:

POST /api/fetch-url
{
  "url": "http://169.254.169.254/latest/meta-data/"
}

If the API fetches user-provided URLs, attackers can access internal services or cloud metadata.

This vulnerability also appears in OWASP Top 10 as A10.

Protection Measures:

  1. URL whitelist validation
  2. Block access to internal IP ranges
  3. Disable unnecessary protocols
  4. Use dedicated network segments

API8: Security Misconfiguration

Risk Description: Improper API security settings expose unnecessary attack surface.

Common Issues:

  • Detailed error messages exposing system information
  • Debug mode not disabled
  • Default credentials unchanged
  • Unnecessary HTTP methods enabled
  • CORS settings too permissive
  • Missing security headers

Protection Measures:

  1. Standardized deployment process
  2. Regular security configuration audits
  3. Automated security testing
  4. Principle of least privilege

API9: Improper Inventory Management

Risk Description: Organizations don't know what APIs they have, or forgotten old versions exist.

Common Issues:

  • Old API versions not decommissioned
  • Test environment APIs exposed externally
  • No API documentation
  • Unknown which APIs handle sensitive data

Protection Measures:

  1. Maintain API inventory
  2. Version management strategy
  3. Regular audits and cleanup
  4. Unified API Gateway

API10: Unsafe Consumption of APIs

Risk Description: Your application trusts and uses third-party APIs without proper protection.

Risk Scenarios:

  • Not validating third-party responses
  • Not handling third-party errors
  • Following third-party redirects
  • Not setting timeouts

Protection Measures:

  1. Validate all external inputs
  2. Use HTTPS
  3. Set reasonable timeouts
  4. Limit redirect counts
  5. Monitor third-party API status

API Security Testing Methods

After knowing the risks, the next step is testing.

Automated Scanning Tools

Common API security scanning tools:

ToolTypeFeatures
OWASP ZAPFree Open SourceSupports OpenAPI import
Burp SuiteCommercialPowerful, steep learning curve
PostmanFree/CommercialEasy to use, supports security testing
42CrunchCommercialAPI-specific, good CI/CD integration
WallarmCommercialReal-time protection + scanning

For detailed ZAP API scanning tutorial, refer to OWASP ZAP Tutorial.

Manual Testing Techniques

Automated tools can't replace manual testing. Key test items:

BOLA Testing:

  1. Login as Account A
  2. Record Account A's resource IDs
  3. Login as Account B
  4. Attempt to access Account A's resources with Account B

Authentication Testing:

  1. Use expired tokens
  2. Use incorrectly formatted tokens
  3. Access authenticated APIs without tokens
  4. Brute force testing

Authorization Testing:

  1. Regular users calling admin APIs
  2. Modifying role fields in requests
  3. Attempting horizontal and vertical privilege escalation

Postman Security Testing

Postman is a common tool for API developers that can also do security testing.

Setting Up Test Scripts:

// Check response doesn't contain sensitive information
pm.test("No sensitive data in response", function () {
    pm.expect(pm.response.text()).to.not.include("password");
    pm.expect(pm.response.text()).to.not.include("secret");
});

// Check required security headers
pm.test("Security headers present", function () {
    pm.response.to.have.header("X-Content-Type-Options");
    pm.response.to.have.header("X-Frame-Options");
});

// Check response time
pm.test("Response time acceptable", function () {
    pm.expect(pm.response.responseTime).to.be.below(2000);
});

API Security Best Practices

Authentication and Authorization Design

Use OAuth 2.0 + OpenID Connect:

  • Access Token handles authorization
  • ID Token handles authentication
  • Refresh Token extends sessions

Token Best Practices:

  • Use short-lived Access Tokens (15-60 minutes)
  • Refresh Tokens need secure storage
  • Support token revocation mechanism
  • Validate signature and expiry when using JWT

Rate Limiting Implementation

Different levels of limiting:

Global limit: 1000 requests per IP per minute
API limit: 100 requests per user per minute
Endpoint limit: Login API 5 per IP per minute

Response Header Indication:

X-RateLimit-Limit: 100
X-RateLimit-Remaining: 45
X-RateLimit-Reset: 1640000000

Input Validation

Validate All Inputs:

  • Data types
  • Length limits
  • Format validation (email, phone)
  • Whitelist characters
  • Business logic constraints
const Joi = require('joi');

const userSchema = Joi.object({
  name: Joi.string().min(2).max(50).required(),
  email: Joi.string().email().required(),
  age: Joi.number().integer().min(0).max(150),
  role: Joi.string().valid('user', 'moderator')  // admin not allowed
});

API Gateway Security Configuration

API Gateway is the first line of defense for API security.

AWS API Gateway

Security Features:

  • IAM Authentication
  • Lambda Authorizer
  • API Key Management
  • Traffic Throttling
  • WAF Integration

Configuration Recommendations:

# Enable CloudWatch logging
x-amazon-apigateway-policy:
  Version: "2012-10-17"
  Statement:
    - Effect: Allow
      Action: execute-api:Invoke
      Resource: "arn:aws:execute-api:*:*:*"
      Condition:
        IpAddress:
          aws:SourceIp: "203.0.113.0/24"

GCP Cloud Endpoints

Security Features:

  • Cloud IAM
  • API Key Verification
  • Service Account Authentication
  • Cloud Armor Integration

Azure API Management

Security Features:

  • Azure AD Integration
  • Certificate Verification
  • IP Restrictions
  • Rate Limiting Policy
  • Request/Response Transformation

Three Cloud Comparison:

FeatureAWSGCPAzure
Native AuthIAMCloud IAMAzure AD
WAF IntegrationAWS WAFCloud ArmorAzure WAF
Pricing ModelPer requestPer requestPer unit
Learning CurveMediumMediumSteeper

FAQ

Q1: Security Differences Between REST API and GraphQL API?

REST API:

  • Fixed endpoints and response structure
  • Easier access control
  • More mature security tool support

GraphQL API:

  • Single endpoint, flexible queries
  • Needs additional query depth limits
  • Prone to information over-exposure
  • Requires field-level permission control

GraphQL needs special attention to:

  • Query complexity limits
  • Introspection should be disabled in production
  • Batching Attack protection

Q2: Are API Keys Secure Enough?

API Key Problems:

  • Cannot identify user identity
  • Easily leaked (in code, logs)
  • Cannot fine-grained permission control
  • Difficult to track abuse

Suitable Scenarios:

  • Basic identification for public APIs
  • Low-sensitivity service calls
  • Combined with other authentication mechanisms

Unsuitable Scenarios:

  • Accessing user data
  • Sensitive operations
  • Tracking user behavior

Recommend using OAuth 2.0 with JWT instead of API Keys alone.

Q3: How to Protect Internal APIs?

Internal APIs are often overlooked but equally important.

Protection Measures:

  1. Network Layer: Use VPC, Private Subnet
  2. Authentication: Service-to-Service authentication (mTLS, Service Account)
  3. Authorization: Zero Trust architecture, don't trust internal traffic
  4. Monitoring: Log all internal API calls
  5. Documentation: Maintain internal API inventory

The assumption that "internal means secure" is dangerous. In security incidents, lateral movement attacks often exploit unprotected internal APIs.


Conclusion

API security isn't optional—it's essential.

OWASP API Security Top 10 provides a clear risk list and protection direction. Key takeaways:

  1. BOLA is the top risk: Every API must check object ownership
  2. Separate authentication and authorization: Identity verification and permission checking are two things
  3. Never trust input: Validate, filter, limit
  4. Leverage API Gateway: Centralize security logic
  5. Continuous testing and monitoring: Security isn't a one-time task

Next steps:

  • Inventory your APIs
  • Self-assess using OWASP API Top 10
  • Add API security testing to CI/CD
  • Conduct regular manual penetration testing

To learn about emerging API security issues in the AI era, refer to OWASP LLM Top 10. If your API serves mobile devices, don't forget to reference OWASP Mobile and IoT Security.

Need Professional Cloud Advice?

Whether you're evaluating cloud platforms, optimizing existing architecture, or looking for cost-saving solutions, we can help

Book Free Consultation

Related Articles