PHP CVE-2026-129289 and six more critical flaws: an unread request body becomes a second FastCGI request
Between nginx and PHP-FPM sits a protocol that can carry several requests over the same connection, as long as both sides know exactly where one request ends. CVE-2026-129289 breaks that agreement. If part of the request body stays unread, PHP does not discard it, and on a reused connection the next pass reads the attacker's bytes as a FastCGI request of their own, with parameters of the attacker's choosing. The security release of November 19 closes this flaw together with six others rated critical, and almost all of them hit the same spot: state that survives a request although it should have vanished with it.
TL;DR — 90 seconds
- What: PHP 8.5.13, 8.4.28, 8.3.37 and 8.2.36 fix 17 flaws. The PHP project rates seven of them critical: FastCGI request smuggling in PHP-FPM, three session bugs that can lead to code execution, and three use-after-free bugs in the engine and in
ext/date. - Severity: All seven carry CVSS 4.0 9.2. According to php.net, the critical flaws need a non-default configuration or an uncommon setup. None is in the CISA KEV catalog, and no public exploit is known.
- Who is affected: Most of all PHP-FPM behind nginx, Apache or HAProxy with reused FastCGI connections. Whether an application meets the second precondition is hard to judge from the outside. The session flaws hit applications that use PHP's own sessions.
- What to do: Upgrade to the versions above, rebuild images, and check beforehand whether you need upload progress, because the release switches
session.upload_progress.enabledoff by default. - What would have protected you: closing FastCGI connections after every request, switching off upload progress,
zend.exception_ignore_args = Onand workers that do not live forever. A locked-down FPM socket limits who can attack at all.
How state gets from one request into the next
PHP-FPM is a pool of long-lived worker processes that handle one request after another. The web server talks to them via FastCGI, a binary protocol made of records with a fixed header, a type and a length. A request consists of a BEGIN_REQUEST record, PARAMS records with variables such as SCRIPT_FILENAME and REMOTE_ADDR, and STDIN records carrying the HTTP body. If the web server sets the FCGI_KEEP_CONN flag in BEGIN_REQUEST, the connection stays open after the response and serves the next request. That saves connection setup, but it requires PHP to stand exactly where the next record begins at the end of every request.
CVE-2026-129289: the remainder in the STDIN record
That assumption was broken. Since version 5.6.0, PHP reads the request body on demand, only when the application opens php://input or a parser needs it. At the end of a request, sapi_deactivate() in main/SAPI.c normally makes sure unread bytes are discarded. That cleanup, however, sat in an else branch: if the application had opened php://input, a request body stream existed, and the branch that reads off the rest never ran. According to the advisory, a deliberately malformed multipart body makes the parser stop at a predictable offset. If the application then opens php://input without reading it to the end, the rest of the STDIN record stays on the connection.
The next pass shows why this is dangerous. On the reused connection, the worker waits for the header of a new record and finds bytes from the attacker's body instead. The attacker can shape those bytes to look like a complete FastCGI request. That lets him set parameters that otherwise only the web server sets: according to the advisory SCRIPT_FILENAME, REMOTE_ADDR and PHP_ADMIN_VALUE, which can set configuration values in a way that makes PHP run attacker code. According to the advisory, changed admin values can also persist for later requests on the same worker. You know the pattern from HTTP request smuggling, except that here the boundary between web server and application server blurs, and the web server's routing rules, access controls and IP checks never apply.
Three ways into the session
The three session flaws share a pattern. PHP stores session data as a serialized string, by default in a file, and turns it back into objects at the next session_start(). Whoever can decide what appears as serialized data on read gets close to unserialize() with his own data, and with suitable gadget chains from libraries such as Guzzle or Monolog that becomes code execution.
CVE-2026-115560 uses the upload progress feature for this. With session.upload_progress.enabled active, PHP writes progress data into the session while the upload is still running, using whatever serializer is configured at that moment. If the application later reads the same session with a different handler, for example because it switches session.serialize_handler from php_serialize to php at runtime or because two applications share the same session directory, the php handler treats an attacker-supplied | as the boundary between name and value. Whatever follows ends up in unserialize(). According to the advisory, the bug has been in the code since PHP 5.4.0.
CVE-2026-126714 is older and subtler. ps_files_write() in ext/session/mod_files.c wrote new session data over the old file and only truncated it when the new data was shorter. If a write is interrupted, the advisory says a prefix of the new session and a remainder of the old one stay in the file, and that mix can appear as attacker objects on read. As one trigger, the advisory names a hard memory failure in another thread of a threaded build. Threaded builds, that is ZTS, are for example the basis of FrankenPHP. According to the advisory, the code has been like this since PHP 4.1.0.
CVE-2026-129481 only affects PHP 8.3 to 8.5 and, according to the advisory, is an incomplete fix for October's CVE-2026-109619. session_start() records the script's filename in a global variable. If a callback raises a fatal error while the session is being cleaned up, for example a stream_close() in a custom stream wrapper, shutdown aborts before the reference is cleared. The memory behind it is freed with the request, and the next request on the same worker accesses it. The PHP project has not demonstrated code execution here.
Memory bugs in the engine and the timezone cache
The remaining three critical flaws are use-after-free bugs with a common cause: pointers that survive a lifecycle phase in which their memory is freed. CVE-2026-129496 arises at startup. If PHP writes a warning to a file log during module startup, it formats the timestamp in local time and creates a timezone cache in the process. That cache is freed at the end of startup, but the pointer to it is not reset, so the first request of a fresh worker accesses freed memory. According to the source code, the path affected builds without thread safety.
CVE-2026-129182 and CVE-2026-129474 only affect PHP 8.5, which stores a backtrace on fatal errors by default. In the first case, the advisory says the backtrace is created again after executor cleanup, for example when restoring INI values itself raises a fatal error, and the next request accesses it. In the second case, a backtrace taken during a __call() or __callStatic() collects arguments, some of which point to already freed memory. The demonstrated attack needs zend.exception_ignore_args = Off, whereas php.ini-production sets this value to On, and also knowledge of memory addresses despite ASLR.
What the fixes change
I compared the PHP 8.5.12 and 8.5.13 source tarballs and cross-checked the key places in 8.4.28, 8.3.37 and 8.2.36. For CVE-2026-129289, the fix changes two places. In sapi_deactivate(), the else if becomes a separate if, so PHP now always reads off unread input, even when a request body stream exists. In main/fastcgi.c, fcgi_read_request() refuses to read a new request as long as bytes from the last STDIN record are still pending, and the counter is reset when a connection closes. The first part removes the cause, the second ensures that a similar bug elsewhere does not lead to a forged request again.
For sessions, the fix goes broader. ps_files_write() now truncates the file to zero before every write and aborts if that fails. For CVE-2026-115560, session.upload_progress.enabled now defaults to 0, and while upload progress is on, any runtime change to a session setting throws an error. In addition, the process now exits with _exit(1) in zend_API.c when a module's shutdown aborts with a fatal error. This change only appears in the 8.3 to 8.5 branches, so I attribute it to CVE-2026-129481. A worker with half-cleaned state therefore serves no further request. In the engine, zend.c only creates the fatal-error backtrace while the executor is active, zend_builtin_functions.c handles trampoline frames of __call() separately when collecting arguments, and main.c no longer formats log timestamps with the timezone cache during startup.
Taken together, the fixes reveal the actual cause. PHP was designed for processes that forget everything after each request. FPM, FrankenPHP and other long-lived workers, by contrast, rely on state that outlasts requests, and every place where PHP does not clean up completely at the end of a request becomes a channel from one request into the next. That applies to bytes on a connection just as much as to pointers in memory.
Preconditions, attack path and who is really affected
The attack via CVE-2026-129289 needs neither an account nor user interaction, but two conditions. The web server must reuse FastCGI connections, with nginx via fastcgi_keep_conn on, with Apache mod_proxy_fcgi via enablereuse=on, and the advisory also names HAProxy and LSAPI. And the application must open php://input without reading it completely. Out of the box the first condition is usually not met, because nginx closes FastCGI connections after every request by default. Some tuning guides, however, recommend enabling fastcgi_keep_conn together with an upstream keepalive, and that exact combination creates the problem.
The second condition is harder to judge because it lives in application code. An opened but not fully read php://input arises, for example, when an application provides the request body as a stream and only reads it on demand. That is a perfectly legitimate approach, and precisely for that reason the advisory places the bug in PHP and not in the application. If you reuse FastCGI connections, you should therefore not rely on your application not meeting this condition.
Conceptually, the attack runs like this: the attacker sends a single HTTP request with a crafted multipart body to any PHP endpoint. PHP stops reading at the intended point, the application opens php://input, and the response goes back as usual. Then the worker reads the hidden second request on the same connection and executes it with the attacker's parameters. The damage is code execution with the privileges of the FPM worker, meaning access to source code, configuration, database credentials and everything the pool may read.
For the session flaws the circle is smaller. Affected first of all are applications that use PHP's own sessions via session_start(). Upload progress, however, writes to the session store even if the application itself uses no sessions, as soon as a request brings the matching form field and a session ID, either as a cookie or as a form field. It becomes dangerous when another application reads the same store with a different serializer. Servers on which several PHP applications share one session.save_path are therefore more exposed than a container with a single application.
FrankenPHP does not speak FastCGI but embeds PHP directly into Caddy. In my assessment, CVE-2026-129289 therefore does not affect it. The session, engine and timezone flaws, by contrast, live in the PHP runtime itself and affect FrankenPHP like any other SAPI, depending on the PHP version it is built with.
| CVE | Affected | Fix | Precondition | CVSS |
|---|---|---|---|---|
| CVE-2026-129289 (GHSA-qc49-hpvq-g2w6), FPM smuggling | 8.2 to 8.5, in the code since 5.6.0 | 8.2.36, 8.3.37, 8.4.28, 8.5.13 | FastCGI connections are reused, application opens php://input | 9.2 (v4.0), critical |
| CVE-2026-115560 (GHSA-658j-r8rw-q6mx), serializer mismatch | all supported branches, since 5.4.0 | as above | upload progress on, session written and read with different serializers, gadget chain | 9.2 (v4.0), critical |
| CVE-2026-126714 (GHSA-fm2m-fjf5-v3cp), overwritten session file | all supported branches, since 4.1.0 | as above | influence over session data, interrupted write, gadget chain | 9.2 (v4.0), critical |
| CVE-2026-129481 (GHSA-g3vh-838c-65v7), session shutdown | 8.3 to 8.5 | 8.3.37, 8.4.28, 8.5.13 | fatal error in a callback during session cleanup | 9.2 (v4.0), critical |
| CVE-2026-129496 (GHSA-gr4f-wgx5-jpfv), timezone cache | 8.2 to 8.5 | 8.2.36, 8.3.37, 8.4.28, 8.5.13 | warning at startup, file log, build without thread safety | 9.2 per reports, critical |
| CVE-2026-129182 (GHSA-2fjv-p558-g82m), fatal-error backtrace | 8.5 only | 8.5.13 | specific INI constellations, per-directory configuration or FastCGI parameter | 9.2 (v4.0), critical |
| CVE-2026-129474 (GHSA-8mjj-2r7p-4hg2), magic-method backtrace | 8.5 only | 8.5.13 | zend.exception_ignore_args = Off, fatal error in __call() | 9.2 (v4.0), critical |
None of the seven flaws is in the CISA KEV catalog, and no attacks in the wild are known. None of the sources checked names a public exploit, but the PHP project describes demonstrated attacks for CVE-2026-129289 and CVE-2026-115560, the latter with gadget chains from Guzzle and Monolog. EPSS scores were not yet available on November 20, the CVE records have been published since November 19. Amazon rates CVE-2026-129289 at 9.8 in CVSS 3.1, without attack requirements. The CVSS 4.0 field AT:P in the PHP project's score, by contrast, reflects that connection reuse must be in place.
PHP 8.5.13 to 8.2.36 and the silent change to upload progress
The PHP project released PHP 8.5.13, 8.4.28, 8.3.37 and 8.2.36 on November 19, and PHP 8.6.0 came out the same day. PHP 8.1 and older no longer get upstream fixes, and according to php.net PHP 8.2 only receives security updates until December 31, 2026. The official Docker images already ship 8.5.13, 8.4.28, 8.3.37 and 8.2.36. In Wolfi, php-8.5 8.5.13 and the other branches with the patched versions are in the package index.
Amazon Linux 2023 published ALAS notices for all affected packages on November 19: php8.2 (ALAS2023-2026-3504), php8.3 (ALAS2023-2026-3505), php8.4 (ALAS2023-2026-3507) and php8.5 (ALAS2023-2026-3506). On Amazon Linux 2, the extras package php8.2 is fixed with ALAS2PHP8.2-2026-016. For php8.1 on Amazon Linux 2023, ALAS says Amazon plans no fix. Distribution packages often carry older version numbers with backported fixes, so your distribution's notice counts, not php -v alone.
The biggest pitfall of the update is not in the UPGRADING file. All four branches change the default of session.upload_progress.enabled from 1 to 0. If you build upload progress bars on this feature, you lose them after the update without any error message. If you switch the feature back on, a second change applies: while upload progress is active, any ini_set() on a session setting throws an error. Code that sets the session name, lifetime or save path at runtime then aborts. Such values belong in php.ini or the pool configuration.
A third behavior change only affects PHP 8.3 to 8.5. If a module's shutdown at the end of a request aborts with a fatal error, the process now exits with _exit(1). In FPM, the master catches this and starts a new worker. In the logs you then see workers ending with status 1, and that is not a new bug but the fix at work.
The remaining ten flaws in the release are not critical, but not all of them are harmless:
CVE-2026-129291: use-after-free in the FPM master with epoll, through which a local worker can gain the master's privileges, often root. It requirescatch_workers_output = yes.CVE-2026-127960andCVE-2026-128064: denial of service through folded HTTP response headers and unencrypted connections with mixed-case schemes such asHTTPS://, both in requests PHP itself makes to foreign URLs.CVE-2026-128090: Phar accepts altered code through a signature algorithm downgrade.CVE-2026-129538: out-of-bounds read and write in php-cgi's PATH_INFO correction.CVE-2026-129292: XSS on the FPM status page.CVE-2026-129501,CVE-2026-129506,CVE-2026-15353andCVE-2026-129438: memory bugs and information disclosure in DOM, SOAP and the URI extension. On top of that comes an update of the bundled uriparser library forCVE-2026-48841.
Hardening that would have worked before the patch
The seven flaws work differently, but they come down to two mechanisms. One is a channel between two requests on the same worker or the same connection, the other is unserialize() on data an attacker can influence. So anything that closes these channels, shortens their lifetime or switches off the preconditions in the configuration is effective. Container hardening limits the damage but does not prevent execution inside the worker.
Close FastCGI connections after every request
Without a reused connection there is no next pass in which the worker could read the attacker's bytes as a request. With nginx that means fastcgi_keep_conn off, which is the default, and a keepalive in the upstream block for FPM does nothing without fastcgi_keep_conn on anyway. With Apache, leave enablereuse off in mod_proxy_fcgi. The advisory names exactly these settings as the workaround. The price is one connection setup per request, which hardly matters over a Unix socket on the same host. Reading php://input completely in the application, by contrast, is explicitly named as unreliable in the advisory.
Make the FPM socket reachable only for the web server
Anyone who can talk to the FPM port directly needs no smuggling trick, because he can build FastCGI requests with arbitrary parameters himself. The advisory therefore advises never to put FPM and LSAPI listeners on untrusted networks. The cleanest option is a Unix socket with listen.owner, listen.group and listen.mode giving access only to the web server. Where FPM runs as its own container in Kubernetes, a NetworkPolicy restricts access to port 9000 to the web server pod, and inside FPM listen.allowed_clients limits the permitted source addresses. On its own this does not help against CVE-2026-129289, because the attack goes through the legitimate web server, but it prevents the more obvious variant of the same damage.
Switch off upload progress and separate session stores
session.upload_progress.enabled = 0 removes the basis for CVE-2026-115560 and, according to the advisory, also lowers the risk of CVE-2026-126714. The value must be in php.ini, a file in conf.d or a php_admin_flag in the pool configuration, because PHP processes upload progress while reading the request, long before an ini_set() or a .user.ini takes effect. All workers then have to restart. After the update this is the default, so you should be able to justify switching it on deliberately.
Separating session stores is worthwhile as well. If several applications share one session.save_path, one can write what the other reads with a different serializer. A separate directory per pool, set with php_admin_value[session.save_path], or a separate container per application removes that bridge. If you keep sessions in Redis or Valkey, separate them via their own databases or prefixes. And session.serialize_handler belongs in the configuration, not in application code.
Backtraces without arguments and fatal-error backtraces in PHP 8.5
According to the advisory, zend.exception_ignore_args = On blocks CVE-2026-129474, because without arguments in the backtrace there are no stale values to collect. php.ini-production already sets the value this way, but many container images ship no php.ini at all or use the development variant. So check the value actually loaded in the FPM pool, not just on the command line. On PHP 8.5 you can additionally set fatal_error_backtraces = 0, which the advisory for CVE-2026-129182 names as a temporary mitigation. In return, fatal-error backtraces disappear from the log. Whether that matters depends on whether your error tracking captures them through its own handlers anyway.
Do not let workers live forever
Three of the seven flaws need a follow-up request on the same worker, and according to the advisory the smuggled admin values from CVE-2026-129289 can persist on a worker. pm.max_requests limits how many requests an FPM worker serves before the master replaces it. For CVE-2026-129481, the advisory names pm.max_requests = 1 as a workaround, which noticeably reduces performance. A value in the low hundreds does not prevent exploitation, but it shortens the time poisoned state can act, and it only costs occasional restarts of individual workers.
Clean startup logs and an eye on gadget chains
CVE-2026-129496 needs a warning at startup. An FPM that writes no warnings at startup, because extensions and configuration are clean, does not offer this path at all. For the session flaws, the gadget chain decides the damage. The PHPGGC collection lists known chains for common libraries, and composer audit plus current dependencies reduce their number. That does not remove the risk, because new chains show up regularly.
What does not help here
A web application firewall in front of nginx only sees a malformed multipart body for CVE-2026-129289, not the FastCGI request inside it. It can block individual patterns once signatures exist, but that is not reliable. According to the advisory, display_errors = 0 does not prevent CVE-2026-129474, because the bug arises when the backtrace is created, not when it is displayed. disable_functions does not help with the session flaws, because unserialize() is called internally.
seccomp, dropped capabilities, runAsNonRoot and readOnlyRootFilesystem remain right. They do not prevent code from running in the PHP worker, though, because PHP is allowed to do everything there the application needs, and they only limit what is possible afterwards. A read-only file system at least makes it harder for an attacker to persist through written files. You can find more on NetworkPolicies and pod security for PHP workloads in the series TYPO3 on Kubernetes under IT-Grundschutz.
Detection and verification
Whether you are affected is shown first by the PHP version in every image and on every host, for distribution packages together with your distribution's security notice. Then check the configuration. Search your nginx configuration for fastcgi_keep_conn on and Apache for enablereuse=on. Use php-fpm -i or a pool status page to check session.upload_progress.enabled, zend.exception_ignore_args, session.save_path and catch_workers_output, as the pool actually loads them.
Whether someone has exploited the flaws is harder to tell, and the advisories name no indicators. For CVE-2026-129289 I derive one hint from the mechanism. A smuggled request reaches FPM without nginx ever having seen it. If you write the FPM access log with access.log and the %f placeholder for the executed script, entries without a matching nginx log entry and script paths your application does not know are a strong signal. For the memory bugs, workers ending with signal 11 give a hint, for the session flaws, session files containing objects of classes your application never writes into sessions.
If you suspect an attack, treat the FPM pool as compromised. Restart all workers so no altered state survives, rotate every credential the pool could read, that is database, mail, APIs and the application's keys, and check the file system for new or changed PHP files. If the application runs in a container, a fresh container from a rebuilt image is the faster and safer route.
Recommendation for operators
Act now if PHP-FPM runs behind a web server that reuses FastCGI connections. Whether your application meets the second precondition can hardly be ruled out with certainty. So switch off the reuse immediately, which costs you one configuration line and a reload. It is just as urgent on servers where several PHP applications share a session store and upload progress is active. Then upgrade to 8.5.13, 8.4.28, 8.3.37 or 8.2.36, and check beforehand whether upload progress indicators or runtime changes to session settings are in use anywhere.
Monitoring is enough if FastCGI connections close after every request anyway, upload progress is off and zend.exception_ignore_args is On. The update still belongs in this or the next maintenance window, because several of the bugs have been in the code for years, and the remaining ten flaws of the release are not covered by that. If you still run PHP 8.1 or older, you have no upstream fixes and should not postpone the migration any longer.
Regardless of the individual case, what I say about every flaw applies: patches and updates belong automated. PHP shows why, because the project now publishes security updates almost every month, and in October one critical fix was followed by the next only four weeks later. When Renovate or Dependabot propose new PHP base images and Composer packages as merge requests and the pipeline tests them against staging, a release like this is a matter of hours rather than weeks. A cooldown for routine updates protects against compromised releases, and you exempt security updates from it. The silent switch-off of upload progress and the new errors on ini_set() then show up in testing and not in production. If you update by hand, you quickly pile up two releases during the holiday season and then install an update where nobody knows which change caused which error.
Frequently asked questions about the critical PHP flaws of November 2026
What do I do if I cannot upgrade right away?+
Switch off the reuse of FastCGI connections, set session.upload_progress.enabled = 0 and zend.exception_ignore_args = On, and restart all workers. That does not replace the update, but it removes the basis for the most dangerous paths.
How do I tell whether my web server reuses FastCGI connections?+
With nginx, the configuration then contains fastcgi_keep_conn on, with Apache enablereuse=on in the proxy definition for mod_proxy_fcgi. If neither entry is present, the web server closes the connection after every request, and the FPM flaw does not apply.
Why have my upload progress bars stopped working?+
The release sets session.upload_progress.enabled to 0 by default. If you need the feature, switch it back on in php.ini or the pool. Changing session settings via ini_set() then throws an error, though.
If I use FrankenPHP, am I safe?+
From the FastCGI smuggling, yes, because FrankenPHP does not speak FastCGI. The session, engine and timezone flaws live in PHP itself, though. So you need a FrankenPHP image with PHP 8.5.13 or 8.4.28.
Conclusion
At first glance the seven critical flaws look different, but they tell the same story. PHP relies on everything that belonged to a request vanishing at its end, and long-lived workers turn every gap in that cleanup into a channel into the next request. The fixes answer this consistently: leftover bytes are always read off, a half-read connection accepts no new request, and a worker with half-cleaned state would rather exit than keep working. The transferable lesson for operations is not to take boundaries between requests for granted. Every optimization that keeps connections or processes alive beyond one request deserves the question of what else survives along with them, as the PHP2Shell flaws from October already showed.
Sources
- PHP advisory GHSA-qc49-hpvq-g2w6 (CVE-2026-129289)
- PHP advisory GHSA-658j-r8rw-q6mx (CVE-2026-115560)
- PHP advisory GHSA-fm2m-fjf5-v3cp (CVE-2026-126714)
- PHP advisory GHSA-g3vh-838c-65v7 (CVE-2026-129481)
- PHP advisory GHSA-gr4f-wgx5-jpfv (CVE-2026-129496)
- PHP advisory GHSA-2fjv-p558-g82m (CVE-2026-129182)
- PHP advisory GHSA-8mjj-2r7p-4hg2 (CVE-2026-129474)
- php.net: ChangeLog PHP 8.5.13, 8.4.28, 8.3.37, 8.2.36
- php.net: news archive 2026 (pre-announcement of November 18, advisories from October)
- php.net: source tarballs 8.5.12 and 8.5.13 (comparison of main/SAPI.c, main/fastcgi.c, ext/session, Zend/zend.c, Zend/zend_API.c, main/main.c)
- Amazon Linux Security Center: CVE-2026-129289
- CVE.org: CVE-2026-129289
- php[architect]: PHP's November security release, seven critical fixes explained
- The Hacker News: PHP Fixes 7 Critical Flaws
- Aikido: PHP critical security release, 19 November
- nginx: fastcgi_keep_conn
- Apache: mod_proxy, parameter enablereuse
- php.net: FPM configuration (pm.max_requests, listen.allowed_clients, access.format)
- php.net: session configuration
I check whether your PHP-FPM and web server configuration is open to FastCGI smuggling and the session flaws, harden it and bring PHP 8.5.13 into your images in a controlled way.
Audits of nginx, Apache and PHP-FPM, separation of session stores, hardened FPM pools in Kubernetes and automated PHP updates with Renovate and tested pipelines.
Platform operations instead of consulting on paper: I continuously check, patch and harden your infrastructure.
About the author

Kai Ole Hartwig
Programming since 2002 – self-taught, set up my own business with KO-Web in 2012. Over 100 projects, with a focus on security, performance, automation and quality. Today freelance: DevSecOps consulting, training and software development.
