VulnWatch by ve1ve2
critical 9.2 EPSS 8.14%

GHSA-gr4f-wgx5-jpfv / CVE-2026-129496: Timezone cache use-after-free can lead to remote code execution

Source:
PHP releases (GitHub php/php-src tags)
Published:
Fetched:
Updated:
Affects:
php ext-date

https://github.com/php/php-src/security/advisories/GHSA-gr4f-wgx5-jpfv ↗

repo-advisoryphpCWE-416CWE-459securityrepo:php/php-src

Timezone cache use-after-free can lead to remote code execution ### Summary PHP can retain a reference to a freed timezone cache when a diagnostic is written to a PHP error log file during process startup. A later diagnostic during early request initialization can access the freed cache before it is reset. On affected configurations, a remote attacker can trigger memory corruption, cause a worker to crash, and potentially execute arbitrary code with the privileges of the PHP worker. ### Details PHP formats file-based error log timestamps using the configured timezone. In a non-thread-safe build, a diagnostic emitted during module startup can cause PHP to allocate the timezone cache in temporary startup memory. That memory is released at the end of startup, but the internal reference to the cache remains until the date extension initializes the first request. An earlier diagnostic, such as the warning produced when request input exceeds `max_input_vars`, can therefore read or modify a freed hash table. The released memory may already contain attacker-controlled request data. The startup diagnostic must occur late enough that subsequent initialization does not clear the cached reference. Confirmed examples include an invalid `date.timezone` value and a warning or deprecation caused by session configuration. The diagnostic must actually be written through PHP's file-based `error_log` path. FPM's own error log does not by itself meet this condition. In FPM and Apache mod_php, workers can inherit the stale reference from the parent process. The vulnerable window lasts until a worker completes its first normal request. Newly created or recycled workers can encounter the same condition. A crafted HTTP request has been shown to crash an FPM worker using the default `max_input_vars` value and ordinary nginx header limits. The issue has also been reproduced with CGI. A separate local FPM proof demonstrated native command execution with known runtime addresses. It uses early HTTP Basic credential decoding to replace the stale cache, then reuses request-data allocations and triggers their destruction while `$_REQUEST` is constructed. That particular chain requires additional configuration, including `auto_globals_jit=0` and cookies in `request_order`, a suitable heap layout, and an Authorization header larger than nginx's default per-header limit. These are conditions of the demonstrated exploit, not general requirements of the underlying memory-corruption flaw. Other exploitation paths may be possible. Native command execution has also been demonstrated in Apache mod_php. Besides the same GET/COOKIE chain, Apache has a separate path when request startup fails before the cache is reset. Request cleanup can destroy the forged cache and invoke an attacker-controlled destructor. The demonstrated variant uses a POST that exceeds a configured 2 MB PHP memory limit and requires known runtime addresses, a suitable heap layout, and a larger allowed Authorization header. It does not require cookies or changes Affected packages: php:ext-date Patched: ext-date 8.2.36, ext-date 8.3.37, ext-date 8.4.28, ext-date 8.5.13

Linked vulnerabilities (2)

CVE-2026-129496 critical 9.2 EPSS 8.14% (p95) NVDCVE.orgGHSA
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/E:X/CR:X/IR:X/AR:X/MAV:X/MAC:X/MAT:X/MPR:X/MUI:X/MVC:X/MVI:X/MVA:X/MSC:X/MSI:X/MSA:X/S:X/AU:X/R:X/V:X/RE:X/U:X

Timezone cache use-after-free can lead to remote code execution. In non-thread-safe builds, a diagnostic written to a file-based error_log during module startup, for example for an invalid date.timezone value or a session configuration warning, causes the timezone cache to be allocated in startup memory that is freed while a reference to it is kept. A diagnostic raised early in the first request of a worker, such as the max_input_vars warning, then accesses the freed cache. On such a deployment an unauthenticated remote attacker can crash PHP-FPM, Apache mod_php or CGI workers with a...

CWE: CWE-416, CWE-459, CWE-825Aliases: CVE-2026-115560, CVE-2026-126714, CVE-2026-127960, CVE-2026-128064, CVE-2026-128090, CVE-2026-129289, CVE-2026-129291, CVE-2026-129292, CVE-2026-129506, CVE-2026-129538, CVE-2026-15353, GHSA-gr4f-wgx5-jpfv, CVE-2026-129481, CVE-2026-129501NVD: Awaiting Analysis
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

Timezone cache use-after-free can lead to remote code execution

CWE: CWE-416, CWE-459Aliases: CVE-2026-129496