Tech15 min read

PHP 8.5.13 Fixes 7 Critical CVEs Including FPM Request Smuggling and Session RCE

IkesanContents

TL;DR

What happened November 19, 2026 around 23:00 JST (14:00 UTC): PHP released 8.5.13, 8.4.28, 8.3.37, and 8.2.36 alongside the PHP 8.6.0 stable release. Out of 17 GitHub Security Advisories, 7 are rated Critical (9.2 on the 10-point CVSS v4.0 scale).

Who is affected Supported branches 8.2 through 8.5. Two of the 7 Critical CVEs affect only PHP 8.5, and one affects only 8.3 and later. PHP states all Critical issues require non-default settings or uncommon configurations.

What to check first Servers reusing PHP-FPM connections via nginx fastcgi_keep_conn on or Apache enablereuse=on. Under CVE-2026-129289, a single unauthenticated request can achieve remote code execution (RCE).

What to do

  1. Update each PHP 8.2–8.5 branch to its fixed release (or 8.6.0).
  2. Restart the PHP-FPM master process or Apache (mod_proxy_fcgi / mod_php) so no old workers remain.
  3. If you cannot patch right away, disable FastCGI connection reuse and apply the per-CVE configuration workarounds below.

What changed after updating Fixing CVE-2026-115560 (first announced in October) disables session.upload_progress.enabled by default.


PHP posted an advance notice titled “Upcoming Critical PHP Security Release” on November 18, 2026 (PHP announcement), and shipped the regular security releases (8.5.13, 8.4.28, 8.3.37, and 8.2.36) alongside the new major PHP 8.6.0 release on November 19 around 23:00 JST (PHP 8.5.13 announcement).
The php-src repository published 17 security advisories together (php-src Security Advisories): 7 Critical, 4 High, and 6 Medium.

Whereas the October 21 php2shell flaws (CVE-2026-109618 and CVE-2026-109619) affected almost every PHP environment handling web requests (php2shell Needs the PHP Patch, Not Just session.upload_progress=0), all 7 Critical flaws in this batch require specific non-default settings or uncommon setups.

All 7 Critical CVEs

Every one of the 7 flaws carries a CVSS v4.0 base score of 9.2 (out of 10), rated network-accessible (AV:N) with no authentication required (PR:N).
All 7 also require specific attack conditions (AT:P), splitting into 3 with low attack complexity (AC:L) and 4 with high attack complexity (AC:H).

CVEComponentBranches (Complexity)Trigger conditionWorkaround until patched
CVE-2026-129289PHP-FPM (some LSAPI)8.2–8.5 (AC:L)FastCGI connection reuse + php://input not read to endDisable connection reuse on frontend
CVE-2026-115560Session8.2–8.5 (AC:H)Upload progress on + mixed serializers on same sessionsession.upload_progress.enabled=0
CVE-2026-126714Session (files)8.2–8.5 (AC:H)Mid-write abort leaves trailing old bytes in session fileDisable upload progress; cut external input
CVE-2026-129481Session8.3–8.5 (AC:H)Fatal error inside callback during session shutdownpm.max_requests=1 on PHP-FPM
CVE-2026-129496Date (TZ cache)8.2–8.5 (AC:H)Startup warning to file error_log + warning on 1st requestFix startup warning and restart
CVE-2026-129474Engine (backtrace)8.5 only (AC:L)Fatal error entering magic method such as __call()zend.exception_ignore_args=1 etc.
CVE-2026-129182Engine (backtrace)8.5 only (AC:L)Shutdown fatal error leaves freed backtrace for next requestfatal_error_backtraces=0

FastCGI connection reuse request smuggling (CVE-2026-129289)

nginx and Apache forward requests to PHP-FPM (the persistent process manager that runs PHP behind a web server) over FastCGI. Normally the frontend closes the connection after each request, but if it is configured to reuse persistent connections across requests, this low-complexity flaw (AC:L) applies even with default PHP settings.

When connections are reused, PHP must read or discard any remaining request body before accepting the next FastCGI request.
php://input (the stream for reading raw request bodies) opens lazily without reading data until the app actually reads from it. However, once an app opened php://input, PHP treated the body as already handled and skipped draining unread bytes. If the script finished without reading php://input to the end (EOF), leftover body bytes stayed on the socket.

An attacker can send a malformed multipart (file upload) body designed to halt parsing at a predictable offset, appending a forged FastCGI record right after it.
Because the forged request never passed through the frontend web server, it slips past routing and authentication checks, a technique known as request smuggling.

flowchart TD
    A["1. Web server reuses FastCGI connection to send<br/>malformed multipart body + forged FastCGI bytes to PHP-FPM"] --> B["2. PHP stops multipart parsing mid-body and<br/>app opens php://input without reading to EOF"]
    B --> C["3. Opening php://input skips body draining, so<br/>leftover socket bytes become the next FastCGI request"]
    C --> D["4. Forged FastCGI request overrides SCRIPT_FILENAME<br/>and PHP_ADMIN_VALUE (e.g. allow_url_include=1)"]
    D --> E["5. auto_prepend_file=php://input<br/>executes body as PHP code before script"]

In that forged FastCGI request, the attacker can set SCRIPT_FILENAME, REMOTE_ADDR, and FastCGI-specific admin INI overrides via PHP_ADMIN_VALUE. According to the advisory, knowing the path to any existing PHP script lets an attacker set allow_url_include=1 (allowing external streams in PHP includes) and auto_prepend_file=php://input (loading php://input before the target script runs) via PHP_ADMIN_VALUE, executing the body as PHP code.
Modified admin settings can also persist for subsequent requests handled by the same worker, and the attack requires no memory corruption, address leaks, or race conditions.
Frameworks that open php://input to build an input stream before routing or authentication can expose endpoints that never touch the request body.

Frontend configurations that trigger it

The advisory lists four frontend servers; default reuse status is not documented in the advisory for HAProxy or LiteSpeed.

FrontendVulnerable settingDefault state
nginxfastcgi_keep_conn on;off (closes connection per request)
Apache (mod_proxy_fcgi)enablereuse=on on ProxyPass, etc.Disabled
HAProxyConfig keeping FastCGI backend connections openNot stated in advisory
LiteSpeed (LSAPI)Persistent connection reuseNot stated in advisory

LiteSpeed’s LSAPI shares the underlying body-draining bug. Because LSAPI has no PHP_ADMIN_VALUE equivalent, code execution has not been confirmed there, and the observed impact is request desynchronization from leftover body data.

Until you can patch PHP, turn off FastCGI connection reuse on the frontend. For nginx, dump the full config with nginx -T, remove fastcgi_keep_conn on;, and reload. For Apache (mod_proxy_fcgi), search your config directories for enablereuse, remove enablereuse=on, and restart or reload Apache.

# nginx
sudo nginx -T 2>/dev/null | grep -n fastcgi_keep_conn

# Apache
sudo grep -rn enablereuse /etc/httpd /etc/apache2 2>/dev/null

The advisory also notes not exposing PHP-FPM or LSAPI listening ports to untrusted networks. Even if an app attempts to read php://input to EOF on every request, errors, resource limits, or early exits can still leave unread bytes, so app-level draining should not be relied on alone.

Three session extension flaws

Three of the Critical CVEs are in ext-session: two deserialization bugs requiring a gadget chain for RCE (CVE-2026-115560 and CVE-2026-126714) and one shutdown use-after-free (CVE-2026-129481).
PHP serializes per-user session data into strings for storage and deserializes it back on the next request. If an attacker injects crafted serialized objects, deserializing them can chain existing classes in the app or its dependencies to execute commands (a gadget chain). Both CVE-2026-115560 and CVE-2026-126714 require an exploitable gadget chain in the application for code execution.

Upload progress and mismatched serializers (CVE-2026-115560)

PHP first disclosed CVE-2026-115560’s conditions and workaround on October 23 (PHP CVE-2026-115560 only hits apps that switch serialize_handler to php at runtime), and this release adds the full advisory and patch. While the October notice only mentioned apps switching session.serialize_handler from php_binary or php_serialize back to php via ini_set() at runtime, the full advisory extends this to separate apps, FPM pools, virtual hosts, or CLI jobs that share the same session storage using different static session.serialize_handler settings. With files storage, this happens whenever both sides share the same directory, session ID, and read/write permissions.

Splitting FPM pools alone does not separate session storage paths.

The root trigger is session.upload_progress, which writes upload progress (including user-supplied form keys) into the session during file uploads.
session.serialize_handler supports php, php_binary, and php_serialize, each using different key/value delimiters. When upload progress is written using php_binary or php_serialize and later read with the php handler, attacker-supplied delimiter characters can cause part of the key to be interpreted as a serialized object.

Reports confirmed command execution on 8.2.35, 8.3.36, 8.4.27, and 8.5.12 using a gadget in the HTTP client library Guzzle, as well as with a gadget in the logging library Monolog 2.11.1 under php_serialize write / php read. Any exploitable class chain in the app or dependencies can work the same way.

Because blocking runtime ini_set() changes cannot stop separate configs from sharing one session store, the fix disables session.upload_progress.enabled by default and blocks runtime changes to session settings (including session.serialize_handler) while upload progress is enabled.
However, explicitly enabling session.upload_progress.enabled in php.ini overrides the new default, and the patch still does not verify handler consistency across separate configs. Every app or pool reading and writing the same session data must use the same session.serialize_handler.

Truncation omission on session file overwrites (CVE-2026-126714)

Record-replacing backends such as databases are unaffected, but with the default files handler, PHP overwrote existing session files in place without truncating them to zero bytes first. If writing aborted partway through, the beginning of the new data concatenated with the tail of the old data, potentially turning plain bytes from the old session into a valid serialized object on the next session_start().

The advisory notes two ways an attacker can shape session contents: upload progress and applications storing long user-supplied strings in the session. On ZTS (thread-safe) builds, an out-of-memory error in another thread can kill the process mid-write, letting an attacker influence where the write stops.

The fix truncates the file to zero length before writing and aborts the write if truncation fails. Aborted writes can still lose session data, but trailing old bytes can no longer remain.
Until patched, disable upload progress in php.ini if unused and reduce attacker-controlled data stored in sessions, keeping in mind that disabling upload progress does not close paths where the app itself writes user input into the session.

Shutdown use-after-free missed in php2shell (CVE-2026-129481)

CVE-2026-129481 was missed in October’s php2shell fix for CVE-2026-109619 (the shutdown cleanup path) and affects only PHP 8.3 and later because PHP 8.2 lacks the internal filename field involved.
When a session starts, PHP stores the current script’s filename in an internal variable. During shutdown, PHP destroys session variables before clearing that filename record; if a user callback such as a custom stream wrapper’s stream_close() triggers a fatal error during variable destruction, request memory is freed while the stale filename pointer remains.

When the same worker handles a subsequent request, it accesses the freed filename (use-after-free), and attacker-controlled data landing in that memory can trigger misbehavior. The two requests only need to hit the same worker, not the same user or session.

The report confirmed use-after-free on PHP 8.4.27 and 8.5.12 under PHP-FPM with OPcache disabled. Code execution via this filename path has not yet been demonstrated.

Unlike the other two session CVEs, this issue has nothing to do with upload progress or FastCGI settings, so session.upload_progress.enabled=0 does not mitigate it.
Until patched, avoid fatal errors inside session shutdown callbacks or set pm.max_requests=1 on PHP-FPM so each worker exits after one request (at a performance cost from respawning workers). The fixed releases terminate the process if shutdown is interrupted.

Timezone cache and backtrace Critical CVEs

Startup error log timezone cache use-after-free (CVE-2026-129496)

This affects non-ZTS (non-thread-safe) builds where a startup warning is written to a file-based PHP error_log (PHP-FPM’s own error log does not trigger it).
When PHP writes a timestamped entry to error_log during startup, it allocates the timezone cache in temporary startup memory that gets freed at the end of startup, leaving a dangling reference. Under PHP-FPM and Apache mod_php, workers inherit this stale reference from the parent process until they finish their first request; if that first request triggers another warning (such as exceeding max_input_vars), PHP reads and writes the freed cache. The advisory cites an invalid date.timezone value and session configuration warnings/deprecations as example startup warnings.

A crafted HTTP request reportedly crashed an FPM worker under default max_input_vars and normal nginx header limits. Local command execution was also demonstrated on both FPM and mod_php assuming known memory addresses; OS ASLR (address space layout randomization) remained enabled, and remote ASLR bypass is described as possible but not demonstrated.

You can check for startup warnings in the log lines written right after PHP starts. As a workaround, fix the configuration causing startup warnings and restart the PHP master process and workers, or send error_log to syslog or another non-file target to avoid the demonstrated trigger.

PHP 8.5-only backtrace CVEs (CVE-2026-129474 and CVE-2026-129182)

PHP 8.5.0 introduced fatal_error_backtraces (enabled by default) to print backtraces on fatal errors. Both 8.5-only Critical flaws lie in this backtrace collection path; while the underlying bugs exist in PHP 8.2–8.4, no external trigger was found there.

CVE-2026-129474 requires zend.exception_ignore_args=0 (including arguments in backtraces). Shipping php.ini-production sets zend.exception_ignore_args=1, so unmodified production configs are not exposed, though PHP’s built-in default includes arguments.
The bug is a use-after-free while collecting arguments during entry into forwarding magic methods like __call() and __callStatic(), common in framework logger facades and database wrappers. The demonstrated exploit sends a JSON body sized to hit memory_limit while building log arguments; the advisory mentions Laravel facades and Magento shipping estimates as potentially reachable patterns without demonstrating a full compromise of either product.
Until patched, set zend.exception_ignore_args=1 or fatal_error_backtraces=0 in the config used by workers and restart; changing only CLI settings does not affect PHP-FPM.

CVE-2026-129182 reopens a backtrace use-after-free similar to php2shell (CVE-2026-109619) via another path: a fatal error while restoring modified INI settings at request end recreates a backtrace that should be freed.
The advisory gives two examples: setting max_memory_limit both server-wide and per-path, or conflicting zlib.output_compression and output_handler settings between server-wide and per-path scopes. A warning must then fire before the next request initializes (for example via Apache per-directory settings or a FastCGI frontend passing a warning-producing PHP_VALUE).
Only use-after-free and worker crashes have been confirmed, with no demonstrated code execution. As a workaround, set fatal_error_backtraces=0 and restart all workers.

The other 10 advisories

The same release cycle also patched 10 High and Medium advisories (some branch-specific). The ChangeLog additionally notes a CVE-numbered update for the bundled uriparser library (CVE-2026-48841) (PHP 8 ChangeLog).

CVESeverity (CVSS v4.0)Summary
CVE-2026-129291High 8.8PHP-FPM epoll (I/O event monitor) use-after-free leading to local privilege escalation (AV:L, PR:L)
CVE-2026-127960High 8.7Denial-of-service (DoS) via folded HTTP response headers
CVE-2026-128064High 8.2Mixed-case HTTPS/FTPS URLs may send data in cleartext
CVE-2026-128090High 7.7PHP Archive (PHAR) OpenSSL signature bypass via algorithm downgrade
CVE-2026-129538Medium 6.9Out-of-bounds read/write in PHP-CGI PATH_INFO handling
CVE-2026-129438Medium 6.3Incorrect RFC 3986 URI serialization on overly long input
CVE-2026-129501Medium 6.3Double free in DOM XML serialization
CVE-2026-129506Medium 6.3Use-after-free in SOAP Document Type Definition (DTD) entity reference handling
CVE-2026-15353Medium 6.3Information leak via invalid SOAP array dimensions
CVE-2026-129292Medium 5.3Cross-site scripting (XSS) on the PHP-FPM status page

Per the ChangeLog, branch coverage varies slightly: 8.4.28 omits CVE-2026-129438 (URI serialization), and 8.3.37 and 8.2.36 omit both CVE-2026-129438 and CVE-2026-129501 (DOM double free). Critical CVE-2026-129481 also applies only to 8.3 and newer, so it is not in 8.2.36.

Updating and checking your setup

Upgrade whichever branch you run (8.5 to 8.5.13, 8.4 to 8.4.28, 8.3 to 8.3.37, or 8.2 to 8.2.36), or move to 8.6.0. You can inspect your current version and effective settings with:

php -v
php -i | grep -E 'session.upload_progress.enabled|session.serialize_handler|fatal_error_backtraces|zend.exception_ignore_args'

Because php -i prints CLI configuration, it can differ from PHP-FPM or mod_php settings. Verify per-pool FPM settings and application overrides from the web side, such as a temporary phpinfo() page.
If you install PHP from Linux distribution packages, check your distro’s security tracker by CVE ID rather than relying on php -v alone, since backported fixes often keep the upstream point-release number unchanged.

After updating, restart the PHP-FPM master process or Apache (mod_php) so no old workers carrying stale state remain (relevant for CVE-2026-129496, CVE-2026-129182, and CVE-2026-129481).
Note that session.upload_progress.enabled now defaults to off after updating, so any UI reading upload progress from the session will stop working unless explicitly enabled. If you re-enable it, make sure every app and pool sharing that session storage uses the same session.serialize_handler.

The advisories cover PHP 8.2.0 and newer; the PHP project did not evaluate unsupported 8.1 and older branches. However, upload progress (CVE-2026-115560) dates back to PHP 5.4.0 and the lazy php://input behavior (CVE-2026-129289) to PHP 5.6.0, so older EOL branches may also be affected. Unlike October’s php2shell release, no minimal source patches for 8.1 and older were announced alongside this release.

Security support for PHP 8.2 ends on December 31, 2026.