> ## Documentation Index
> Fetch the complete documentation index at: https://blog.onetsolutions.net/llms.txt
> Use this file to discover all available pages before exploring further.

# PHP timezone cache flaw (CVE-2026-129496): remote PHP-FPM crash

> PHP flaw CVE-2026-129496: a timezone cache use-after-free. PHP-FPM and mod_php exposure, fixed versions, distro packages and the error_log mitigation.

*Published on December 3, 2026*

> [!WARNING]
>
> **CVE-2026-129496 — PHP timezone cache, CVSS v4.0 9.2.** On a server that writes a PHP error to an `error_log` file at startup, an unauthenticated request can crash a PHP-FPM, mod\_php or CGI worker. PHP says code execution may be possible, but it has only been demonstrated with known memory addresses. Fixed in **PHP 8.5.13, 8.4.28, 8.3.37 and 8.2.36**, released on November 19, 2026. Update, or clear your startup errors until you can.

## The bug in two sentences

When PHP writes a diagnostic to an `error_log` file while it starts, it caches timezones in memory that is freed right after, but keeps the reference. If a second diagnostic comes up at the very start of a worker's first request, PHP reads that freed cache, which may already hold request data.

This is a use-after-free (CWE-416). The attack needs all of these conditions:

* a PHP build **without thread safety**;
* a diagnostic raised at startup, for example an invalid `date.timezone`, or a warning or deprecation caused by session configuration;
* that diagnostic actually written by PHP to an `error_log` **file**: PHP-FPM's own log is not enough;
* an early diagnostic in a worker's first request, for example exceeding `max_input_vars`, which the attacker triggers with the request.

The window closes once the worker completes its first normal request. It reopens with every new or recycled worker.

The PHP advisory separates two outcomes:

* **The crash**: a crafted HTTP request crashed a PHP-FPM worker with the default `max_input_vars` value and ordinary nginx header limits. The issue was also reproduced with CGI.
* **Code execution**: demonstrated locally, on PHP-FPM and Apache mod\_php, with known memory addresses and additional settings. A complete remote ASLR bypass is considered plausible, but has not been demonstrated.

Affected versions:

* **PHP before 8.2.36**;
* **PHP 8.3.0 through 8.3.36**, fixed in **8.3.37**;
* **PHP 8.4.0 through 8.4.27**, fixed in **8.4.28**;
* **PHP 8.5.0 through 8.5.12**, fixed in **8.5.13**.

The PHP team says the faulty code has been present since PHP 5.3.18 and 5.4.8. The fix writes log timestamps in UTC as long as no request is fully initialized.

The PHP project scores the flaw **9.2** in CVSS 4.0 (`AV:N/AC:H/AT:P/PR:N/UI:N/VC:H/VI:H/VA:H/SC:N/SI:N/SA:N`); NVD shows that score. Red Hat rates it "Critical" with 8.1 in CVSS 3.1, Ubuntu medium priority. The full advisory is [GHSA-gr4f-wgx5-jpfv](https://github.com/php/php-src/security/advisories/GHSA-gr4f-wgx5-jpfv).

> [!NOTE]
>
> According to the CISA assessment shown by NVD, no exploitation is reported and the attack is not automatable. The CVE is not in the November 30, 2026 version of the KEV catalog.

## Already updated for November's other PHP flaws?

If you installed PHP 8.5.13, 8.4.28, 8.3.37 or 8.2.36, or the fixed Debian or Ubuntu package, for [phpAfterShell (CVE-2026-126714)](https://blog.onetsolutions.net/en/phpaftershell-cve-2026-126714.md), [PHP-FPM (CVE-2026-129289)](https://blog.onetsolutions.net/en/php-fpm-smuggling-cve-2026-129289.md) or [PHP-FPM epoll (CVE-2026-129291)](https://blog.onetsolutions.net/en/php-fpm-epoll-cve-2026-129291.md), **you are covered**, provided you restarted PHP. The fixed versions are the same.

Three cases still need action:

* you only applied the mitigation from one of those advisories: it does not close this flaw;
* you stayed on the October versions (8.5.12, 8.4.27, 8.3.36, 8.2.35), released for [php2shell](https://blog.onetsolutions.net/en/php2shell-cve-2026-109618.md);
* you did nothing for the [backtrace flaw (CVE-2026-129474)](https://blog.onetsolutions.net/en/php-backtrace-cve-2026-129474.md), which is specific to PHP 8.5: CVE-2026-129496 also affects older branches.

## Sizing your exposure

The question to ask: **does PHP write an error to an `error_log` file every time it starts?** PHP's `php.ini-production` leaves `error_log` commented out: you, or a control panel, must have pointed it at a file.

| Profile | Exposure | Action |
| - | - | - |
| Unpatched PHP, `error_log` to a file, startup diagnostic, site on the Internet | **High**: unauthenticated remote crash | Update today; if you can't, apply the mitigation |
| Unpatched PHP, `error_log` to a file, no startup diagnostic | Conditions not met, but one configuration mistake is enough to meet them | Update |
| Unpatched PHP, `error_log = syslog` | Demonstrated trigger avoided, according to PHP | Update in the next cycle |
| Unpatched PHP, `error_log` not set, errors in the PHP-FPM log | That log does not meet the condition, according to PHP | Update in the next cycle |
| Container or Kubernetes pod that ships PHP | Same as the PHP configuration in the image | Rebuild on a fixed image |
| PHP built with thread safety (ZTS) | Outside the described scope | Update anyway: the release fixes other flaws |
| PHP patched and restarted | Fixed | None |

Read the PHP-FPM configuration, not the command-line one:

```bash theme={null}
# Debian, Ubuntu (change 8.4 to your version); on RHEL, AlmaLinux: php-fpm
sudo php-fpm8.4 -i | grep -E '^Thread Safety|^error_log =>|^log_errors =>'

# Every error_log and date.timezone setting (Debian, Ubuntu then RHEL, AlmaLinux)
sudo grep -rnE '^[^;#]*(error_log|date\.timezone)' \
  /etc/php/ /etc/php.ini /etc/php.d/ /etc/php-fpm.d/ /etc/apache2/ /etc/httpd/ 2>/dev/null
```

`Thread Safety => disabled` means an affected build. If `error_log` shows a path, look for startup diagnostics in that file:

```bash theme={null}
# Replace with the path shown by error_log
sudo grep -a 'PHP Startup:' /var/log/php_errors.log | tail
```

A line like these, dated from the last PHP-FPM or Apache start, marks an exposed server:

```text theme={null}
PHP Warning:  PHP Startup: Invalid date.timezone value 'Europe/Pariss', using 'UTC' instead in Unknown on line 0
PHP Deprecated:  PHP Startup: session.sid_length INI setting is deprecated in Unknown on line 0
```

> [!NOTE]
>
> Command-line PHP can write to the same file. Compare the time of those lines with the service start time. We observed both messages on the `php:8.4.27-fpm` Docker image. In the same test, an `error_log` set only in the pool did not receive the startup diagnostic, which went to the PHP-FPM log. That finding does not replace the update.

## Updating PHP, distro by distro

The real fix is a PHP package update followed by a **restart** of PHP-FPM and Apache: processes already running keep the old code.

Take a [snapshot of your VPS](https://help.onetsolutions.net/vps/snapshot) first.

### Debian

| Version | Fixed package | Advisory |
| - | - | - |
| Debian 13 (trixie) | `php8.4` `8.4.28-1~deb13u1` | DSA-6641-1 |
| Debian 12 (bookworm) | `php8.2` `8.2.36-1~deb12u1` | DLA-4916-1 |

### Ubuntu

The advisory is USN-9185-1.

| Version | Fixed package |
| - | - |
| 26.10 | `php8.5` `8.5.9-0ubuntu2.2` |
| 26.04 LTS | `php8.5` `8.5.4-0ubuntu1.6` |
| 24.04 LTS | `php8.3` `8.3.6-0ubuntu0.24.04.14` |
| 22.04 LTS | `php8.1` `8.1.2-1ubuntu2.29` |
| 20.04 LTS | `php7.4` `7.4.3-4ubuntu2.29+esm6` (Ubuntu Pro) |

```bash theme={null}
# Debian, Ubuntu: install the PHP fixes, then restart PHP
sudo apt update
sudo apt install --only-upgrade 'php*'
sudo systemctl restart 'php*-fpm.service'
sudo systemctl restart apache2 2>/dev/null

# Check the installed version
dpkg -l 'php*' | grep ^ii
```

> [!NOTE]
>
> Don't rely on the version printed by `php -v` alone. Ubuntu backports the fix: Ubuntu 24.04 still reports PHP 8.3.6 once patched. Only the full package version, compared with your distribution's advisory, is the reference.

### RHEL and AlmaLinux

Red Hat started shipping its fixes on November 20, 2026. AlmaLinux 8, 9 and 10 carried over each of these advisories under the same number, prefixed `ALSA`:

| Version | PHP | Red Hat advisory |
| - | - | - |
| 10 | `php8.4` `8.4.28-1.el10_3` | RHSA-2026:100821 |
| 10 | `php` `8.3.37-1.el10_3` | RHSA-2026:102300 |
| 9 | `php` `8.0.30-8.el9_9.2` | RHSA-2026:102297 |
| 9 | `php:8.2` stream | RHSA-2026:102261 |
| 9 | `php:8.3` stream | RHSA-2026:102226 |
| 9 | `php:8.4` stream | RHSA-2026:102255 |
| 8 | `php:7.4` stream | RHSA-2026:100991 |
| 8 | `php:8.2` stream | RHSA-2026:101276 |

RHEL 7 ELS gets `php-5.4.16-48.el7_9.2` (RHSA-2026:101337). EUS releases and the other extended support offerings have their own advisories, listed on the [Red Hat CVE page](https://access.redhat.com/security/cve/CVE-2026-129496).

```bash theme={null}
# Find out whether PHP comes from a module stream (RHEL and AlmaLinux 8 and 9)
dnf module list --enabled php

# Install the fix, then restart PHP
sudo dnf upgrade 'php*'
sudo systemctl restart php-fpm
sudo systemctl restart httpd 2>/dev/null

# Check the installed version
rpm -qa 'php*fpm*'
```

### cPanel & WHM

EasyApache 4 ships its own PHP packages. Its [change log](https://docs.cpanel.net/changelogs/easyapache-4-change-log-25) lists, for version 25.98 of November 19, 2026:

| Package | Fixed version |
| - | - |
| `ea-php85` | 8.5.13 |
| `ea-php84` | 8.4.28 |
| `ea-php83` | 8.3.37 |
| `ea-php82` | 8.2.36 |
| `ea-php74` | 7.4.34, backported fix |

As of December 3, that change log mentions CVE-2026-129496 for neither `ea-php80` nor `ea-php81`. If any of your sites use them, move those sites to a fixed version, or clear the startup diagnostics in that version's `php.ini`.

```bash theme={null}
# PHP versions installed by EasyApache 4
rpm -qa 'ea-php*-php-common'
```

### Docker and Kubernetes containers

Rebuild your images on a fixed `php` base image (8.2.36, 8.3.37, 8.4.28 or 8.5.13), all available on Docker Hub, then redeploy your containers or pods. Check the version inside:

```bash theme={null}
# Docker
docker exec <container> php -v

# Kubernetes
kubectl exec <pod> -- php -v
```

## Clearing PHP startup errors until you can update

If you can't update right away, PHP and Red Hat ([RHSB-2026-020](https://access.redhat.com/security/vulnerabilities/RHSB-2026-020)) give two measures. Each removes the demonstrated trigger; neither fixes the flaw.

### Remove the startup diagnostics

Fix every `PHP Startup:` line found above: a valid `date.timezone` value, deprecated session settings removed.

```ini theme={null}
; A valid timezone identifier
date.timezone = Europe/Paris
```

Test the configuration, then restart the master and all workers:

```bash theme={null}
# Debian, Ubuntu (change 8.4 to your PHP version)
sudo php-fpm8.4 -t && sudo systemctl restart php8.4-fpm

# RHEL, AlmaLinux
sudo php-fpm -t && sudo systemctl restart php-fpm

# Apache with mod_php: apache2 on Debian and Ubuntu, httpd on RHEL and AlmaLinux
sudo systemctl restart apache2
```

### Send PHP errors to syslog

The other measure avoids writing to a file. Your PHP errors then land in the system log instead of the usual file.

```bash theme={null}
# Debian, Ubuntu: one file for each version and each SAPI
for dir in /etc/php/*/*/conf.d; do
  printf 'error_log = syslog\n' | sudo tee "$dir/zz-cve-2026-129496.ini" >/dev/null
done
sudo systemctl restart 'php*-fpm.service'
sudo systemctl restart apache2 2>/dev/null
```

```bash theme={null}
# RHEL, AlmaLinux
printf 'error_log = syslog\n' | sudo tee /etc/php.d/zz-cve-2026-129496.ini >/dev/null
sudo systemctl restart php-fpm
sudo systemctl restart httpd 2>/dev/null
```

Red Hat asks you to check the effective value in every PHP-FPM pool, virtual host and application override: changing only the command-line configuration is not enough. On AlmaLinux 10, for example, the `www` pool shipped with the package points `error_log` at a file, which takes precedence over `/etc/php.d/`. Replace the line in `/etc/php-fpm.d/www.conf`, then restart PHP-FPM:

```ini theme={null}
php_admin_value[error_log] = syslog
```

> [!NOTE]
>
> Changing `$_REQUEST` or cookie settings is **not** a complete mitigation: the PHP advisory describes a path on Apache that does not depend on them.

## Checking the mitigation

```bash theme={null}
# The package version must match your distribution's advisory
dpkg -l 'php*-fpm' | grep ^ii      # Debian, Ubuntu
rpm -qa 'php*fpm*'                 # RHEL, AlmaLinux

# PHP-FPM must have restarted after the package update or the setting change
systemctl show -p ActiveEnterTimestamp 'php*-fpm.service'

# Effective error_log value (adjust the php-fpm version)
sudo php-fpm8.4 -i | grep '^error_log =>'
```

If you chose syslog, the expected value is `error_log => syslog => syslog`. If you cleared the diagnostics, run the `grep 'PHP Startup:'` again: no line should be more recent than the restart.

## Restoring the error\_log file after the update

Once PHP is patched and restarted, you can go back to your log file:

```bash theme={null}
# Debian, Ubuntu
sudo rm -f /etc/php/*/*/conf.d/zz-cve-2026-129496.ini
sudo systemctl restart 'php*-fpm.service'
sudo systemctl restart apache2 2>/dev/null

# RHEL, AlmaLinux
sudo rm -f /etc/php.d/zz-cve-2026-129496.ini
sudo systemctl restart php-fpm
sudo systemctl restart httpd 2>/dev/null
```

If you edited a pool, put its original value back as well before restarting.

Do keep the configuration free of startup errors: there is no reason to go back on that one.

## What next?

These settings are only a stopgap: the target remains your distribution's fixed PHP package, or a rebuilt image. The same update fixes [phpAfterShell (CVE-2026-126714)](https://blog.onetsolutions.net/en/phpaftershell-cve-2026-126714.md) and [the PHP-FPM flaw CVE-2026-129289](https://blog.onetsolutions.net/en/php-fpm-smuggling-cve-2026-129289.md). Turn on [automatic security updates](https://blog.onetsolutions.net/en/automatic-security-updates-linux-vps.md) to get the next fixes without waiting. For any technical question, open a ticket from your [OnetSolutions customer area](https://help.onetsolutions.net/console/support).


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.