All ArticlesSecurity2026-11-19T23:45:00+08:00

PHP CVE-2026-115560 (GHSA-658j-r8rw-q6mx): Session Serializer Mismatch RCE, Temporary Workarounds, and Why It Is Separate from CVE-2026-109619

A deep dive into PHP CVE-2026-115560 (GHSA-658j-r8rw-q6mx), a critical session serializer mismatch vulnerability patched on 19 November 2026. Covers how the RFC 1867 upload-progress race triggers PHP object injection, why patching for PHP2Shell (CVE-2026-109619) does not protect against it, how to apply session.upload_progress.enabled = 0 correctly across cPanel, CloudLinux, and PHP-FPM, and which PHP versions contain the fix.

On 19 November 2026, the PHP project released its regular security update addressing 7 critical vulnerabilities across all supported branches. At the center of that release is CVE-2026-115560 (GHSA-658j-r8rw-q6mx), a CVSS 4.0 9.2 (Critical) vulnerability categorized under CWE-20 (Improper Input Validation) where a mismatch in session.serialize_handler combined with PHP's default session.upload_progress mechanism can lead to unauthenticated PHP object injection and Remote Code Execution (RCE).

Because this flaw was first disclosed on 23 October 2026—just two days after the emergency PHP2Shell (CVE-2026-109618 and CVE-2026-109619) patches—and shares the exact same interim mitigation (session.upload_progress.enabled = 0), many operators assumed their October emergency patching already closed it. It did not.


1. Separate From CVE-2026-109619 (PHP2Shell): Why October Patches Do Not Cover This

In our previous articles on analyzing PHP2Shell upstream releases vs. vendor backports and CloudLinux backport verification, we covered CVE-2026-109618 and CVE-2026-109619, which were patched on 21 October 2026 in PHP 8.2.35, 8.3.36, 8.4.27, and 8.5.12.

Even though both CVE-2026-109619 and CVE-2026-115560 abuse PHP's session.upload_progress feature as an entry vector, they are completely distinct vulnerabilities with different root causes, exploitation requirements, and patch timelines:

AttributeCVE-2026-109619 (PHP2Shell)CVE-2026-115560 (GHSA-658j-r8rw-q6mx)
Advisory IDGHSA-6wmf-4rv5-p3rpGHSA-658j-r8rw-q6mx
Disclosure & Patch DatePatched 21 October 2026 (emergency release)Disclosed 23 October 2026; patched 19 November 2026
Vulnerability ClassUse-After-Free (UAF) / stale internal global state in PHP coreImproper Input Validation (CWE-20) / Session Serializer Mismatch
Attack MechanismReuses freed internal memory across requests on the same worker processInjects a pipe (|) delimiter via upload progress written in php_serialize/php_binary, then decoded by the php handler
Application Gadget Required?No — triggers memory corruption before app code runsYes — triggers PHP object injection; RCE depends on an exploitable gadget class (__destruct / __wakeup) in the app
Fixed Upstream Versions8.2.35, 8.3.36, 8.4.27, 8.5.128.2.36, 8.3.37, 8.4.28, 8.5.13, 8.6.0
Status on PHP 8.4.27 / 8.5.12PatchedStill Vulnerable

If your servers were updated to 8.2.35, 8.3.36, 8.4.27, or 8.5.12 for PHP2Shell in late October, those binaries are still vulnerable to CVE-2026-115560 unless you either applied the session.upload_progress.enabled = 0 workaround or upgraded to the 19 November 2026 release.


2. Technical Root Cause: How the Serializer Mismatch Triggers RCE

PHP supports multiple session serialization handlers, primarily:

  • php (default): Stores each session variable as key|serialized_value using the pipe character (|) as a delimiter.
  • php_serialize: Serializes the entire $_SESSION array as a single standard serialize() string, where | has no special delimiter meaning.
  • php_binary: Stores key length as a binary byte followed by the key and serialized value.

Preconditions for Exploitation

According to GHSA-658j-r8rw-q6mx and php-src analysis (ext/session/session.c and main/rfc1867.c), CVE-2026-115560 requires a specific combination of settings:

  1. Server-level serializer is php_serialize or php_binary in php.ini or FPM pool configuration.
  2. Runtime switch to php — the application calls ini_set('session.serialize_handler', 'php') before session_start() (or two separate FPM pools/endpoints share the same session storage directory while configured with mismatched serializers).
  3. session.upload_progress.enabled = 1 — which was enabled by default in PHP prior to the 19 November 2026 patch.
  4. An exploitable gadget chain exists in the application or its Composer dependencies to escalate object deserialization into arbitrary code execution, file modification, or session corruption.

Step-by-Step Exploit Flow

Attacker Producer Request (Multipart POST with file + PHP_SESSION_UPLOAD_PROGRESS="|O:...")
      │
      ▼
Request Startup (RFC 1867 parsing — BEFORE application PHP code runs)
      │  php_session_rfc1867_callback() -> MULTIPART_EVENT_FILE_START -> php_rinit_session(0)
      │  PS(serializer) reads server php.ini (php_serialize / php_binary)
      │  php_session_rfc1867_update() -> php_session_flush(1)
      ▼
Session File on Disk (written in php_serialize format with raw attacker key containing "|")
      │
      ├─────── Race Window (while upload is still in flight before cleanup) ───────┐
      ▼                                                                            ▼
Attacker Consumer Request (with matching PHPSESSID cookie)                Upload finishes ->
      │  App executes: ini_set('session.serialize_handler', 'php')        fileupload_done:
      │  OnUpdateSerializer repoints PS(serializer) to `php`              deletes progress key
      │  App calls: session_start()
      ▼
PS_SERIALIZER_DECODE_FUNC(php) splits at the injected "|" delimiter
      │  Unserializes attacker object -> PHP_VAR_UNSERIALIZE_DESTROY(var_hash)
      ▼
Injected object's __destruct() fires -> Gadget Chain -> RCE

Three subtle implementation details make this bug particularly tricky to spot in production:

  • No session cookie needed on the producer request: The RFC 1867 MULTIPART_EVENT_FORMDATA handler accepts PHPSESSID directly from the multipart POST body without checking session.use_only_cookies. Only the concurrent consumer request needs the cookie.
  • Cleanup does not prevent exploitation: With PHP's default session.upload_progress.cleanup = 1, fileupload_done: in main/rfc1867.c deletes the progress key once the upload completes (even if the client aborts). Attackers bypass this by sending a large upload payload or throttling the upload stream to hold the session file open while firing concurrent consumer requests.
  • Exploitation succeeds even when session decoding fails: When the php handler parses the injected |O:... payload, trailing bytes from the php_serialize wrapper cause the overall decode to return FAILURE, often logging: PHP Warning: session_start(): Failed to decode session object. Session has been destroyed However, PHP_VAR_UNSERIALIZE_DESTROY(var_hash) runs on both the success and failure paths, so the deserialized gadget's __destruct() method has already executed by the time that warning appears in your error log.
  • FPM pool isolation is not enough if storage is shared: Separate PHP-FPM pools do not isolate this bug if both pools read and write to the same session.save_path (such as /var/lib/php/session or a shared Redis instance) with different session.serialize_handler configurations.

3. Affected and Patched PHP Versions

PHP patched CVE-2026-115560 in the 19 November 2026 security release. The upstream fix both disables session upload progress by default and rejects unsafe runtime changes to session.serialize_handler.

PHP BranchVulnerable VersionsFixed Upstream VersionSupport Status
PHP 8.6Pre-release builds8.6.0Current
PHP 8.5< 8.5.13 (including 8.5.12)8.5.13Active Support
PHP 8.4< 8.4.28 (including 8.4.27)8.4.28Active Support
PHP 8.3< 8.3.37 (including 8.3.36)8.3.37Security Support
PHP 8.2< 8.2.36 (including 8.2.35)8.2.36Security Support (EOL 31 Dec 2026)
PHP 8.1 and olderAll unpatched buildsNo upstream fixEnd of Life (requires vendor ELS backport or upgrade)

As with PHP2Shell, if you run vendor-managed packages (CloudLinux alt-php, cPanel ea-php, Debian/Ubuntu APT, or RHEL/AlmaLinux RPMs), always verify backported fixes via package changelogs (rpm -q --changelog or zgrep on changelog.Debian.gz) rather than trusting php -v alone.


4. Temporary Workaround: Applying session.upload_progress.enabled = 0 Correctly

If you cannot roll out the 19 November 2026 PHP packages immediately—for example, while waiting for CloudLinux or EasyApache 4 mirror propagation or completing staging checks—the official mitigation from PHP and CERT-EU is to disable session upload progress at the server level:

session.upload_progress.enabled = 0

Critical Caveat: Never Use ini_set() for This Workaround

Setting ini_set('session.upload_progress.enabled', '0') inside your PHP application does nothing to mitigate CVE-2026-115560. The RFC 1867 upload-progress handler executes during request startup before your PHP script ever begins running. The directive has PHP_INI_SYSTEM / PHP_INI_PERDIR timing requirements for upload parsing and must be set in php.ini, a conf.d drop-in, or the PHP-FPM pool config—followed by a full worker restart.

Applying the Workaround by Environment

1. Standard Linux / PHP-FPM (AlmaLinux, RHEL, Ubuntu, Debian)

Drop an override file into the active php.d or conf.d directory for every installed PHP version:

# RHEL / AlmaLinux / Rocky (native or Remi)
echo "session.upload_progress.enabled = 0" | sudo tee /etc/php.d/99-cve-2026-115560.ini
sudo systemctl restart 'php*-fpm'

# Ubuntu / Debian (repeat for each version under /etc/php/)
for dir in /etc/php/*/fpm/conf.d /etc/php/*/apache2/conf.d; do
  [ -d "$dir" ] && echo "session.upload_progress.enabled = 0" | sudo tee "$dir/99-cve-2026-115560.ini"
done
sudo systemctl restart 'php*-fpm'

2. cPanel / WHM (EasyApache 4 ea-php)

Apply the drop-in across every installed ea-php branch and restart both Apache and PHP-FPM:

for ini_dir in /opt/cpanel/ea-php*/root/etc/php.d; do
  [ -d "$ini_dir" ] && echo "session.upload_progress.enabled = 0" > "$ini_dir/99-cve-2026-115560.ini"
done

/scripts/restartsrv_apache_php_fpm
/scripts/restartsrv_httpd

3. CloudLinux PHP Selector (alt-php)

Add the directive to the global selector configuration so it propagates to every CageFS user and alt-php version:

; /etc/cl.selector/global_php.ini
session.upload_progress.enabled = Off

Then rebuild the CageFS selector configuration:

cagefsctl --setup-cl-selector

4. LiteSpeed Web Server (Detached lsphp)

On LiteSpeed 5.3+, restarting lsws does not reload detached PHP workers. Force a clean worker reload after updating the .ini files:

# Immediate worker restart
pkill lsphp

# Or graceful reload on next request
touch /usr/local/lsws/admin/tmp/.lsphp_restart.txt

Verify the Workaround and Audit Your Codebase

Confirm the runtime configuration is active (check both CLI and the web SAPI via a temporary check or php-fpm -tt):

php -i | grep -E "session\.(upload_progress\.enabled|serialize_handler)"

Expected output:

session.serialize_handler => php => php
session.upload_progress.enabled => Off => Off

You should also audit hosted applications for runtime serializer switching so you know which sites had direct exposure:

grep -rn "session\.serialize_handler" /home/*/public_html /var/www/ 2>/dev/null

5. Why You Still Need to Patch Beyond the Workaround

Disabling session.upload_progress.enabled = 0 completely neutralizes CVE-2026-115560, and breaking session-based upload progress bars is an acceptable trade-off for almost all modern applications (which use JavaScript XMLHttpRequest / Fetch upload progress events instead).

However, do not treat this workaround as a substitute for upgrading to PHP 8.2.36, 8.3.37, 8.4.28, 8.5.13, or 8.6.0. The same 19 November 2026 security release patches six other critical (CVSS 9.2) vulnerabilities, including:

  • CVE-2026-126714 — A TOCTOU flaw in default file-based session storage where partially overwritten session files can lead to RCE.
  • CVE-2026-129182, CVE-2026-129474, CVE-2026-129481, and CVE-2026-129496 — Multiple Use-After-Free (UAF) memory corruption flaws in PHP core and session cleanup that can crash reused workers or allow unauthenticated RCE.

Use session.upload_progress.enabled = 0 as your immediate 5-minute shield today, then schedule the full package upgrade and PHP worker restart across every ea-php, alt-php, and native PHP binary on your fleet.