11.3 Cloud API Security: OWASP API Top 10 & API Gateway Protections

Key Takeaways

  • Cloud APIs—spanning REST, GraphQL, and gRPC—represent the predominant attack surface in cloud-native architectures, directly exposing underlying data objects, microservice meshes, and internal business logic.
  • Broken Object Level Authorization (BOLA / IDOR) is the most critical and widespread API vulnerability, occurring when an endpoint fails to validate whether an authenticated user is legitimately authorized to access or manipulate a specific requested resource identifier.
  • Broken Object Property Level Authorization combines Mass Assignment and Excessive Data Exposure, occurring when APIs allow untrusted clients to inject internal object attributes or return complete database models to frontend clients.
  • Server-Side Request Forgery (SSRF) represents a catastrophic cloud API threat, enabling attackers to coerce backend microservices into dispatching requests to internal private endpoints or the cloud Instance Metadata Service (IMDS) to steal IAM credentials.
  • Cloud API Gateways enforce a centralized positive security perimeter, executing cryptographically verified OAuth 2.0/JWT token validation, strict OpenAPI/JSON schema compliance, fine-grained rate limiting, and Layer 7 Web Application Firewall (WAF) inspection.
Last updated: September 2026

11.3 Cloud API Security: OWASP API Top 10 & API Gateway Protections

Quick Answer: In cloud-native and microservice architectures, Application Programming Interfaces (APIs)—including REST, GraphQL, and gRPC—serve as the primary communication fabric, exposing internal data models and business logic directly over networks. Because APIs bypass traditional presentation-tier security controls, they are uniquely vulnerable to the OWASP API Security Top 10. The most catastrophic and widespread vulnerability is Broken Object Level Authorization (BOLA), where an endpoint authenticates a user but fails to verify that the user possesses authorization to access a specific resource ID. To defend against BOLA, Broken Object Property Level Authorization (Mass Assignment / Excessive Data Exposure), and Server-Side Request Forgery (SSRF), organizations deploy enterprise Cloud API Gateways. Gateways provide centralized perimeter defense by terminating TLS, validating OAuth 2.0 / JSON Web Tokens (JWT), enforcing strict OpenAPI/JSON schema validation, executing rate limiting and throttling, and integrating with Web Application Firewalls (WAF).

According to Domain 10 of the CSA Security Guidance v5, modern cloud applications are no longer monolithic silos protected by network perimeters. Instead, applications consist of distributed microservices communicating across internal and external boundaries via APIs. APIs drive mobile applications, single-page web applications (SPAs), partner integrations, and cloud orchestration control planes. Consequently, APIs have become the primary attack surface targeted by threat actors seeking unauthorized data access, privilege escalation, and infrastructure takeover.


The Cloud API Landscape: Protocols & Communication Patterns

Securing cloud APIs requires understanding the architectural mechanics and risk profiles of different API communication protocols:

┌────────────────────────────────────────────────────────────────────────┐
│                     CLOUD API PROTOCOL COMPARISON                      │
├────────────────────────────────────────────────────────────────────────┤
│  PROTOCOL   DATA FORMAT      TRANSPORT    COMMON USE / THREAT PROFILE  │
├────────────────────────────────────────────────────────────────────────┤
│  REST       JSON / XML       HTTP/1.1 & 2 Public APIs; CRUD endpoints. │
│                                           Vulnerable to BOLA & Mass Ass│
├────────────────────────────────────────────────────────────────────────┤
│  GraphQL    JSON (Dynamic)   HTTP/POST    Client-driven data queries.  │
│                                           DoS via nested queries & batc│
├────────────────────────────────────────────────────────────────────────┤
│  gRPC       Protobuf (Binary)HTTP/2       Microservice East-West mesh. │
│                                           High-speed; binary payload   │
│                                           bypasses naive text WAFs.    │
└────────────────────────────────────────────────────────────────────────┘

1. REST (Representational State Transfer)

REST relies on standard HTTP methods (GET, POST, PUT, PATCH, DELETE) operating on resource URIs (e.g., /api/v1/customers/7482/orders). While widely supported and human-readable, REST endpoints frequently expose predictable database keys in URIs, inviting parameter manipulation and authorization tampering.

2. GraphQL

Developed to solve over-fetching and under-fetching of data in mobile applications, GraphQL exposes a single HTTP endpoint (typically /graphql) where clients submit complex queries specifying exactly which fields they require.

  • Unique Security Challenges:
    • Denial of Service via Nested Queries: An attacker submits circular, deeply recursive queries (e.g., author { books { author { books { author ... } } } }), causing exponential CPU and database resource consumption.
    • Field Suggestion & Introspection: If introspection is enabled in production, attackers query the schema to enumerate all internal data types, hidden admin fields, and unpublished queries.
    • Batching Attacks: Attackers bundle hundreds of authentication attempts or object lookups into a single HTTP POST request, bypassing naive per-request rate limiters.

3. gRPC (Google Remote Procedure Call)

gRPC uses Protocol Buffers (protobuf) over HTTP/2 to deliver high-performance, strongly typed, low-latency binary communication.

  • Cloud Context: Predominantly used for high-throughput East-West (service-to-service) communication within microservice clusters and Kubernetes service meshes.
  • Security Challenges: Because gRPC payloads are serialized binary data, conventional perimeter Web Application Firewalls (WAFs) designed for text-based JSON/XML cannot parse, inspect, or sanitize gRPC payloads without specialized protobuf schema definitions.

North-South vs. East-West API Traffic

  • North-South Traffic: Requests entering or exiting the cloud datacenter (e.g., from an internet mobile client to an edge API gateway). Securing North-South traffic focuses on authentication, DDoS mitigation, WAF inspection, and public API throttling.
  • East-West Traffic: Communication between internal microservices within the cloud virtual network. Under Zero Trust principles, network location alone should not grant trust. East-West protection can combine workload identity, authenticated encryption such as mTLS, authorization policy, and microsegmentation according to risk.

OWASP API Security Top 10 Deep Dive

The Open Web Application Security Project (OWASP) maintains a dedicated API Security Top 10 cataloging the most prevalent and critical vulnerabilities affecting modern APIs:

┌────────────────────────────────────────────────────────────────────────┐
│                     OWASP API SECURITY TOP 10                          │
├────────────────────────────────────────────────────────────────────────┤
│  API1: Broken Object Level Authorization (BOLA / IDOR)                 │
│  API2: Broken Authentication                                           │
│  API3: Broken Object Property Level Authorization                      │
│  API4: Unrestricted Resource Consumption                               │
│  API5: Broken Function Level Authorization (BFLA)                      │
│  API6: Unrestricted Access to Sensitive Business Flows                 │
│  API7: Server-Side Request Forgery (SSRF)                              │
│  API8: Security Misconfiguration                                       │
│  API9: Improper Inventory Management (Shadow / Zombie APIs)            │
│  API10: Unsafe Consumption of APIs                                     │
└────────────────────────────────────────────────────────────────────────┘

1. API1: Broken Object Level Authorization (BOLA / IDOR)

BOLA—historically termed Insecure Direct Object References (IDOR)—is the most pervasive and dangerous API vulnerability.

  • Mechanics: An API endpoint exposes an object identifier (e.g., /api/v1/invoices/10492). The application successfully validates the client's authentication token (verifying the user is logged in), but fails to validate whether the logged-in user is authorized to view or manipulate that specific object.
  • Attack Scenario: User A logs in legitimately, receives a valid JWT, and issues a request for their own invoice (GET /api/v1/invoices/1001). User A then modifies the URI parameter to GET /api/v1/invoices/1002, accessing User B's proprietary financial invoice.
  • Remediation: Implement authorization checks at the data-access layer for every request. Validate that the requesting user identity (extracted from the authenticated session context) matches the ownership or tenancy access control list of the requested object ID before querying or mutating the database.

2. API2: Broken Authentication

Occurs when authentication mechanisms are poorly implemented, allowing attackers to compromise authentication tokens or exploit flaws in implementation.

  • Mechanics: Weak password requirements, lack of brute-force protection, failure to validate JWT cryptographic signatures, accepting the alg: none JWT algorithm, exposing authentication tokens in URL query strings, or generating predictable session tokens.
  • Remediation: Enforce strong authentication standards (OAuth 2.0 / OpenID Connect); utilize cryptographically secure JWT signing algorithms (e.g., RS256, EdDSA); rotate signing keys; validate all token claims (iss, aud, exp); and never expose tokens in URLs.

3. API3: Broken Object Property Level Authorization

This vulnerability merges two historically distinct flaws: Excessive Data Exposure and Mass Assignment.

  • Excessive Data Exposure (Read Phase): An API endpoint fetches an entire database model and relies on the client application (e.g., React or iOS frontend) to filter which fields are displayed. An attacker intercepts the raw HTTP response, revealing sensitive properties such as credit card numbers, password hashes, or internal administrative flags.
  • Mass Assignment (Write Phase): An API binds incoming client JSON payloads directly to backend data models without filtering allowed attributes. An attacker submits unexpected parameters (e.g., {"role": "admin"} or {"isVerified": true}) alongside legitimate profile updates, escalating privileges.
  • Remediation: Enforce Data Transfer Objects (DTOs) and strict allow-listing for both incoming requests and outgoing responses. Never expose raw database records directly to the API layer.

4. API4: Unrestricted Resource Consumption

APIs frequently lack controls over the volume and complexity of incoming requests, enabling denial-of-service, system crashes, and financial denial-of-wallet (DoW).

  • Mechanics: Missing execution timeouts, unconstrained payload file sizes, lack of pagination limits (e.g., client requests GET /api/users?limit=10000000), or unconstrained GraphQL query depths.
  • Remediation: Enforce strict pagination caps (e.g., maximum 100 records per page); configure request payload size limits at the API gateway; apply execution timeouts; and enforce rate limiting per client IP, API key, and authenticated user.

5. API5: Broken Function Level Authorization (BFLA)

While BOLA involves accessing unauthorized data objects, BFLA involves invoking unauthorized administrative or functional workflows.

  • Mechanics: A regular employee accesses administrative endpoints by altering the HTTP path or method (e.g., an unprivileged user sending POST /api/v1/admin/users/promote or changing GET /api/v1/orders/123 to DELETE /api/v1/orders/123).
  • Remediation: Centralize role-based access control (RBAC) and attribute-based access control (ABAC) checks. Deny all administrative function access by default, granting access only through explicit policy enforcement modules.

6. API7: Server-Side Request Forgery (SSRF)

SSRF occurs when an API accepts a user-supplied URL and coerces the backend cloud server to initiate an outbound network request to that URL without proper sanitization.

  • Cloud Impact (The IMDS Attack): In public cloud environments (AWS, Azure, GCP), virtual compute instances query the Instance Metadata Service (IMDS) via the link-local IP address http://169.254.169.254. An attacker exploiting SSRF on an API submits http://169.254.169.254/latest/meta-data/iam/security-credentials/ as a webhook or avatar URL. The backend cloud instance fetches the URL and returns temporary IAM role credentials to the attacker, leading to full cloud infrastructure compromise.
┌────────────────────────────────────────────────────────────────────────┐
│                     SSRF EXPLOITATION OF CLOUD IMDS                    │
├────────────────────────────────────────────────────────────────────────┤
│                                                                        │
│   [Attacker] ──► 1. POST /api/generate-pdf                             │
│                     {"url": "http://169.254.169.254/.../credentials"}  │
│                        │                                               │
│                        ▼                                               │
│   ┌────────────────────────────────────────────────────────────────┐   │
│   │ Cloud Compute Instance / Container                             │   │
│   │ • API processes request and fetches user-supplied URL          │   │
│   │ • Dispatches outbound HTTP request to local link-local address │   │
│   └────────────────────┬───────────────────────────────────────────┘   │
│                        │ 2. GET http://169.254.169.254/...             │
│                        ▼                                               │
│   ┌────────────────────────────────────────────────────────────────┐   │
│   │ Cloud Instance Metadata Service (IMDS)                         │   │
│   │ • Returns plaintext IAM role temporary access tokens           │   │
│   └────────────────────┬───────────────────────────────────────────┘   │
│                        │                                               │
│                        ▼ 3. IAM Keys Returned in PDF Response          │
│   [Attacker] ◄─────────┴───────────────────────────────────────────────│
│                                                                        │
└────────────────────────────────────────────────────────────────────────┘
  • Remediation:
    • Transition to IMDSv2, which requires session-oriented authentication headers (X-aws-ec2-metadata-token-ttl-seconds) and sets the IP packet hop limit to 1, blocking container and SSRF proxy forwarding.
    • Enforce strict egress network controls and disable access to 169.254.169.254 from application subnets.
    • Use an outbound forward proxy with strict allow-lists for external URLs.

7. API9: Improper Inventory Management (Shadow & Zombie APIs)

Organizations frequently deploy APIs without maintaining an accurate, centralized catalog.

  • Shadow APIs: Unmonitored, undocumented APIs deployed by developer teams outside formal governance.
  • Zombie APIs: Outdated, legacy versions of APIs (e.g., /api/v1/) left running after /api/v2/ is released. While v2 contains security patches and MFA requirements, v1 remains exposed, providing an unmonitored backdoor into backend databases.
  • Remediation: Maintain an automated API inventory; decommission legacy API versions; enforce API Gateway routing exclusively; and retire old endpoints.

API Gateway Architecture & Defensive Controls

To remediate API vulnerabilities systematically without relying on every developer to write custom security boilerplate, organizations deploy Enterprise Cloud API Gateways (e.g., AWS API Gateway, Kong, Apigee, Azure API Management, Envoy).

┌────────────────────────────────────────────────────────────────────────┐
│                     API GATEWAY DEFENSIVE ARCHITECTURE                 │
├────────────────────────────────────────────────────────────────────────┤
│                                                                        │
│   [External Clients (Web, Mobile, Third-Party)]                        │
│                 │                                                      │
│                 ▼ HTTPS / TLS 1.3 Termination                          │
│   ┌────────────────────────────────────────────────────────────────┐   │
│   │ Web Application Firewall (WAF)                                 │   │
│   │ • Layer 7 Attack Signatures (SQLi, XSS, SSRF)                  │   │
│   │ • IP Reputation, Bot Mitigation, Geo-Blocking                  │   │
│   └─────────────────────────────┬──────────────────────────────────┘   │
│                                 │ Cleaned Traffic                      │
│                                 ▼                                      │
│   ┌────────────────────────────────────────────────────────────────┐   │
│   │ ENTERPRISE CLOUD API GATEWAY (Perimeter Enforcement)           │   │
│   │                                                                │   │
│   │   1. Rate Limiting & Throttling (Token Bucket per Client/IP)   │   │
│   │   2. Authentication & JWT Validation (JWKS Key Verification)   │   │
│   │   3. Schema Validation (OpenAPI / JSON Schema Contract Match)   │   │
│   │   4. Request Transformation & Sanitization                     │   │
│   │   5. Logging, Tracing & Metrics (OpenTelemetry, SIEM)          │   │
│   └─────────────────────────────┬──────────────────────────────────┘   │
│                                 │ Authorized, Validated Requests Only  │
│                                 ▼                                      │
│   ┌────────────────────────────────────────────────────────────────┐   │
│   │ Internal Microservices Mesh (Private Subnet / mTLS Only)       │   │
│   │   ┌───────────────┐     mTLS     ┌───────────────┐             │   │
│   │   │ Auth Service  │ ◄──────────► │ Order Service │             │   │
│   │   └───────┬───────┘              └───────┬───────┘             │   │
│   │           │ Data-Level BOLA Check        │                     │   │
│   │           ▼                              ▼                     │   │
│   │   [Internal Databases & Microservice Object Stores]            │   │
│   └────────────────────────────────────────────────────────────────┘   │
│                                                                        │
└────────────────────────────────────────────────────────────────────────┘

1. Centralized Authentication & JWT Validation

The API Gateway offloads authentication from downstream microservices:

  • Validates incoming OAuth 2.0 Bearer tokens and JSON Web Tokens (JWTs).
  • Verifies cryptographic signatures using cached public keys fetched from an authoritative JSON Web Key Set (JWKS) endpoint.
  • Enforces token expiration (exp), audience (aud), and issuer (iss) validity.
  • Injects authenticated user context headers (e.g., X-User-ID, X-Tenant-ID) into downstream requests, allowing internal microservices to focus exclusively on business logic and data authorization.

2. Contract-First Schema Validation (Positive Security Model)

Traditional firewalls operate on negative security models (blocking known bad strings). API Gateways implement Positive Security Models via contract validation:

  • The gateway imports an authoritative OpenAPI Specification (OAS) or JSON Schema.
  • Every incoming request is strictly validated against the schema: verifying required parameters, data types (integer, string, UUID), string lengths, regex patterns, and allowed HTTP methods.
  • If a request contains undeclared properties, invalid data types, or unrecognized methods, the gateway rejects the request at the edge with an HTTP 400 Bad Request, preventing malformed payloads or mass-assignment exploits from ever reaching backend compute.

3. Rate Limiting, Throttling & Quotas

Protects backend services from resource exhaustion, credential stuffing, and DoS attacks:

  • Token Bucket / Leaky Bucket Algorithms: Enforces steady-state request limits (e.g., 500 requests per second) with allowable burst capacities.
  • Tiered Quotas: Applies differentiated rate limits based on client tier (e.g., anonymous public IP vs. authenticated user vs. enterprise partner API key).
  • Distributed Rate Limiting: Gateways utilize distributed caching tiers (e.g., Redis) to track rate quotas across horizontally scaled gateway instances.

4. Integration with Web Application Firewalls (WAF)

API Gateways deploy immediately behind or in direct integration with cloud WAFs (e.g., AWS WAF, Cloudflare, Azure Front Door):

  • Managed Rule Sets: Inspects payloads for Layer 7 injection patterns (SQLi, command injection, cross-site scripting).
  • Bot Control & Credential Stuffing Prevention: Analyzes request behavior to identify automated headless browsers, credential stuffing attacks, and scrapers.
  • IP Geoblocking & Reputation: Drops traffic originating from known malicious anonymizer proxies, Tor exit nodes, and unauthorized geographic regions.

Comparison: OWASP API Threats, Failure Modes & Gateway Defenses

OWASP ThreatPrimary Failure ModeArchitectural & Gateway Defense
API1: BOLA (IDOR)Missing ownership validation at data-access layerTenancy context validation in microservices; gateway object routing rules
API2: Broken AuthenticationMissing or unvalidated JWT cryptographic signaturesGateway-level JWKS signature verification, claim validation, OAuth 2.0
API3: Property AuthorizationMass assignment and excessive data exposureStrict OpenAPI/JSON schema validation; Data Transfer Objects (DTOs)
API4: Unrestricted ResourcesMissing rate limits and pagination boundariesGateway token-bucket throttling; strict request size and pagination caps
API5: BFLAUnchecked administrative API method invocationsCentralized RBAC/ABAC policy enforcement modules at gateway and service
API7: SSRFAPI coerced into requesting internal link-local IPEnforce IMDSv2, egress network filtering, allow-listed outbound proxies
API9: Inventory ManagementZombie and shadow API endpoints exposedCentralized API gateway cataloging; automated discovery; deprecate legacy v1

Common Pitfalls & Real-World Anti-Patterns

  1. Relying on Frontend UI for Authorization: Hiding administrative buttons or suppressing sensitive fields in a React or mobile application, while the underlying API endpoint remains completely open and returns full data models. Mitigation: The API must enforce absolute, zero-trust authorization on every single request regardless of the client.
  2. Confusing Authentication with Authorization (The BOLA Trap): Believing that because an API verifies a valid JWT, the request is secure. The token proves who the user is, but does not prove they have permission to access the specific object ID requested in the URI parameter.
  3. Exposing IMDSv1 in Cloud Workloads: Failing to mandate IMDSv2 across cloud virtual machines and containers. When an application suffers an SSRF vulnerability, attackers exploit IMDSv1 with a single unauthenticated HTTP GET request to harvest temporary cloud administrative credentials.
  4. Neglecting East-West Microservice Security: Deploying an API Gateway at the perimeter but allowing completely unauthenticated, plaintext HTTP communication between microservices within the internal VPC. If one internal microservice is compromised, the entire mesh is breached. Mitigation: Enforce mutual TLS (mTLS) and cryptographic service-to-service authorization using a service mesh (e.g., Istio, Linkerd).
Loading diagram...
Zero Trust Cloud API Architecture with Centralized Gateway Protections and East-West Service Mesh Isolation
Test Your Knowledge

A healthcare SaaS platform exposes a REST API allowing patients to view medical records. An authenticated patient logs in, receives a valid JWT, and accesses their record at /api/v1/records/8821. By altering the URI parameter to /api/v1/records/8822, the patient successfully retrieves medical records belonging to an entirely different patient. The application successfully validated the user's JWT, but returned the unauthorized record anyway. What OWASP API vulnerability does this represent, and what is the required technical mitigation?

A
B
C
D
Test Your Knowledge

An attacker targets a cloud-hosted web application that provides a 'Generate PDF from Webpage' feature via an API endpoint (POST /api/v1/render-pdf). The attacker supplies the URL http://169.254.169.254/latest/meta-data/iam/security-credentials/app-role in the request body. The vulnerable backend compute instance fetches this URL and renders a PDF containing the cloud instance's temporary IAM secret access keys and session tokens. What vulnerability class did the attacker exploit, and which combination of defensive controls best eliminates this threat vector in cloud environments?

A
B
C
D
Test Your Knowledge

A financial microservices application processes customer profile updates via an API endpoint (PUT /api/v1/profile). A threat actor discovers that by appending an unexpected JSON parameter {"accountBalance": 1000000, "role": "superadmin"} to their legitimate update request, the backend database directly updates these internal fields, granting the attacker administrative privileges and unearned funds. Furthermore, the application is frequently subjected to rapid automated credential-stuffing bursts that overwhelm backend databases. Which API Gateway capabilities directly resolve these vulnerabilities?

A
B
C
D