API Gateway Security
The gateway is the single enforcement point for authentication, authorization and rate limiting in front of many backends, which makes it a high-value target: one flaw in the gateway, its admin plane, its caching, or the way it parses requests versus the backend defeats controls for every service behind it.
How it works
A gateway deployment has three pieces — the gateway, its datastore, and the admin API — and is only as secure as the weakest one. The recurring failure modes:
- Exposed admin API. Reading/writing gateway config in plaintext: routes, auth config, secrets.
- Authorizer caching keyed too coarsely. The cache omits the resource, so an ALLOW for one object is reused for another.
- Cache-key confusion in response/plugin caches. The caller identity isn’t in the key, so one caller’s response is served to another.
- Parsing disagreement with the backend. The gateway and backend split requests differently, so a smuggled request bypasses every gateway control. See HTTP Request Smuggling.
- Plugin and protocol flaws: missing assertion checks, injection, missing timeouts.
Techniques / payloads
Admin-API exposure (Kong case study, Trend Micro). Kong’s admin API listens on localhost by default, but the Docker Hub example binds all interfaces on 8001/8444 with weak passwords; absent cloud firewall rules leave it public (visible in Shodan since late 2021). Access lets an attacker add routes, tamper with auth, or read secrets. Kong stores secrets in the DB as plaintext in the community edition; encryption needs the enterprise keyring. Mitigations: bind admin to localhost, firewall to specific subnets/VPN, enterprise RBAC with token auth on an admin route.
Authorizer / cache-key confusion (Authress). An AWS API Gateway authorizer that caches by JWT only breaks two ways:
- Return the specific
event.methodArnas the policy resource and the cache denies the same user’s valid request to a different endpoint (annoying but safe). - “Fix” it to
arn:aws:execute-api:*:*:*and now any endpoint is allowed for a valid JWT — and if you also cache a per-resource authorization result (authorizeUser(userId, 'orders_123', ...)), the cache storesJWT => ALLOWwithout the object ID, so a follow-up toorders_456returns the cached ALLOW and is never re-checked. Fix: include the resource in the cache key, or don’t cache per-object decisions.
Request smuggling at the gateway (apisec.ai). HTTP/1.1 ambiguity between Content-Length and Transfer-Encoding is amplified because gateways multiplex many clients over shared backend connections — one smuggled request poisons the connection for other users and bypasses auth/rate limits in one step.
POST /api/v1/data HTTP/1.1
Content-Length: 6
Transfer-Encoding: chunked
0
X- CL.TE, TE.CL, and obfuscated TE (
Transfer-Encoding: xchunked, tabs, line folding). Real CVEs: CVE-2024-53008 and CVE-2023-40225 (HAProxy ACL bypass / emptyContent-Length), CVE-2024-33452 (HEAD with body). Detection: send conflicting CL/TE and watch for a timeout (backend waiting for bytes that never arrive). Fix: HTTP/2 end-to-end (frame length fields remove the ambiguity), disable HTTP/1.1 downgrade, disable backend connection reuse, re-audit config after every deploy.
Notable cases (recent CVEs)
- Kong graphql-proxy-cache-advanced (CVE-2026-92442). Omits the caller identity from the cache key, so a response cached for one caller is served to another.
- Kong Enterprise SAML plugin (CVE-2026-92439). Does not enforce
AudienceRestriction, so a SAML assertion issued for another Service Provider can be replayed to authenticate to Kong. See SAML Attacks. - Kong Gateway Enterprise / Kong AI Gateway (CVE-2026-92544). SQL injection in the LLM usage counters via a crafted model name. See SQL Injection.
- GraphQL Hive Gateway batch-execute (sonatype-2026-010434, CVSS 8.6). Authorization bypass via context confusion in GraphQL Tools Batch Execute. See GraphQL Batching Attacks.
- Azure API Management Classic (Nov 2026, exploited). Unauthorized management-plane access on the Developer, Basic, Standard and Premium tiers (not Consumption or v2) allowed admin operations, including reading secrets: Named Values, IdP and OIDC client secrets, subscription keys, and direct-management API tokens. Microsoft blocked the path on 19 Nov and stated that stolen credentials stay valid until rotated. Norway’s NSM tied it to attacks on Equinor and Skagerak Energi and told customers to check runtime versions. An affected admin alleged an auth bypass in a deprecated legacy API that left no customer-visible logs (unverified). Lesson: a gateway that stores backend secrets turns a control-plane flaw into downstream compromise.
- IBM API Connect 12.1.0.0–12.1.1.2 (CVE-2026-17323). XXE allowing remote disclosure of sensitive information. No verified vendor patch at publication; the interim advice was to restrict access with a WAF or IP allowlist. See XML External Entity Injection.
- Traefik ≤ 3.7.11. The default 60-second request read timeout was silently not applied to HTTP/3 (introduced in 2.8.2, Aug 2022), letting an unauthenticated client hold requests open indefinitely, one upstream connection each — a low-volume DoS against bounded backend pools. Fixed in 2.11.56 / 3.7.12.
Defenses
- Bind the admin plane to localhost; firewall and authenticate it. Never copy example configs that expose it.
- Put the caller (and object, where relevant) in every cache key; don’t cache per-object authorization at the gateway.
- Validate JWTs at the gateway and re-authorize in each backend (defense in depth); pass trusted claims as headers the client can’t set.
- Prefer HTTP/2 end-to-end, disable downgrade and backend connection reuse, re-audit after infra changes.
- Store gateway secrets encrypted (vault/keyring), not plaintext in the config DB.
- After a gateway control-plane incident, rotate every secret the gateway held (named values, IdP client secrets, subscription keys). Fixing the vendor’s access path does not revoke credentials that were already taken.
Related
- API Security
- HTTP Request Smuggling
- JSON Web Tokens
- GraphQL Batching Attacks
- SAML Attacks
- SQL Injection
- API Rate Limiting
Sources
- Kong API Gateway Misconfigurations: A Security Case Study · original
- Kong API Gateway Misconfigurations Case Study - Trend Micro · original
- API Gateway Authorizers: Vulnerable By Design · original
- HTTP Request Smuggling in API Gateways · original
- Kong graphql-proxy-cache-advanced leaks cached responses across callers · original
- Kong Gateway Enterprise SAML plugin does not enforce AudienceRestriction · original
- SQL injection in LLM usage counters of Kong Gateway Enterprise / Kong AI Gateway · original
- GraphQL Hive Gateway batch-execute authorization bypass · original
- Traefik - Version Through 3.7.11 · original
- Microsoft Azure flaw exploited to steal customers' API credentials · original
- IBM API Connect XXE (CVE-2026-17323) · original