PHP DateTimeZone Cache Use-After-Free
# CVE-2026-129496 -- PHP DateTimeZone Cache Use-After-Free
<div align="center">
[](https://github.com/LLCForge/CVE-2026-129496)
[](https://nvd.nist.gov/vuln/detail/CVE-2026-129496)
[](https://cwe.mitre.org/data/definitions/416.html)
[](poc.py)
[](https://www.php.net/archive/2026.php)
[](https://github.com/LLCForge)
</div>
---
## Metadata
| Field | Value |
|---|---|
| **CVE ID** | CVE-2026-129496 |
| **Vendor** | The PHP Group |
| **Affected Versions** | PHP 8.2 ≤8.2.35, 8.3 ≤8.3.36, 8.4 ≤8.4.27 |
| **Fixed Version** | PHP 8.2.36 / 8.3.37 / 8.4.28 |
| **Advisory** | PHP Security Advisory, 2026-11-19 |
| **CVSS 3.1** | 7.5 High (AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:H/A:H) |
| **CWE** | CWE-416 — Use After Free |
| **Mechanism** | Race condition in `gc_collect_cycles` on `DateTimeZone` cache entry |
| **Impact** | Information disclosure, potential RCE under concurrent GC race |
---
## Description
CVE-2026-129496 is a use-after-free vulnerability in PHP's `DateTimeZone` extension. PHP caches `DateTimeZone` objects in a per-request timezone cache (`php_date_globals.timezone_cache`). When `gc_collect_cycles()` runs and frees a cached `DateTimeZone` object (due to a circular reference involving a `DateTime`/`DateTimeImmutable`), the global timezone cache still holds a pointer to the freed memory. A subsequent request or operation that reads from the cache dereferences t