PHP 8.5.13 Closes a Session Store Two Applications Can Read Two Ways

"PHP shipped 8.2.36, 8.3.37, 8.4.28, 8.5.13 and 8.6.0 on 19 November 2026. CVE-2026-115560 turns a session file written by one serializer and read by another into remote code execution, and

"Netics card on the PHP session-store mismatch fixed in 8.2.36, 8.3.37, 8.4.28, 8.5.13 and 8.6.0."
"Netics editorial visual on the session-format mismatch behind CVE-2026-115560."

TL;DR

  • PHP is a scripting language that runs websites and the self-hosted applications behind them, and it keeps each visitor's session in a file on the server, written in whichever format the server's configuration names.
  • On 19 November 2026 the project released 8.2.36, 8.3.37, 8.4.28, 8.5.13 and 8.6.0, a batch the maintainers had announced on 18 November as critical. The Hacker News reported seven critical flaws, each scored 9.2.
  • Three writers ship in the core: the default handler refuses a key that contains a pipe, while php_binary and php_serialize store that pipe verbatim, so one session file can be written under one set of rules and read under another.
  • The attacker picks the key through a form field: session upload progress copies PHP_SESSION_UPLOAD_PROGRESS into $_SESSION while PHP parses the request body, before application code runs, so any .php URL that accepts a POST can write the pipe.
  • The reader half already sits in Moodle, Roundcube and SMF, which force or fall back to the default handler on every session start, and each of them reads whatever another application on the same host wrote.
  • ZEST Security, which found it, reproduced code execution on the four October releases that already carried the earlier PHP2Shell fix, on nginx with two FPM pools, on Apache mod_php with per-directory settings and on the built-in server.
  • The release turns session upload progress off by default and rejects runtime changes to session settings while it is enabled, and an explicit session.upload_progress.enabled = On in a php.ini, a pool or a vhost still overrides both.
  • The operator work is a sweep: find those explicit settings, separate the session stores, and move to a fixed build with a worker restart that actually loads it.
Netics table of the three PHP session serializers and how each one treats a key containing a pipe
Netics visual, 20 November 2026: the three core serializers side by side, with the column that decides whether attacker bytes survive the write.

The PHP project published five releases on 19 November 2026 — 8.2.36, 8.3.37, 8.4.28, 8.5.13 and the major 8.6.0 — after an advance notice the day before that named no flaw and promised a critical batch. The Hacker News summary identifies seven critical flaws, each scored 9.2. CVE-2026-115560 is the one worth reading slowly, because its severity comes from how a deployment is assembled and its remediation leaves a piece of configuration standing.

Three writers, three sets of rules for one key

PHP stores sessions through a pluggable serializer chosen by session.serialize_handler, and three ship in the core. The default php handler writes a key, then a pipe, then the serialized value, and it refuses to write when the key itself contains a pipe. php_binary writes a length byte, then the raw key, then the value, and it stores a pipe-bearing key verbatim up to a 127-byte limit. php_serialize writes the whole session as a serialized array and stores the same key with no length cap.

ZEST diagram of one session record read two ways, zestsecurity.io/resources/content/php2shell-the-third-one-cve-2026-115560
One session record as the writer and the reader each see it. Source: zestsecurity.io/resources/content/php2shell-the-third-one-cve-2026-115560, retrieved 20 November 2026.

Each set of rules holds on its own. The defect appears at the seam, when a file written under one set is read under another, and ZEST Security's 19 November 2026 report walks that seam line by line. The default reader scans for the first pipe, calls everything before it the session key, and passes everything after it to php_var_unserialize().

The attacker picks the key

Session upload progress gives a client that control. The feature has been on by default since PHP 5.4 in 2012, and it builds a $_SESSION array whose key is a fixed prefix plus whatever the client sent in a form field named PHP_SESSION_UPLOAD_PROGRESS. That concatenation happens while PHP parses the multipart body, before a line of application code runs, so the page does not need to handle uploads and does not need to call session_start(). Any .php URL that accepts a POST will do, provided the request carries a session identifier.

PHP.net news archive for 2026 listing 8.6.0, 8.5.13, 8.4.28, 8.3.37 and 8.2.36, php.net/archive/2026.php
The release entries as the project published them, with 8.6.0 and the four security releases on the same day. Source: php.net/archive/2026.php, captured 20 November 2026.

Put a pipe in that field on a server configured with php_binary, and the pipe lands in the session file. Open the same file later with the default handler and the reader splits at the attacker's pipe, then hands a serialized object to the unserializer. The rest of the record fails to parse, the objects already built stay alive, and their destructors run at shutdown. ZEST reached code execution with a stock Guzzle class the reading application already had on its class path, and the advisory names Monolog 2.11.1 as a second chain. ZEST states that both libraries were simply present on the reader's class path.

Where the reader half already sits

The reading side is the common case, and it is already deployed. ZEST traced three applications that pin the default handler on every session start: Moodle forces it in its session manager, Roundcube does the same unconditionally in rcube_session.php, and SMF asks for php_serialize and falls back to php when it cannot have it.

ZEST describes all three as reader halves. Each becomes reachable when the host it runs on writes sessions in a different format, which is a decision taken in a php.ini, an FPM pool file or a hosting panel template, often years away from whoever installed the application.

Netics checklist for finding the upload-progress setting across php.ini, FPM pools and vhosts
Netics visual, 20 November 2026: the five steps that take a running host from unknown session topology to a fixed build serving requests.

The three deployment shapes the lab reproduced

The narrow shape PHP first described in October, an application that sets php_binary and then switches the handler at runtime, is the least common of the ones that work. ZEST reproduced three more with no runtime switch anywhere.

  • nginx with two FPM pools. Pool A writes with php_binary, pool B reads with php, and both point at one session.save_path, because separate pools do not get separate session directories unless somebody configures them.
  • Apache mod_php with per-directory settings. A override sets the writer's handler, the neighbouring directory runs the default, and both share the server-wide save path.
  • Shared hosting. One legacy application on the account writes, a WordPress-style application on the same account and uid reads, and the second application is the one that ends up owned. ZEST describes dropping a webshell into the neighbouring application and overwriting its wp-config.php through a session file neither application's code ever touched.
Shodan facet of PHP 8.5.12 hosts, zestsecurity.io/resources/content/php2shell-the-third-one-cve-2026-115560
Hosts advertising PHP 8.5.12 on 19 November 2026, from the Shodan facet analysis reproduced in the ZEST report. Source: zestsecurity.io/resources/content/php2shell-the-third-one-cve-2026-115560, retrieved 20 November 2026.

Cleanup does not close it either. session.upload_progress.cleanup=1 removes the progress key when the upload finishes, which a concurrent read during a slow upload does not wait for, and the report reproduces that on three of three runs under Apache mod_php. PHP's own advisory makes the same point: "Do not rely on upload-progress cleanup to prevent a concurrent read."

The October fix for the earlier PHP2Shell flaw added a guard that marks objects as incomplete while the upload request re-encodes the session. That guard holds inside the writing request and leaves the bytes already on disk alone, which is why ZEST reproduced code execution on 8.2.35, 8.3.36, 8.4.27 and 8.5.12 — the releases that carried it.

What the 19 November release changes

Two things change for this flaw. Session upload progress now ships off by default, which removes the unauthenticated write primitive for a host that never turned it on. And PHP now rejects runtime changes to session settings, including session.serialize_handler, while upload progress is enabled, which closes the ini_set() shape PHP originally described.

The rest of the batch sits alongside it. The advisory summary from The Hacker News on 19 November records seven critical flaws at CVSS 9.2, including a use-after-free fixed in 8.5.13 and 8.6.0 and an HTTP request-interpretation flaw that requires a front end with persistent backend connections. The same summary attributes the name phpAfterShell to CVE-2026-126714, a separate session-file TOCTOU flaw. PHP 8.1 and older receive none of these fixes.

Netics warning card on explicit upload-progress settings that override the new default
Netics visual, 20 November 2026: the setting that survives the upgrade, and the reason the sweep belongs in the same change window.

A detection sweep for a running host

An explicit setting outranks the new default, so the first job is finding it. session.upload_progress.enabled = On written into a php.ini, an FPM pool directive or a vhost hands the feature back, and the fix does not stop two separately configured applications from disagreeing about the format.

The second job is separating the stores. One session.save_path per pool costs a directory and an ini line, and it removes the shared file that makes two applications into a writer and a reader pair. The third is the upgrade itself: 8.2.36, 8.3.37, 8.4.28, 8.5.13 or 8.6.0, followed by a worker restart, because a package upgrade alone leaves the running workers on the old binary. The OpenJDK Base64 decoder flaw is covered separately. The security audit and hardening checklist for a host of this age starts from the same inventory.

ZEST report page on CVE-2026-115560, zestsecurity.io/resources/content/php2shell-the-third-one-cve-2026-115560
The ZEST report as published on 19 November 2026, with its summary of the fix and the sweep. Source: zestsecurity.io/resources/content/php2shell-the-third-one-cve-2026-115560, captured 20 November 2026.

What the advisory leaves to the operator

No in-the-wild exploitation had been reported when ZEST published, and the team is holding its exploit code. The exposure estimate is still large: the Shodan facet analysis reproduced in the report counted about 94,000 hosts advertising PHP 8.5.12, one build behind the 8.5.13 that carries this fix.

Two questions stay open on any particular estate. The first is which hosts carry more than one PHP configuration, which the sweep answers. The second is which of those configurations an operator actually chose, because a shared host that never sets the handler is a different risk from one where somebody pinned the writer format for an old application. PHP's final advisory, quoted in the report, states the position for the reading application plainly: "An application that never changes its serializer at runtime can still be affected if another application or process writes incompatible data into the same session store."

The patch answers the flaw. The topology answers how much of the estate was ever reachable, and the sweep is the part an operator still owns.

Sources

Source: "PHP2Shell, the third one: how ZEST found CVE-2026-115560" — zestsecurity.io, 2026-11-19, https://www.zestsecurity.io/resources/content/php2shell-the-third-one-cve-2026-115560, with The Hacker News advisory summary at https://thehackernews.com/2026/11/php-fixes-7-critical-flaws-including.html and the php.net news archive at https://www.php.net/archive/2026.php; all fetched and saved on 2026-11-20 under sources/2026-11-20/php-session-upload-progress-cve-2026-115560/.