GHSA-658j-r8rw-q6mx / CVE-2026-115560: Session serializer mismatch can lead to remote code execution
- Published:
- Fetched:
- Updated:
- Affects:
- php ext-session
- KEV due:
- 2026-10-29
https://github.com/php/php-src/security/advisories/GHSA-658j-r8rw-q6mx ↗
Session serializer mismatch can lead to remote code execution ### Summary PHP's session upload progress feature can write attacker-controlled data using one session serialization format and later read it using another. A mismatched decoder can interpret part of a session key as serialized object data. An application with a suitable object gadget chain can then execute code with the privileges of the PHP worker. This is a configuration-dependent deserialization issue, separate from the stale global state vulnerability in CVE-2026-109619 (GHSA-6wmf-4rv5-p3rp). Session upload progress was introduced in PHP 5.4.0, so older unsupported releases may also be affected. ### Details The affected setup has the following conditions: - Session upload progress is enabled, and an attacker can submit a multipart upload to a context using `php_binary` or `php_serialize` as its session serializer. - A later or concurrent operation can access the same stored session, using the same session ID and the `php` serializer. - For code execution, the reading application has a suitable deserialization gadget chain available. The mismatch can arise when an application changes `session.serialize_handler` to `php` before calling `session_start()`. It can also arise between separate applications, pools, virtual hosts, or command-line processes with different fixed INI settings. With the `files` handler, this requires the same session storage directory, the same session ID, and permissions allowing both sides to access that file. Separate FPM pools do not automatically provide separate session storage. A runtime configuration change is not required, but workers using the same serializer do not create this mismatch. During multipart processing, PHP appends the submitted `PHP_SESSION_UPLOAD_PROGRESS` value to an upload-progress session key and persists it. The `php` format separates each key from its serialized value with `|`. The other formats represent keys differently. If their output is read as `php`, an attacker-supplied delimiter can cause bytes inside the key to be passed to PHP's unserialization machinery. Objects may be created and their deserialization or destruction callbacks invoked before trailing data causes the session decoder to reject the record. The 127-byte key limit in `php_binary` does not prevent payloads that span multiple session records. ### Impact Successful exploitation can cause remote code execution, file modification, session corruption, or denial of service. The report includes command execution using a Guzzle object gadget on PHP 8.2.35, 8.3.36, 8.4.27, and 8.5.12. Command execution was also reproduced with a Monolog 2.11.1 gadget using a `php_serialize` writer and a `php` reader. Exploitability depends on the shared session configuration, access to the writing and reading paths, and the classes available to the reader. An application that never changes its serializer at runtime can still be affected if another application or process writes incompatible data into the same se Affected packages: php:ext-session Patched: ext-session 8.2.36, ext-session 8.3.37, ext-session 8.4.28, ext-session 8.5.13