Skip to content

ALB resets HTTP/2 stream with PROTOCOL_ERROR (elb_status_code 000) before forwarding, only for POST with a large Authorization header + body

0

Summary

On an Application Load Balancer (HTTPS listener, routing.http2.enabled=true), a POST request that carries both a large Authorization header (a ~1.6 KB bearer token) and a request body fails over HTTP/2: the ALB returns elb_status_code=000 and never forwards the request to the target. The exact same request over HTTP/1.1 succeeds. The behavior is 100% deterministic and reproduces even with single, sequential requests.

curl reports: curl: (92) HTTP/2 stream 0 was not closed cleanly: PROTOCOL_ERROR (err 1)

Environment

  • Application Load Balancer, HTTPS listener (TLS 1.3), routing.http2.enabled=true
  • Listener rules: simple forward only (no JWT-verify / authenticate action)
  • AWS WAF associated with the ALB
  • routing.http.desync_mitigation_mode=defensive, drop_invalid_header_fields=false
  • Target: a single backend speaking HTTP/1.1 (ALB→target is HTTP/1.1 as usual)

ALB access log for the failing requests

h2 ... <client> - -1 -1 -1 000 - 1440 0 "POST https://<host>:443/api/auth/token HTTP/2.0"
   "curl/7.81.0" TLS_AES_128_GCM_SHA256 TLSv1.3 - "-" ... "-" "-" "-" "-" "-" "-" ...
  • target = "-", actions_executed = "-", classification = "-"
  • request/target/response processing times = -1, elapsed ~2 ms
  • The backend access logs show no record of these requests → the ALB reset the stream before forwarding (request never reached the target).

Reproduction

# Bearer ~1.6 KB. Over HTTP/2 -> reset (curl exit 92 / elb 000)
curl --http2 -X POST https://<host>/api/auth/token \
  -H "Authorization: Bearer <~1.6KB token>" \
  -H "Content-Type: application/json" -d '{"k":"v"}'

# Same request over HTTP/1.1 -> succeeds (201)
curl --http1.1 -X POST https://<host>/api/auth/token \
  -H "Authorization: Bearer <~1.6KB token>" \
  -H "Content-Type: application/json" -d '{"k":"v"}'

Isolation testing (all over HTTP/2, same large token)

ChangeResult
POST + body (baseline)000 / reset
Remove body (no DATA frame)forwarded OK
GET instead of POSTforwarded OK
Flip 1 char of the token (same length)forwarded OK
Random/dummy bearer of similar or larger size (≤2KB)forwarded OK
Add an extra padding header (grow total size)still reset
HTTP/1.1 (any of the above)always OK

Interpretation: the trigger is the exact byte alignment of the large HEADERS frame followed by a DATA frame. A 1-byte change to the token, or removing the body, moves it off the boundary and it works. This is why it never reproduces over HTTP/1.1, on GET, or with arbitrary dummy tokens.

What I ruled out

  • Request/header size limits (well under 16K/64K; larger dummy h2 POSTs succeed)
  • HPACK Huffman compressibility (compressible / JWT-shaped dummies succeed)
  • AWS WAF block (actions_executed="-", i.e. WAF never ran; not a 403)
  • Desync mitigation (classification="-")
  • The documented 000 cause (>10,000 requests per HTTP/2 connection) — these are single requests on fresh connections
  • Backend processing time (the request never reaches the target)

Workaround applied

Setting routing.http2.enabled=false resolves it: ALPN no longer offers h2, clients fall back to HTTP/1.1, and the requests succeed. Verified end-to-end.

Question

  1. Is this a known ALB HTTP/2 frame-handling edge case (HEADERS frame ending on a read / TLS-record boundary with a following DATA frame)?
  2. Is there any fix that keeps HTTP/2 enabled, or is disabling HTTP/2 on the ALB the only option short of fronting with CloudFront (client h2 / origin h1.1)?
1 Answer
0

Hello.

As far as I could tell, I couldn't find any restrictions on ALB header sizes other than those described in the following document.
As stated in the documentation, there is a 16 KB limit, but I don't think it will behave in a way that causes access to fail at 1.6 KB.
https://docs.aws.amazon.com/elasticloadbalancing/latest/application/load-balancer-limits.html#http-headers-quotas

If accessing the ALB directly via HTTP/2 causes problems, then I think placing CloudFront in front of it is the best solution at the moment.
This could be a bug, so you may need to contact AWS support for clarification.

EXPERT

answered 5 months ago

EXPERT

reviewed 5 months ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.