Local-only PoC lab for CVE-2026-115560 (PHP session upload-progress serialize-handler confusion) — two-request PoC on the PHP CLI built-in server (no Docker) + fleet audit implementing the advisory's decision tree.
Companion lab for the black box article on CVE-2026-115560 (PHP session.upload_progress,
informational advisory, 2026-10-23). Part 2 of the php2shell story
(part 1: CVE-2026-109618/109619).
Local target only (127.0.0.1). Never aimed at third-party systems.
session.serialize_handler = php_binary or php_serialize in configuration;php at runtime with ini_set() before session_start();session.upload_progress.enabled still on.PHP calls this setup "unlikely in practice" — the advisory is informational, the fix ships
in the regular cycle. The mitigation is the same as GHSA-6wmf-4rv5-p3rp (CVE-2026-109619):
session.upload_progress.enabled=0.
No Docker needed — the PHP CLI's built-in server is the whole stack, and the serializer
grammar is not version-specific. Requires php and python3 on $PATH.
$ ./run.sh # starts 127.0.0.1:8899 (or ./run.sh PORT) and runs the PoC
What the two requests do:
PHP_SESSION_UPLOAD_PROGRESS value is the
attacker-chosen key p|O:8:"DemoVuln":1:{...}. The progress hook stores the entry with
the configured handler (php_binary: length-prefixed key, no | semantics).
session.upload_progress.cleanup=0 keeps the entry after the upload completes — no race./?a=read: the target does ini_set('session.serialize_handler','php') then
session_start(). The php grammar splits entries at the first | — which the
attacker planted — and unserializes attacker bytes. DemoVuln::__wakeup fires.Expected output (PHP 8.5.10):
[1] upload POST — writes the progress entry under the crafted key…
HTTP/1.1 200 OK
[2] read GET — ini_set to `php`, session_start()…
HTTP/1.1 200 OK
> [CVE-2026-115560] DemoVuln::__wakeup — attacker-controlled unserialize executed, note=pwned-1
> read OK — session keys: []
RESULT: INJECTION CONFIRMED
Two details in that output are the lab's teaching points:
read OK — session keys: [] — the decoder fails on the trailing progress-array bytes
that follow the injected object, and destroys the session. The gadget still ran.PHP Warning: session_start(): Failed to decode session object —
that warning is your detection artifact: a session store written under one grammar
and read under another shows up exactly there.$ ./audit-cve-2026-115560.sh -s /path/to/src -c /path/to/config
Implements the advisory's decision tree: scans ini files for non-default
session.serialize_handler (leg 1), greps sources for the runtime ini_set switch
(leg 2, tests/vendor excluded), reads the effective config for each SAPI (CLI vs FPM —
the "fixed the wrong ini" trap; php -i in CLI proves nothing for php-fpm), and checks
the branch version against the 2026-10-21 patched releases (8.5.12 / 8.4.27 / 8.3.36 / 8.2.35).
Exit codes: 0 nothing to do · 1 mitigate now · 2 patches missing · 64 usage.
--json for CI. Read-only.
On this very kit's target it reports ACTION — as it should: the demo ships all three legs.
session.upload_progress.enabled=0)? Keep it. No further action.ini_set() on session.serialize_handler? You can keep upload progress enabled.session.upload_progress.enabled=0 now, watch for
the full advisory with the next regular release.| file | role |
|---|---|
run.sh | binds 127.0.0.1, launches the vulnerable target + the PoC |
target/index.php | the combo: php_binary in config, ini_set() to php on the read path |
target/DemoVuln.php | the gadget (__wakeup) standing in for a real POP chain |
exploit.py | the two-request PoC (raw sockets, no dependencies) |
audit-cve-2026-115560.sh | fleet audit implementing the advisory's decision tree |