API Security in 2026: The 10 Vulnerabilities That Keep Getting Exploited
APIs now handle 83% of internet traffic. They're also the #1 attack vector for data breaches. The same vulnerability classes appear year after year because teams prioritize speed over security in the development pipeline.
The API Attack Surface in 2026
A decade ago, securing a web application meant hardening the web server and the database. Today, your application IS an API ā the frontend is just a consumer. Mobile apps, partner integrations, internal microservices, IoT devices ā they all talk through APIs. Your attack surface isn't a web page; it's every endpoint you expose.
Vulnerability #1: Broken Object-Level Authorization (BOLA)
BOLA has been the #1 API vulnerability for 5 consecutive years. It's embarrassingly simple: change the ID in an API request and access another user's data.
# Normal request ā user views their own order
GET /api/orders/12345
Authorization: Bearer user_a_token
# Attack ā change the order ID, access user B's data
GET /api/orders/12346
Authorization: Bearer user_a_token
# Response: 200 OK with user B's order details š±
This happens because developers implement authentication (verifying WHO you are) but skip authorization (verifying WHAT you can access). The API confirms you're a valid user but doesn't check whether order 12346 belongs to you.
Why It Persists
- Authorization logic is implemented per-endpoint, not as a middleware pattern
- Automated scanners (DAST) struggle to detect BOLA because they need business context
- Object-level checks are tedious to write and easy to forget when adding new endpoints
- Sequential/predictable IDs make enumeration trivial
The Fix
- Implement authorization as middleware that runs on every request, not inline per endpoint
- Use UUIDs instead of sequential integers for resource identifiers
- Filter database queries by the authenticated user's ID:
WHERE user_id = @currentUser AND id = @requestedId - Add BOLA-specific test cases to your integration test suite
Vulnerability #2: Broken Authentication
API authentication has unique challenges that web authentication doesn't face:
- Token lifetime ā JWTs with 24-hour or 7-day expiry; if stolen, attacker has long-term access
- Token storage ā mobile apps store tokens in local storage, accessible to malware
- No session invalidation ā stateless JWTs can't be revoked unless you implement a blacklist (which defeats the purpose of stateless)
- API key leakage ā API keys committed to public repos, embedded in mobile app binaries, shared in Slack
- Weak password reset via API ā password reset endpoints that don't rate-limit, use predictable tokens, or leak user existence
JWTs are not session tokens. They're signed assertions. If you need to revoke access immediately (user terminated, account compromised), you need either short-lived tokens with refresh rotation or a token blacklist stored in Redis. Most teams learn this after the first incident.
Vulnerability #3: Excessive Data Exposure
APIs return entire database objects when the client only needs 3 fields. The frontend filters what to display, but the full payload is visible in browser DevTools or network proxies.
# Client needs: name, avatar URL
# What the API returns:
{
"id": 12345,
"name": "Jane Smith",
"email": "jane@company.com",
"ssn": "***-**-1234", // Still partially exposed!
"salary": 145000, // Why is this here?
"manager_id": 67890,
"internal_notes": "...", // Confidential
"password_hash": "bcrypt$..." // Critical exposure
}
The Fix
- Implement response schemas per endpoint ā define exactly which fields are returned (not "return the model")
- Use DTOs/View Models that map only the required fields
- Implement field-level authorization for sensitive attributes
- Consider GraphQL field-level permissions if using GraphQL
- Audit API responses in staging by comparing returned fields against what the client actually uses
Vulnerability #4: Lack of Rate Limiting
Without rate limiting, attackers can:
- Brute-force credentials ā try millions of password combinations against your login endpoint
- Enumerate data ā scrape your entire user directory by iterating over
/api/users/1through/api/users/999999 - Denial of Service ā send expensive queries that consume all database connections
- Bill inflation ā if you're on usage-based cloud pricing, an attacker can run up your cloud bill into six figures overnight
Rate Limiting Strategy
| Endpoint Type | Rate Limit | Scope |
|---|---|---|
| Authentication endpoints | 5 requests / minute | Per IP + Per Account |
| Password reset | 3 requests / hour | Per Email |
| Search / List endpoints | 60 requests / minute | Per User Token |
| Write endpoints (POST/PUT) | 30 requests / minute | Per User Token |
| File upload | 10 requests / minute | Per User Token |
| Admin endpoints | 120 requests / minute | Per User Token + IP |
Vulnerability #5: Broken Function-Level Authorization (BFLA)
If BOLA is about accessing the wrong data, BFLA is about accessing the wrong functionality. A regular user calling admin-only endpoints:
# Regular user discovers admin endpoint
DELETE /api/admin/users/12345
Authorization: Bearer regular_user_token
# Response: 200 OK ā user deleted! š±
This happens when developers assume that hiding the button in the UI is the same as securing the endpoint. The button may be hidden, but the endpoint is still callable by anyone who can construct an HTTP request.
Vulnerability #6: Mass Assignment
When APIs bind request body directly to database models without filtering which fields are writable:
# User updates their profile
PUT /api/users/me
{
"name": "Jane Smith",
"email": "jane@new-email.com",
"role": "admin", // Shouldn't be writable!
"balance": 999999.00 // Shouldn't be writable!
}
If the API framework automatically maps request fields to model properties, the attacker can set fields they should never control. This vulnerability caused the GitHub mass assignment incident in 2012 ā and it's still happening in 2026.
Vulnerability #7: Server-Side Request Forgery & Injection
APIs that accept URLs, file paths, or query fragments from users without validation are vulnerable to:
- SSRF ā API fetches a user-provided URL that points to internal services:
http://169.254.169.254/latest/meta-data/(AWS metadata endpoint) - NoSQL Injection ā MongoDB queries built from user input:
{"$gt": ""}bypasses equality checks - SQL Injection ā still exists in APIs built with raw SQL or legacy ORM configurations
- GraphQL Injection ā deeply nested queries that cause O(n²) database operations
The API Security Stack for 2026
A defense-in-depth approach to API security:
| Layer | Tool / Approach | What It Catches |
|---|---|---|
| Design Time | OpenAPI spec review, threat modeling | Architectural flaws before code is written |
| Build Time | SAST (Semgrep, SonarQube), linting rules | Code-level vulnerabilities in source |
| Test Time | DAST (OWASP ZAP, Burp Suite), API fuzzing | Runtime vulnerabilities in staging |
| Deploy Time | SCA (Snyk, Dependabot), container scanning | Vulnerable dependencies and base images |
| Runtime | API Gateway (Kong, Apigee), WAF, RASP | Active attacks in production |
| Monitoring | API discovery (Salt, Noname), anomaly detection | Shadow APIs, behavioral anomalies |
The API Security Implementation Checklist
- ā Authentication: OAuth 2.0 / OpenID Connect with short-lived tokens (15 min) and refresh token rotation
- ā Authorization: Object-level AND function-level checks as middleware, not inline code
- ā Input validation: Schema validation on every request body (JSON Schema, Zod, Pydantic)
- ā Output filtering: Response DTOs that return only necessary fields, never raw database models
- ā Rate limiting: Per-endpoint rate limits with token-bucket algorithm, stricter on auth endpoints
- ā CORS: Explicit allowed origins ā never
Access-Control-Allow-Origin: *on authenticated endpoints - ā Logging: Every API request logged with user identity, IP, endpoint, response code, latency
- ā API inventory: Automated discovery of all API endpoints ā you can't secure what you can't see
- ā Versioning: Deprecated API versions have a sunset date and are actually removed
- ā Security testing: OWASP API Security Top 10 tested in CI/CD, not just annually
API security isn't a tool purchase ā it's a development culture change. The teams that build secure APIs don't bolt security on at the end; they design it in from the first endpoint. Security reviews aren't a gate before deployment ā they're a step in the design process.
Is Your API Surface Secure?
Our API security assessment identifies BOLA, authentication gaps, and excessive data exposure across your entire API surface ā before attackers do.
Request an API Security Audit ā