Apache HTTP Server HTTP/2 HPACK Cookie-Merging Memory Bomb (CVE-2026-49975)
by 201535611 · 2026-07-05
- Severity
- High
- CVE
- CVE-2026-49975
- Category
- network
- Affected product
- Apache HTTP Server (mod_http2)
- Affected versions
- Apache HTTP Server 2.4.17 through 2.4.67
- Disclosed
- 2026-07-05
- Patch status
- unpatched
Tags
References
Archive entry
intelseclab/poc-archiveMetadata
| Field | Value |
|---|---|
| Date Added | 2026-07-05 |
| Last Updated | 2026-07 |
| Author / Researcher | 0xc03307b |
| CVE / Advisory | CVE-2026-49975 |
| Category | network |
| Severity | High |
| CVSS Score | Not specified in source |
| Status | PoC |
| Tags | apache, httpd, http2, hpack, mod_http2, cookie-header, memory-exhaustion, denial-of-service, flow-control |
| Related | N/A |
Affected Target
| Field | Value |
|---|---|
| Software / System | Apache HTTP Server (mod_http2) |
| Versions Affected | Apache HTTP Server 2.4.17 through 2.4.67 |
| Language / Platform | C (Apache httpd / mod_http2), Python 3 PoC client (raw sockets, custom HPACK encoder) |
| Authentication Required | No |
| Network Access Required | Yes |
Summary
CVE-2026-49975 is a denial-of-service vulnerability in Apache HTTP Server’s HTTP/2 request handling. A small HPACK-encoded HTTP/2 header block can reference the HPACK dynamic-table entry for the cookie header many times (up to the request field limit), which the server expands and merges into a single large Cookie header per stream without properly counting each reference against LimitRequestFields. By opening multiple streams across multiple connections, each carrying this compact-but-expanding header block, and then using HTTP/2 flow control (zero/near-zero initial window, slow WINDOW_UPDATE “drip”) to keep the affected streams open, an attacker can force the server to repeatedly allocate memory for cookie-merging while preventing that memory from being released, driving up server memory usage.
Vulnerability Details
Root Cause
Apache’s HTTP/2 (mod_http2) header processing merges repeated cookie header field instances (as required by HTTP/2 semantics, unlike HTTP/1.1) into one logical Cookie header per request. This merge/allocation path is not properly counted against LimitRequestFields, so a small HPACK header block that references an already-indexed cookie dynamic-table entry (via indexed(62)) many times (thousands of references) causes memory allocation proportional to the number of references and their concatenated size, on the wire cost of only a few bytes per reference. Held open via HTTP/2 flow control, many concurrent streams doing this can exhaust server memory before any request is actually processed.
Attack Vector
- Attacker establishes one or more h2c (HTTP/2 cleartext) connections to the target Apache server, sending the client preface and an initial SETTINGS frame with
SETTINGS_INITIAL_WINDOW_SIZEset to 0. - On each connection, the attacker opens many streams (e.g. 100 per connection), sending on each a compact HPACK header block: standard
:method/:scheme/:path/:authoritypseudo-headers, followed by one literalcookie:header (added to the HPACK dynamic table) and then thousands of back-to-back references (indexed(62)) to that same dynamic-table entry. - The server expands and merges each stream’s repeated cookie references into one large logical Cookie header, allocating memory proportional to the reference count — the PoC computes an estimated allocation of
refs * (refs + 1) + refsbytes per stream for the default--refs 4091. - With the initial window at (or near) zero, the server cannot send a full response; the attacker “drips” tiny WINDOW_UPDATE increments (
--drip-interval,--drip-bytes) just often enough to keep the streams alive without releasing them, holding the allocated memory for an extended period (--hold, default 300s) across many concurrent connections/streams. - Repeating this across enough connections drives the server’s memory usage up, degrading or denying service to legitimate clients.
Impact
Remote, unauthenticated denial of service via excessive memory consumption on the Apache HTTP Server host; delayed or failed processing of normal user requests while the attack streams are held open.
Environment / Lab Setup
Target: Docker container built from the included Dockerfile (httpd:2.4.67 base, mod_http2 enabled, `Protocols h2c http/1.1`, `H2Direct on`), exposed on a mapped port (e.g. 10081->80)
Attacker: Python 3 (stdlib only: socket, struct, threading, argparse) running poc.py against the target host/port
Proof of Concept
PoC Script
See
poc.py,check_server.py, andDockerfilein this folder.
| |
poc.py opens the configured number of h2c connections, sends the configured number of streams per connection each carrying the compact cookie-bomb HPACK block, then holds the streams open by dripping minimal WINDOW_UPDATE increments for the configured hold duration, printing per-connection frame/byte statistics. check_server.py is a companion victim-probe script that issues periodic plain HTTP/1.1 GET requests and logs success/timeout/latency so the DoS impact on normal traffic can be measured concurrently.
Detection & Indicators of Compromise
Signs of compromise:
docker stats/ process memory monitoring showing steadily climbing memory usage on the Apache host with no corresponding legitimate traffic increase- Elevated latency or timeouts on unrelated, normal HTTP requests to the same server during the memory climb
- Server logs or connection tracking showing long-lived HTTP/2 streams with minimal window updates from a small set of client IPs
Remediation
| Action | Detail |
|---|---|
| Primary fix | Upgrade Apache HTTP Server to 2.4.68 or later, which addresses the Cookie header merge counting against LimitRequestFields |
| Interim mitigation | Consider disabling HTTP/2 (mod_http2) temporarily if not required; apply connection/stream count limits and aggressive idle/hold timeouts at a reverse proxy or load balancer in front of Apache; monitor and cap per-worker memory usage |
References
Notes
Mirrored from https://github.com/0xc03307b/CVE-2026-49975 on 2026-07-05.
| |