deniz.in

Markets

Weather

Loading weather

· via dev.to (home feed)

PHP patches session serialization flaw across all branches, turns off session upload progress

PHP 8.2.36, 8.3.37, 8.4.28, 8.5.13 and 8.6.0 fix CVE-2026-115560, where mismatched session serializers let an attacker plant a pipe in a session key and reach code execution.

PHP patches session serialization flaw across all branches, turns off session upload progress

A critical batch across every supported branch

On 19 November 2026 the PHP project published 8.2.36, 8.3.37, 8.4.28, 8.5.13 and the 8.6.0 major release, one day after maintainers signalled a critical batch was coming without saying what it contained. The Hacker News, as cited by a dev.to writeup, counts seven critical flaws in the set, each scored 9.2. The one with the widest footprint for self-hosted deployments is CVE-2026-115560, which lives not in any single application but in how two applications on one server can interpret the same session file differently.

One session store, three formats

PHP saves each visitor's session to a file, and the on-disk format follows the session.serialize_handler setting. Three handlers ship in the core, and they disagree about one character: the pipe. According to the dev.to writeup, which draws on a ZEST Security report published the same day, the default php handler emits key, separator and value, and refuses keys that contain a pipe. php_binary prefixes each key with a length byte and stores a pipe-bearing key verbatim up to 127 bytes, while php_serialize wraps the entire session as one serialized array with no such cap.

Each format is internally consistent. The defect shows up when a file written under one rule set is opened under another: the default reader takes the first pipe as the boundary, treats what precedes it as the key, and hands what follows to the unserializer. An attacker who controls the key therefore controls a serialized payload.

The write half needs no application cooperation

Session upload progress is the delivery route. Enabled by default since PHP 5.4, it copies whatever a client supplies in a PHP_SESSION_UPLOAD_PROGRESS form field into $_SESSION while PHP is still parsing the multipart body, ahead of any application logic. The targeted page does not need to handle uploads or call session_start(); per the writeup, any .php endpoint that accepts a POST and carries a session identifier will do. ZEST Security demonstrated code execution using a stock Guzzle class, and the advisory names Monolog 2.11.1 as a second chain — in both cases the libraries were merely present on the reading application's class path, with destructor methods executing when the request shuts down.

The reading half is already common in the wild. ZEST traced Moodle, which forces the default handler in its session manager; Roundcube, which always asks for the default handler from rcube_session.php; and SMF, which prefers php_serialize but settles for php when that handler is missing. None of them misbehaves in isolation. The risk materialises only when another application sharing the host writes sessions under a different handler — a choice that usually lives in a php.ini, an FPM pool or a hosting-panel template, made long before whoever installed the application arrived.

ZEST reproduced working attacks in several shapes: nginx with two FPM pools pointing at one save path, Apache mod_php with per-directory handler settings on a shared server-wide path, the built-in development server, and shared hosting, where a session file written by a legacy application let the researchers plant a webshell in a neighbouring WordPress-style app and rewrite its wp-config.php. The earlier PHP2Shell fix from October does not help here — its guard applies only inside the writing request — and ZEST reproduced code execution on 8.2.35, 8.3.36, 8.4.27 and 8.5.12, the releases that carried it. The upload-progress cleanup option is no defence either: ZEST reproduced the race that lets a read land mid-upload on three of three runs under Apache mod_php, and PHP's own advisory warns against relying on it.

What the new releases change

Two fixes landed. Session upload progress now ships off by default, eliminating the write capability that needed no authentication on hosts that never opted in. PHP also now rejects runtime changes to session settings, including session.serialize_handler, while upload progress is enabled, shutting the ini_set() route the project first described.

There is a catch, and it is why the patch alone is not the whole job: any php.ini, FPM pool or vhost that explicitly sets session.upload_progress.enabled = On still overrides both measures. Hosts that deliberately enable the feature — or inherited a template that does — and still mix handlers across applications remain exposed.

The operator checklist

The writeup frames remediation as a three-part sweep. Find every explicit upload-progress setting across php.ini files, pools and vhosts. Give each application its own session store, or otherwise guarantee a single serialization handler per store. Then move to a fixed build and restart the workers so the new PHP binary is actually loaded.

Why it matters

CVE-2026-115560 earns its 9.2 score from deployment topology rather than from any application behaving badly. Moodle, Roundcube and SMF are all correct in isolation; the flaw lives in the gap between two applications that share a session directory under different settings — a gap that shared hosts and multi-app self-hosted servers routinely have. The write capability needs nothing beyond a session cookie and a POSTable URL, and neither the October fix nor the cleanup setting stops it. The new default-off setting only protects hosts where nobody switched the feature on, which is exactly why the configuration sweep matters as much as the upgrade itself.

  • #php
  • #security
  • #vulnerability
  • #self-hosting
  • #patch-management

Related posts