glibc iconv Overflow Turns PHP File Read Bugs Into Remote Code Execution
Vulnerability Disclosure · 2 sources · Updated 5mo ago · First seen May 25, 2026
Researchers detailed how CVE-2024-2961, a long-standing buffer overflow in glibc's iconv implementation for ISO-2022-CN-EXT, can be exploited to achieve remote code execution in PHP applications. The technique, dubbed CNEXT, builds on earlier work around PHP filter chains and error-based file-read oracles, showing how php://filter can be abused not just to read files but to manipulate PHP heap allocations and corrupt internal memory structures. By chaining filters such as convert.iconv, zlib.inflate, and dechunk, the exploit can steer allocator behavior and overwrite zend_mm_heap hooks so that PHP ultimately invokes system().
The write-up says the method is reliable across PHP 7.0.0 through 8.3.7 and can be delivered in a single GET request, significantly raising the impact of otherwise limited file-read primitives. A demonstrated attack used the WordPress BuddyForms flaw CVE-2023-26326 to gain file-read access and then escalate to code execution, while the researchers warned that the same path could affect other PHP file-read sinks, including XXE and SQL injection scenarios involving LOAD DATA LOCAL INFILE. The findings also revive attention on PHP filter-chain abuse first explored in prior research, showing that seemingly minor disclosure bugs can become full server compromise when combined with glibc and PHP internals.


