CVE-2025-14177
Unknown Unknown - Not Provided
Heap Memory Disclosure in PHP getimagesize() Function

Publication date: 2025-12-27

Last updated on: 2025-12-27

Assigner: PHP Group

Description
In PHP versions:8.1.* before 8.1.34, 8.2.* before 8.2.30, 8.3.* before 8.3.29, 8.4.* before 8.4.16, 8.5.* before 8.5.1, the getimagesize() function may leak uninitialized heap memory into the APPn segments (e.g., APP1) when reading images in multi-chunk mode (such as via php://filter). This occurs due to a bug in php_read_stream_all_chunks() that overwrites the buffer without advancing the pointer, leaving tail bytes uninitialized. This may lead to information disclosure of sensitive heap data and affect the confidentiality of the target server.
CVSS Scores
EPSS Scores
Probability:
Percentile:
Meta Information
Published
2025-12-27
Last Modified
2025-12-27
Generated
2026-05-07
AI Q&A
2025-12-27
EPSS Evaluated
2026-05-05
NVD
Affected Vendors & Products
Showing 5 associated CPEs
Vendor Product Version / Range
php php 8.5
php php 8.2
php php 8.3
php php 8.1
php php 8.4
Helpful Resources
Exploitability
CWE
CWE Icon
KEV
KEV Icon
CWE ID Description
CWE-125 The product reads data past the end, or before the beginning, of the intended buffer.
Attack-Flow Graph
AI Powered Q&A
Can you explain this vulnerability to me?

This vulnerability exists in certain PHP versions where the getimagesize() function may leak uninitialized heap memory into APPn segments when reading images in multi-chunk mode. The issue is caused by a bug in the php_read_stream_all_chunks() function that overwrites the buffer without advancing the pointer, leaving some bytes uninitialized. This can result in sensitive heap data being disclosed.


How can this vulnerability impact me? :

The vulnerability can lead to information disclosure of sensitive heap data from the target server, potentially compromising the confidentiality of data processed by the PHP application.


What immediate steps should I take to mitigate this vulnerability?

To mitigate this vulnerability, update PHP to a fixed version: 8.1.34 or later for the 8.1 branch, 8.2.30 or later for the 8.2 branch, 8.3.29 or later for the 8.3 branch, 8.4.16 or later for the 8.4 branch, or 8.5.1 or later for the 8.5 branch. Avoid using the getimagesize() function on untrusted images until the update is applied.


How does this vulnerability affect compliance with common standards and regulations (like GDPR, HIPAA)?:

This vulnerability may lead to information disclosure of sensitive heap data, affecting the confidentiality of the target server. Such leakage of sensitive information could potentially impact compliance with data protection standards and regulations like GDPR and HIPAA, which require safeguarding sensitive data against unauthorized disclosure. Therefore, organizations using vulnerable PHP versions might face compliance risks if this vulnerability is exploited. [1]


How can this vulnerability be detected on my network or system? Can you suggest some commands?

This vulnerability can be detected by running a proof-of-concept (PoC) PHP script that creates a JPEG file with a large APP1 segment to enforce multi-chunk reads, performs a heap spray with a known marker string, and then uses getimagesize() with PHP stream filters to read the image and check for leaked uninitialized heap memory in the APPn segments. The PoC script detects and prints any leaked marker strings or corrupted data snippets. Specific commands involve executing the PoC PHP script (e.g., poc.php) that performs these steps. No direct network detection commands are provided, but running the PoC on your PHP environment can confirm vulnerability presence. [1]


Ask Our AI Assistant
Need more information? Ask your question to get an AI reply (Powered by our expertise)
0/70
EPSS Chart