CVE-2026-115560: Dissecting PHP’s Unpatched Session Deserialization RCE Risk Two Days After PHP2Shell

Two days after emergency PHP2Shell patches dropped, PHP warned of a separate unpatched RCE risk (CVE-2026-115560). Here is how runtime session.serialize_handler changes collide with session.upload_progress to trigger same-request PHP Object Injection—and how to lock it down.

CVE-2026-115560 Unpatched PHP Session Deserialization Mismatch and RCE Analysis
⚠️
Threat Advisory: CVE-2026-115560 (Unpatched PHP Session RCE Vector) Just 48 hours after shipping emergency patches for PHP2Shell (CVE-2026-109618 & CVE-2026-109619), the PHP security team disclosed CVE-2026-115560: a distinct, currently unpatched Remote Code Execution (RCE) risk involving session.upload_progress and runtime changes to session.serialize_handler. Because it requires a specific four-part configuration, PHP is holding the fix until the next routine bugfix cycle—making configuration hardening essential today.

If your infrastructure team just finished rolling out PHP 8.5.12, 8.4.27, 8.3.36, or 8.2.35 to remediate the critical PHP2Shell vulnerabilities (CVE-2026-109618 & CVE-2026-109619), take a breath—your emergency patching work was not in vain. However, on October 23, 2026, two days after those emergency releases dropped, the PHP Foundation issued a follow-up warning regarding a separate, still-unpatched Remote Code Execution vector tracked as CVE-2026-115560.

Unlike the original PHP2Shell memory corruption flaws—which threatened virtually every default PHP installation prior to script execution—CVE-2026-115560 is an architectural state-mismatch vulnerability between PHP's request startup phase (RINIT) and userland runtime execution. Because it only triggers under a specific, uncommon four-condition setup, the PHP maintainers opted not to push another out-of-cycle emergency build, scheduling the patch for the next routine monthly release instead.

In this post, we break down the exact C-level mechanics of CVE-2026-115560, explain why switching session.serialize_handler at runtime turns session.upload_progress into a same-request PHP Object Injection primitive, and show you how to audit and lock down your fleet in minutes.


1. Am I Vulnerable? The Four Required Preconditions

According to the PHP security advisory, an application running even the latest patched PHP builds (8.5.12 / 8.4.27 / 8.3.36 / 8.2.35) is exposed to CVE-2026-115560 if and only if all four of the following conditions are met simultaneously:

  1. Global Handler Configuration: session.serialize_handler is configured as php_serialize or php_binary at the server or directory level (in php.ini, PHP-FPM pool configs, .htaccess, or .user.ini).
  2. Upload Progress Active: session.upload_progress.enabled is set to 1 / On (which is enabled by default in standard PHP distributions).
  3. Dynamic Runtime Override: The application's PHP code dynamically changes the serialization handler to php at runtime by calling:
    ini_set('session.serialize_handler', 'php');
  4. Pre-Session Timing: That ini_set() call occurs before the script invokes session_start().

If your application never calls ini_set('session.serialize_handler', ...)—which is true for default installations of WordPress, Laravel, Symfony, and Drupal—you are not exposed to CVE-2026-115560. However, legacy enterprise applications, custom SSO bridges, and multi-app monoliths that migrate between session formats frequently use runtime ini_set() overrides to maintain backward compatibility with older session stores.


2. Technical Root Cause: How the RINIT vs. Userland Deserialization Mismatch Works

At first glance, those four conditions look oddly specific. Why would setting session.serialize_handler = php_serialize in php.ini and overriding it with ini_set('session.serialize_handler', 'php') before session_start() lead to pre-authentication Remote Code Execution?

The answer lies in the two-phase timing gap between PHP's SAPI Request Initialization (RINIT) phase and userland script execution:

Incoming HTTP Request (multipart/form-data + PHP_SESSION_UPLOAD_PROGRESS)
  │
  ├─► PHASE 1: SAPI Request Startup (RINIT — Before Userland Script Runs)
  │     ├─► Active setting from php.ini: session.serialize_handler = php_serialize
  │     ├─► rfc1867_post_handler() parses multipart body & filenames
  │     ├─► php_session_rfc1867_callback() auto-starts & closes session
  │     └─► Writes $_SESSION upload progress to /tmp/sess_<id>
  │           using the php_serialize (or php_binary) encoder!
  │
  └─► PHASE 2: Userland Script Execution (php_execute_script)
        ├─► Script runs: ini_set('session.serialize_handler', 'php');
        ├─► Script runs: session_start();
        └─► Reads /tmp/sess_<id> written in Phase 1, but decodes it
              using the legacy 'php' pipe-delimited (|) deserializer!
              └─► 💥 ARBITRARY PHP OBJECT INJECTION -> RCE

The Fatal Clash Between php_serialize and php Formats

PHP supports multiple internal engines for serializing the $_SESSION superglobal to disk (ext/session/session.c):

  • php_serialize: Uses PHP's standard serialize() function to encode the entire session array as a single serialized array:
    a:1:{s:23:"upload_progress_test";a:5:{s:10:"start_time";i:1792760000;...}}
    Crucially, php_serialize treats the pipe character (|) inside strings as an ordinary literal character.
  • php (the legacy default handler): Does not wrap $_SESSION in a top-level serialized array. Instead, it writes each key name followed by a literal pipe delimiter (PS_DELIMITER = '|'), followed by the serialized value of that key:
    upload_progress_test|a:5:{s:10:"start_time";i:1792760000;...}
🔬
The Deserialization Trap (ps_srlzr_decode_php) When the legacy php deserializer reads a session buffer that was written by php_serialize, it scans the raw string for the first | character, treats everything before | as a dummy variable name, and feeds the bytes immediately following | straight into php_var_unserialize()!

Connecting It to session.upload_progress in a Single Request

Historically, cross-handler session deserialization bugs (such as Ryat's classic 2016 findings) required an attacker to visit two different scripts configured with different handlers. CVE-2026-115560 collapses the entire attack into a single HTTP request against a single script:

  1. An unauthenticated attacker sends a multipart/form-data POST request containing the form field PHP_SESSION_UPLOAD_PROGRESS (or a file upload whose filename attribute begins with a pipe | followed by a serialized gadget chain payload).
  2. During Phase 1 (RINIT), the userland script has not started yet, so the active serializer is still whatever is set in php.ini (php_serialize or php_binary). php_session_rfc1867_callback() writes the attacker's string (including the literal | and serialized payload) into the session storage and flushes it.
  3. Milliseconds later, in Phase 2 (Userland) of the very same HTTP request, the target script executes ini_set('session.serialize_handler', 'php') and calls session_start().
  4. session_start() loads the session data written during Phase 1, parses it with the php handler, encounters the attacker's injected | delimiter, and instantiates the attacker-supplied PHP object—triggering magic methods like __wakeup() or __destruct() across any class loaded in the application or Composer autoloader.

3. Comparing the October 2026 PHP Session Advisories

Because three session-related CVEs have surfaced within the same week, here is how they compare for engineering and SOC teams:

Identifier Vulnerability Class Preconditions Patch Status (Oct 23, 2026)
CVE-2026-109618
(PHP2Shell)
RFC 1867 Multipart Stream & Memory Exhaustion (main/rfc1867.c) Default PHP configs accepting HTTP requests Patched Oct 21
(8.5.12, 8.4.27, 8.3.36, 8.2.35)
CVE-2026-109619
(PHP2Shell)
Heap Use-After-Free (zval * dangling pointers in ext/session/session.c) & Fatal Error State Corruption Default PHP configs (session.upload_progress.enabled=1) Patched Oct 21
(8.5.12, 8.4.27, 8.3.36, 8.2.35)
CVE-2026-115560
(New Advisory)
RINIT vs. Userland Session Deserialization Mismatch (PHP Object Injection -> RCE) php_serialize/php_binary in config + runtime ini_set('session.serialize_handler', 'php') before session_start() + upload_progress=1 Unpatched
(Scheduled for next routine bugfix release; mitigate via config)

4. How to Audit & Mitigate CVE-2026-115560 Immediately

Because CVE-2026-115560 does not yet have an upstream binary patch, you should perform a quick two-step codebase audit and enforce the official configuration workaround across all PHP hosts.

Step 1: Audit Your Codebase for Runtime Serializer Overrides

Run the following command across your application repositories and container images to verify whether any script or third-party library mutates session.serialize_handler at runtime:

# Search for runtime ini_set() calls or .htaccess / .user.ini overrides
grep -rnE "session\.serialize_handler" /var/www/ /srv/app/

If you find code calling ini_set('session.serialize_handler', 'php'), refactor the application so that session.serialize_handler is set consistently in php.ini (preferably to php_serialize everywhere) rather than switching handlers mid-request.

Step 2: Apply the Official PHP Workaround (session.upload_progress.enabled = 0)

Unlike CVE-2026-109618—where disabling upload progress was only a partial mitigation—setting session.upload_progress.enabled = 0 completely neutralizes CVE-2026-115560 because it prevents php_session_rfc1867_callback() from initializing a session during the RINIT phase.

If you already followed our defense-in-depth hardening guide for PHP2Shell, your servers are already protected! To ensure no .user.ini or .htaccess file can re-enable it, lock the setting in both php.ini and your PHP-FPM pool configuration:

; 1. In php.ini
session.upload_progress.enabled = 0

; 2. In /etc/php/8.x/fpm/pool.d/www.conf (locks setting against .user.ini overrides)
php_admin_flag[session.upload_progress.enabled] = off

Remember to reload your PHP-FPM daemon or Apache service after applying the change:

sudo systemctl reload php8.4-fpm   # Adjust for 8.2 / 8.3 / 8.4 / 8.5

Step 3: WAF & Verification with php2shell-test

You can verify whether your edge WAF and PHP configuration block unsolicited PHP_SESSION_UPLOAD_PROGRESS payloads and pipe-delimited serialized objects using our open-source purple-team harness, php2shell-test (git.colibrisec.org/ColibriSec/php2shell-test):

  • ModSecurity Rule 950018 in detection/modsecurity_php.conf blocks any request body carrying PHP_SESSION_UPLOAD_PROGRESS.
  • ModSecurity Rule 950019 blocks serialized PHP object payloads (O:<n>:"...") in request parameters and multipart bodies.
  • Sigma Rule c7b9bd60-4dc7-57b8-9b23-f5ca1bb58246 alerts your SIEM whenever PHP_SESSION_UPLOAD_PROGRESS appears in web server POST telemetry.
# Verify that your staging host rejects session.upload_progress and deserialization probes
python3 runner/php_rce_test.py --base https://staging.example.com --allow-write
./detection/hunt.sh <token> /var/www/html /tmp

Summary

While CVE-2026-115560 has a much narrower blast radius than the emergency PHP2Shell vulnerabilities patched earlier this week, it highlights why PHP's automatic RINIT-stage session.upload_progress hook has become such a fertile target for security researchers. Unless your application actively relies on native PHP upload progress bars, disabling session.upload_progress.enabled = 0 permanently via php_admin_flag eliminates an entire class of pre-script session state vulnerabilities—both past and future.

Read more