CVE-2025-14177
PHP vulnerability analysis and mitigation

Overview

CVE-2025-14177 is an information disclosure vulnerability in PHP's getimagesize() function that leaks uninitialized heap memory into APPn segments (e.g., APP1) when reading images in multi-chunk mode. It affects PHP versions 8.1.x before 8.1.34, 8.2.x before 8.2.30, 8.3.x before 8.3.29, 8.4.x before 8.4.16, and 8.5.0. The vulnerability was discovered by Nikita Sveshnikov of Positive Technologies and disclosed on December 18–27, 2025 (PHP Advisory). It carries a CVSS v3.1 base score of 7.5 (High) and a CVSS v4.0 base score of 6.3 (Medium) (Red Hat, Oracle).

Technical details

The root cause is a bug in php_read_stream_all_chunks() within ext/standard/image.c (CWE-125: Out-of-bounds Read; also classified as CWE-524: Use of Cache Containing Sensitive Information). When reading image data in multi-chunk mode — such as via php://filter streams — the function overwrites the destination buffer at the start of each chunk without advancing the write pointer, leaving tail bytes uninitialized. These uninitialized heap bytes are then stored into the $info['APP1'] (or other APPn) array entry returned by getimagesize(). An attacker can trigger this by supplying a crafted image file read through a stream filter (e.g., php://filter/read=string.rot13|string.rot13/resource=<file>) to force multi-chunk reads; the attack is more complex on normal image files but feasible if the attacker knows the stream chunk size, which is typically the default (PHP Advisory). A proof-of-concept was published by the researcher alongside the advisory (PHP Advisory).

Impact

Successful exploitation results in disclosure of sensitive uninitialized heap memory from the PHP server process, impacting confidentiality with no effect on integrity or availability. The leaked data may include cryptographic material, session tokens, credentials, or other sensitive server-side data that happened to reside in heap memory adjacent to the image buffer. The vulnerability is exploitable remotely without authentication, making it a meaningful risk for any PHP application that processes user-supplied images using getimagesize() with stream wrappers (PHP Advisory, Red Hat).

Exploitability

A proof-of-concept exploit is publicly available on GitHub, published alongside the security advisory by the discovering researcher (PHP Advisory). Additional PoC code has appeared on Sploitus and GitHub repositories (e.g., gl1tch0x1/PHP_8.1.x_Exploit). There is no confirmed evidence of in-the-wild exploitation at this time, and no threat actor attribution has been reported. The EPSS score is approximately 0.042% (very low probability of exploitation in the near term). The vulnerability is not listed in the CISA Known Exploited Vulnerabilities (KEV) catalog (Feedly).

Exploitation steps

  1. Reconnaissance: Identify PHP applications that accept user-supplied image files and pass them to getimagesize() with the $info parameter, particularly those using stream wrappers or php://filter.
  2. Craft malicious image: Create a minimal valid JPEG file with a controlled APP1 payload of known content and length, designed to be read in multiple chunks by PHP's stream layer.
  3. Force multi-chunk read: Submit the image via a path or URL that triggers php://filter processing (e.g., php://filter/read=string.rot13|string.rot13/resource=<target_file>), ensuring the image data is delivered in multiple stream chunks rather than a single read.
  4. Trigger the bug: When getimagesize($src, $info) processes the multi-chunk stream, php_read_stream_all_chunks() overwrites the buffer from the start on each chunk without advancing the pointer, leaving tail bytes uninitialized.
  5. Extract leaked memory: Retrieve the returned $info['APP1'] value; bytes beyond the last chunk's data will contain uninitialized heap memory. Compare against the expected payload to identify leaked bytes.
  6. Analyze leaked data: Inspect the leaked heap bytes for sensitive content such as session tokens, cryptographic keys, or other in-memory secrets, potentially enabling further attacks (PHP Advisory, PT Security).

Indicators of compromise

  • Network: Unusual or repeated HTTP requests submitting JPEG/image files to endpoints that invoke getimagesize(), particularly with stream filter paths (php://filter) in file parameters.
  • Logs: PHP error logs showing repeated calls to getimagesize() with php://filter URIs or unusual image sources; access logs with large volumes of image upload or processing requests from a single source.
  • File System: Presence of crafted JPEG files with minimal structure but controlled APP1 payloads in upload directories or temporary file locations.
  • Process: PHP worker processes exhibiting unexpected memory access patterns or crashes (segfaults) when processing image files through stream filters, which may indicate exploitation attempts or fuzzing activity.

Mitigation and workarounds

Upgrade PHP to the patched versions: 8.1.34, 8.2.30, 8.3.29, 8.4.16, or 8.5.1 (PHP Advisory). Patches are also available through major Linux distributions including Red Hat (RHSA-2026:1409, RHSA-2026:1429, RHSA-2026:1628, RHSA-2026:2470, RHSA-2026:2799), Debian (DSA-6088-1, DSA-6154-1), Ubuntu (USN-7953-1), Oracle Solaris, and Amazon Linux (Red Hat, Oracle). As a workaround where patching is not immediately possible, restrict or disable the use of php://filter stream wrappers in image processing code, and avoid passing user-controlled paths to getimagesize() with the $info parameter. Review and sanitize all image processing pipelines that accept external input.

Community reactions

The vulnerability was researched and disclosed by Nikita Sveshnikov of Positive Technologies, who published a detailed technical write-up titled "Hack the Elephant One Bite at a Time: JPEG-Related Memory Safety Bugs in PHP" (PT Security). Multiple security news outlets including CyberSecurityNews and CyberPress covered the disclosure under the framing of "malicious JPEG images" triggering PHP memory safety vulnerabilities. The vulnerability appeared in Reddit's CVEWatch "Top 10 Trending CVEs" lists for mid-May 2026, indicating moderate community interest. The PHP project initially did not classify this as a security issue due to the stream filter requirement, but reclassified it after deeper investigation revealed exploitability on normal image files given knowledge of the default chunk size (PHP Advisory).

Additional resources


SourceThis report was generated using AI

Related PHP vulnerabilities:

CVE ID

Severity

Score

Technologies

Component name

CISA KEV exploit

Has fix

Published date

CVE-2026-44741HIGH8.8
  • PHP logoPHP
  • pimcore/admin-ui-classic-bundle
NoYesAug 12, 2026
CVE-2026-47233MEDIUM6.5
  • PHP logoPHP
  • admidio/admidio
NoYesAug 12, 2026
CVE-2026-47132MEDIUM5.4
  • PHP logoPHP
  • thorsten/phpmyfaq
NoYesAug 12, 2026
CVE-2026-47234MEDIUM4.4
  • PHP logoPHP
  • admidio/admidio
NoYesAug 12, 2026
CVE-2026-49262LOW3
  • PHP logoPHP
  • aimeos/pagible
NoYesAug 12, 2026

Free Vulnerability Assessment

Benchmark your Cloud Security Posture

Evaluate your cloud security practices across 9 security domains to benchmark your risk level and identify gaps in your defenses.

Request assessment

Get a personalized demo

Ready to see Wiz in action?

"Best User Experience I have ever seen, provides full visibility to cloud workloads."
David EstlickCISO
"Wiz provides a single pane of glass to see what is going on in our cloud environments."
Adam FletcherChief Security Officer
"We know that if Wiz identifies something as critical, it actually is."
Greg PoniatowskiHead of Threat and Vulnerability Management