PHP security releases 8.5.13, 8.4.28, 8.3.37, 8.2.36

On 19 November the PHP team released 8.5.13, 8.4.28, 8.3.37 and 8.2.36. The 8.5.13 changelog lists seventeen security fixes, and seven of them are rated Critical on GitHub (CVSS 4.0 score 9.2). The advance notice on php.net says the worst issues need a non-default or uncommon setup, and I found no report of attacks in the announcements or the advisories. So there is no need to panic, but I'd update this week and check a few settings while I'm at it, because most of these bugs depend on a specific configuration.

This is the second big PHP security release since PHP2Shell on 21 October. One of the fixed bugs is CVE-2026-115560, the one I covered in the update to the PHP2Shell article. Its fix has now shipped.

The short version

  1. Update to 8.5.13, 8.4.28, 8.3.37 or 8.2.36, or to your distribution's fixed package.
  2. Restart PHP-FPM or Apache, or the old processes keep running.
  3. With nginx and PHP-FPM, check whether fastcgi_keep_conn is set to on in the loaded configuration. It is a condition of the PHP-FPM request smuggling bug, and easy to verify.
  4. On PHP 8.5, check zend.exception_ignore_args and fatal_error_backtraces in the FPM configuration, not the CLI one.
  5. On PHP 8.2, security support ends on 31 December. This release still fixes it, but after that there will be no more patches.

Which bugs matter?

Seven of the seventeen fixes are Critical. Each needs some condition to be met, so not every one of them affects every server:

  • CVE-2026-129289, PHP-FPM request smuggling (8.2–8.5). It needs a front end that keeps persistent connections to FPM: fastcgi_keep_conn on in nginx, enablereuse=on for Apache's mod_proxy_fcgi, HAProxy or LSAPI. The application must also open php://input without reading it to the end. According to the advisory it needs no memory corruption and no non-default PHP setting, and the attacker can run PHP code with the FPM worker's privileges. If your front end opens a new connection for every request, the attack doesn't work.
  • CVE-2026-126714, partially overwritten session files (8.2–8.5). It affects the files handler, which is the default. The write has to be interrupted at a point where part of the new and part of the old session data stay together in the file: the file lock stops concurrent access, but it doesn't make an interrupted write atomic. On top of that the attacker has to influence what ends up in the session (through upload progress, or because the application stores a large user-supplied string there), and the application needs a deserialization gadget chain.
  • CVE-2026-115560, mismatched session serializers (8.2–8.5). This is the bug from the late-October PHP2Shell update. It needs upload progress switched on, two different serializers reading and writing the same session store (php_binary or php_serialize on one side, php on the other) and again a gadget chain. The fix turns upload progress off by default. If you enabled it yourself, your setting overrides the new default.
  • CVE-2026-129496, timezone cache use-after-free (8.2–8.5). It needs a startup warning (an invalid date.timezone, for example) written to a file-based error_log, followed by an early warning during a request, such as exceeding max_input_vars. According to the advisory a crafted request crashed an FPM worker, and code execution was only shown under further assumptions.
  • CVE-2026-129481, interrupted session shutdown (8.3–8.5). A fatal error has to happen while the session closes, for example in a user-defined stream wrapper's close callback. Code execution has not been demonstrated through this path.
  • CVE-2026-129474, use-after-free in backtraces (8.5 only). Backtraces for fatal errors are on by default in 8.5. The application has to hit a fatal error during a __call() or __callStatic() call, for example because a request exceeds memory_limit. According to the advisory, zend.exception_ignore_args=1, the value php.ini-production ships with, blocks the attack path that was shown. The advisory names Laravel facades as a possibly relevant path, but nobody has demonstrated an attack on Laravel.
  • CVE-2026-129182, use-after-free after shutdown (8.5 only). It needs a special shutdown configuration (max_memory_limit set both globally and per path, or zlib.output_compression set differently with an output_handler), and then a very early diagnostic message in the next request on the same worker. Ordinary FPM pool settings are not enough on their own, while Apache's per-directory settings are. Code execution has not been demonstrated through this entry point.

The other ten are less severe. They include a local privilege escalation in PHP-FPM (High), a PHAR signature bypass and a bug that lets mixed-case HTTPS and FTPS URLs send data unencrypted.

What to check on your server

bash
# nginx: the full configuration on disk (included files too)
sudo nginx -T 2>&1 | grep -n 'fastcgi_keep_conn'

# the php.ini values of PHP-FPM (a partial check: pools can override them, and the CLI differs)
php-fpm8.5 -i | grep -E 'fatal_error_backtraces|exception_ignore_args|upload_progress.enabled'

Only the value on matters. The default off, a commented-out line or a file that isn't loaded is no risk, which is why you should read the output of nginx -T rather than the files in /etc/nginx. It prints the configuration on disk, not what the running process holds in memory: if you changed something and haven't reloaded nginx yet, the running state can differ. grep also strips the surrounding blocks, so if there is a match, read the full output and see which http, server or location block it sits in, because the setting is inherited. You have to filter out commented-out lines yourself. In the second command the binary has to match your version (php-fpm8.4, php-fpm8.3), and it only shows the php.ini values. Pool files can override them with php_admin_value and php_value, so check those separately. The advisory says changing only the CLI configuration is not enough. I haven't run these commands. I put them together from the official advisories.

After the restart, read the PHP error log. If you see a startup warning, such as an invalid date.timezone, fix it, because the timezone bug builds on exactly that.

How to update

Package names differ between distributions, so check your own distribution's security page for the package version that contains the fix. On a Debian or Ubuntu machine one way to do it is:

bash
sudo apt update
sudo apt install --only-upgrade 'php8.4*'
php-fpm8.4 -v
sudo systemctl restart php8.4-fpm

With Apache and mod_php, restart Apache. With Docker, choose an image with the fixed PHP version (check the exact tag on Docker Hub), rebuild your own image, and recreate the container. If the image uses a tag or digest pinned to an old version, pulling again gives you the same old image, and the old container keeps running the old PHP. On shared hosting PHP belongs to the provider, so ask them directly which version runs on your server.

nginx had its own flaw on 18 November, which I wrote up here: nginx HTTP/2 flaw: patch, then restart. If both affect the same server, do them in one maintenance window.

If you can't update yet

These are stopgaps, and they don't replace the update:

  • PHP-FPM request smuggling: keep nginx's fastcgi_keep_conn off, and Apache's enablereuse too, or make the front end close the connection after every request. Don't expose FPM directly to an untrusted network.
  • The 8.5 bugs: set fatal_error_backtraces to 0 in the FPM configuration and restart the workers. According to the advisory display_errors=0 is not enough.
  • Sessions: set session.upload_progress.enabled to 0 in the server configuration. An ini_set() call from the application comes too late. That closes only one input path, and the other one (large user-supplied data in the session) stays.

Need a hand?

I build and run PHP and Laravel applications. If you need help checking your servers, reviewing your PHP-FPM and nginx settings or planning the update, get in touch.


Sources

All articles →