Skip to content
Exploit for Improperly Controlled Sequential Memory Allocation in Php

Exploit for Improperly Controlled Sequential Memory Allocation in Php

Sploitus • October 22, 2026

**CVE-2026-109619** (RCE via stale global state) in PHP's request lifecycle, plus the

application-level session attacks that were validated alongside them.

Unauthenticated. HTTP only. The CVE target page is literally `` —

no `session_start()`, no application code, no writable webroot required.

PROOF: uid=33(www-data) gid=33(www-data) groups=33(www-data)

> Authorized testing only. Run this against the lab in this repo or systems you are

This repository is self-contained. It does not clone, import, or require any other

Four validated exploits at different layers:

| `exploit/php2shell.py` | CVE chain: OOM → stale state → `zif_system` | 8.4.26 (RCE), 8.4.27/8.5.12 (blocked) |

| `exploit/chain_a_session_lfi.py` | session-file injection + any LFI sink | **8.4.27 patched** (RCE), 8.5.12, 8.2.34/8.2.35 |

| `exploit/chain_c_serializer_mismatch.py` | serialize-handler mismatch → gadget `__destruct` | 8.2.34 and **8.4.27 patched** (RCE) |

| `exploit/oom_prime.py` | OOM prime / worker kill, no RCE | 8.4.26, 8.2.34 (abort), 5.6.40 (segfault) |

Only the first is the CVE. Chain A and Chain C are application/config bugs: they were both

validated against patched builds and need a sink or a gadget. The OOM prime is the shared

Everything substantive from the earlier research trees is consolidated here:

| Five-chain claims, working and disproved | `docs/NEGATIVE.md`, `exploit/chain_a_session_lfi.py`, `exploit/php2shell.py`, `exploit/chain_c_serializer_mismatch.py` |

| Detection pack (Suricata, Sigma, ModSecurity, OpenResty) | `detection/` |

| Patch analysis, including what is still unfixed | `docs/PATCH_ANALYSIS.md` |

| Local FPM experiments and failure evidence | `docs/LOCAL_TESTS.md`, `research/` |

| Adjacent bench findings (`display_errors=0` leak, BG UAF) | `docs/ADJACENT_RESEARCH.md` |

| Item-by-item consolidation manifest | `docs/SOURCE_COVERAGE.md` |

| ASLR/heap research and offset derivation | `docs/ARCHITECTURE.md`, `exploit/php2shell.py` |

| Version matrix and raw outputs | `docs/VALIDATION.md` |

No external repository is required to reproduce any finding.

| `php:8.4.26-apache` (mod_php, prefork, single worker) | **RCE verified** |

| `php:8.4.27-apache` (fixed, latest 8.4) | no corruption, no leak, no RCE |

| `php:8.5.12-apache` (fixed, latest release) | no corruption, no leak, no RCE |

| `php:8.2.34-apache` | heap corruption + abort; leak gadget needs retune |

| `php:5.6.40-apache` | 3/3 worker segfault from one unauth POST (DoS) |

| `php:7.4-apache`, `php:8.0-apache` | stale session id across requests, no RCE |

| `php:8.1-apache` | not triggered by this OOM shape |

The exploit must run from inside the compose network. Docker Desktop's port proxy

buffers the upload and breaks the concurrent-read race the leak depends on.

lab/ compose: target 8.4.26, patched 8.4.27, lfi 8.4.27+sink,

mismatch 8.2.34+fpm, mismatch-patched 8.4.27, attacker

exploit/ php2shell.py, chain_a_session_lfi.py,

chain_c_serializer_mismatch.py, oom_prime.py, offsets

detection/ Suricata, Sigma, ModSecurity, OpenResty rule pack

research/ static-mismatch and destruct-on-failure reproductions

payloads/ recon.sh, exfil.sh, webshell.php

tools/ probe_leak.py (spray calibration), calibrate.sh,

scripts/ run.sh / run.ps1 drivers (Docker Compose modes)

docs/ ARCHITECTURE.md (internals), PATCH_ANALYSIS.md,

VALIDATION.md (evidence), LOCAL_TESTS.md (FPM experiments),

DETECTION.md (blue team), OPS.md (playbook),

NEGATIVE.md (disproved chains), CREDITS.md,

out/ proofs, leaks, exfil dumps (gitignored)

1. **Prime** — 1001 fields, `PHPSESSID=\x00`, upload-progress field, file part, 12 MB

field. `max_input_vars` warning sends headers; the 12 MB field OOMs inside request

startup. `zend_bailout` leaves request-owned state in worker globals.

2. **Leak chunk** — request sprays 841 × 48-byte values plus a 79-byte forged

`zend_string` with `len = 0x1000`. It lands on the stale session id; `php_url_encode`

reads 4096 bytes into `Set-Cookie`. The 2 MB-masked pointer mode is the Zend MM chunk

3. **Leak libphp** — same trick with nested vars. A pointer congruent to `zval_ptr_dtor`

mod 0x1000 gives the libphp base after subtracting `DTOR_OFFSET`.

4. **Execute** — forge a `HashTable` (`pDestructor = zif_system`) plus a 167-byte

`zend_string`, overwrite `PS(http_session_vars)` with a 15-byte carrier. Shutdown

destroys the table and calls `system(cmd)`.

Command length is capped at 14 bytes by the carrier. Use `sh 1000 bytes and has ≥ 8 pointers in the window. `miss` means

- mod_php (Apache prefork). FPM kills the child on startup failure, so stale state is

- Single worker, so ASLR stays stable across the leak requests.

- `memory_limit` small enough to OOM within `post_max_size` (lab: 8M / 64M).

- `display_errors=On` for this build. `session.upload_progress.enabled=On`.

Full index: [`docs/README.md`](docs/README.md).

- [`docs/ARCHITECTURE.md`](docs/ARCHITECTURE.md) — chain internals and retuning

- [`docs/PATCH_ANALYSIS.md`](docs/PATCH_ANALYSIS.md) — what the fix covers and what it does not

- [`docs/VALIDATION.md`](docs/VALIDATION.md) — raw evidence behind every claim

- [`docs/LOCAL_TESTS.md`](docs/LOCAL_TESTS.md) — FPM lab experiments and failure evidence

- [`docs/ADJACENT_RESEARCH.md`](docs/ADJACENT_RESEARCH.md) — bench findings outside the shipped chain

- [`docs/SOURCE_COVERAGE.md`](docs/SOURCE_COVERAGE.md) — consolidation manifest

- [`docs/DETECTION.md`](docs/DETECTION.md) — logs, signatures, mitigation order

- [`detection/`](detection/) — deployable rule pack

- [`docs/OPS.md`](docs/OPS.md) — target selection and post-exploitation

- [`docs/NEGATIVE.md`](docs/NEGATIVE.md) — chains tested and disproved

- [`docs/CREDITS.md`](docs/CREDITS.md) — provenance

The repository is standalone and ready for a fresh remote:

CI (`.github/workflows/ci.yml`) starts the lab, asserts the CVE chain, the patched

control, Chain A, Chain C on both vulnerable and patched builds, and the OOM prime.

No secrets or host-specific paths are required.

MIT. See `LICENSE` and `docs/CREDITS.md`.