CVE-2025-14177
Heap Memory Disclosure in PHP getimagesize() Function
Publication date: 2025-12-27
Last updated on: 2025-12-27
Assigner: PHP Group
Description
Description
CVSS Scores
EPSS Scores
| Probability: | |
| Percentile: |
Meta Information
Affected Vendors & Products
| 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 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]