Burning Tears of PHP's Memory Hardening

No ratings

Presented at Black Hat USA 2026 by

PHP introduced new heap hardening measures for its heap allocator, ZendMM, in April 2024.This Briefing asks a simple question: how much protection do these latest mitigations really buy against a determined attacker?We present the first systematic study of the four new mitigations and show two results.First, one mitigation had a real implementation flaw. We responsibly disclosed it, and PHP has since patched it.Second, even with the current protections enabled, weak bugs such as a single-byte out-of-bounds write can still be turned into working exploit chains.Our first core technique is a widely applicable one-shot heap fengshui strategy that works within a single request. With one carefully prepared zend_array access, it simultaneously achieves four primitives in a single exploit step: {out-of-bounds access, use-before-initialization, use-after-free, and arbitrary free}.Our second core technique begins with the result of the one-shot pivot and builds on it to achieve stronger exploitation capabilities. We name the second technique zval-oriented programming, or ZOP. Because ZOP operates on the most common object in the PHP interpreter, it provides a powerful exploitation framework for a broad range of common OOB and UAF bugs.We validate that claim experimentally across five real vulnerabilities in a fully protected environment.Our results show that the new hardening blocks several old exploit paths, yet still leaves room for determined attackers to adapt.