PHP Patches JPEG Parsing Flaws in `getimagesize` and `iptcembed`
Vulnerability Disclosure · 2 sources · Updated 5mo ago · First seen May 15, 2026

PHP has patched two memory-safety vulnerabilities in its ext/standard image-handling code that can be triggered by specially crafted JPEG input. One issue, tracked as CVE-2025-14177, affects getimagesize and can disclose uninitialized heap memory when JPEG APP segments are read across multiple chunks, potentially exposing server-side data through returned metadata such as APP1. A second flaw in iptcembed can cause a heap buffer overflow and denial of service because the function sizes its output buffer from a single fstat() result and then continues copying data until EOF, creating risk when processing FIFOs, pipes, sockets, or files that grow after the initial size check.
The bugs were discovered by Positive Technologies researcher Nikita Sveshnikov, who published proof-of-concept demonstrations showing both filter-based and direct exploitation paths for getimagesize, as well as a FIFO-based overflow scenario for iptcembed. PHP addressed the flaws by correcting chunk-buffer pointer handling in php_read_stream_all_chunks and adding boundary checks and safer error handling for iptcembed; fixes were released in PHP 8.1.34, 8.2.30, 8.3.29, 8.4.16, and 8.5.1. The most exposed deployments include public upload endpoints, CMS thumbnailing workflows, webmail platforms, and image CDNs that inspect user-supplied images on the server side.


