Independent security research on critical PHP session.upload_progress vulnerabilities (CVSS v4.0 9.2).
Author: Michael D. Bullet Date: 2026-10-21
Two pre-auth RCE vulnerabilities in PHP core's session.upload_progress handler, affecting PHP 5.4.0 through 8.5.x. The rfc1867 callback processes multipart POST bodies before application code runs, with no authentication required.
| Chain | Type | Conditions | Verified |
|---|---|---|---|
| A - Session Injection + LFI | Logic bug | upload_progress=On (default) + app LFI |
✅ RCE |
B - var_destroy UAF |
Memory corruption | unserialize() + /proc/self/mem |
✅ ASAN |
C - Handler Mismatch → __destruct |
Deserialization | Cross-dir handler mismatch + POP gadget | ✅ RCE |
- Session fixation -
MULTIPART_EVENT_FORMDATAacceptsPHPSESSIDfrom POST body, ignoringsession.use_only_cookies=On - Filename injection -
add_assoc_string_ex(*data->filename)stores raw filename in session without sanitization var_destroyUAF -i_zval_ptr_dtorat line 310 fires__destructwithoutBG(serialize_lock)→ heap-use-after-freePS(serializer)not reset inphp_rshutdown_session_globals()→ cross-request serializer leak in FPM__destructon decode failure -PHP_VAR_UNSERIALIZE_DESTROYfires even whenphp_var_unserialize()returns false
poc/
chain_a.rb - Session fixation bypass + filename injection + LFI → RCE
chain_b.php - var_destroy UAF (ASAN)
chain_c.rb - Handler mismatch → Evil::__destruct → RCE
lab/
setup.sh - One-click lab setup (generates docker-compose, configs)
docker-compose.yml - PHP 8.2.34 FPM + nginx
Dockerfile - Standard PHP build
Dockerfile.asan - PHP built with AddressSanitizer
php.ini / nginx.conf - Lab configuration
webroot/ - Target app (scrims.lol - realistic PHP web app)
docs/
writeup.md - Technical writeup (pt-BR)
ANALYSIS.md - Full technical analysis
cover.png - Cover image
# Start the lab
cd lab && bash setup.sh
# Chain A - session injection + LFI RCE
ruby poc/chain_a.rb
# Chain C - handler mismatch + __destruct
ruby poc/chain_c.rb
# Verify Chain C execution on target
docker exec php2shell-lab cat /tmp/destruct_triggered.txt
# Chain B - UAF (ASAN build required)
docker exec php-asan-lab php poc/chain_b.php 2>&1 | grep -E "(heap-use|ERROR|ASAN)"Chain A — Session injection + LFI → RCE
Chain C — Handler mismatch → Evil::__destruct
- PHP 5.4.0 - 8.5.11 (all versions with
session.upload_progress.enabled=On) - Fixed in: 8.2.35, 8.3.36, 8.4.27, 8.5.12 (2026-10-21)
- PHP 5.x, 7.x, 8.0, 8.1: end-of-life, no official fix
; Disables the vulnerable feature (breaks upload progress UI)
session.upload_progress.enabled = Off
session.use_only_cookies = Onalone is insufficient - CVE-2026-109618 bypasses it.
For authorized security testing and educational purposes only.


