CVE-2025-14178: CWE-787 Out-of-bounds Write in PHP Group PHP
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, a heap buffer overflow occurs in array_merge() when the total element count of packed arrays exceeds 32-bit limits or HT_MAX_SIZE, due to an integer overflow in the precomputation of element counts using zend_hash_num_elements(). This may lead to memory corruption or crashes and affect the integrity and availability of the target server.
AI Analysis
Technical Summary
CVE-2025-14178 is a heap buffer overflow vulnerability identified in multiple 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, and 8.5.* before 8.5.1). The flaw arises in the array_merge() function when it processes packed arrays whose combined element count exceeds the 32-bit integer limit or the internal HT_MAX_SIZE threshold. This condition triggers an integer overflow during the precomputation of element counts via zend_hash_num_elements(), leading to an incorrect allocation size for the heap buffer. Consequently, this results in a heap buffer overflow, causing memory corruption. The corrupted memory state can lead to application crashes or potentially unpredictable behavior affecting the integrity and availability of PHP applications. The vulnerability does not require any privileges or user interaction but has a high attack complexity due to the need to craft arrays exceeding specific size limits. There are no known exploits in the wild at the time of publication. The CVSS v3.1 base score is 6.5, reflecting a medium severity with network attack vector, no privileges required, no user interaction, and impact primarily on availability and integrity. This vulnerability is relevant for any PHP-based web applications or services running affected versions, especially those exposed to untrusted input that could trigger large array merges.
Potential Impact
For European organizations, this vulnerability poses a risk primarily to the availability and integrity of PHP-based web services and applications. Exploitation could lead to denial of service through application crashes or memory corruption, disrupting business operations and potentially causing downtime. While no direct confidentiality impact is indicated, the instability could be leveraged as part of a broader attack chain. Organizations running vulnerable PHP versions on public-facing websites, APIs, or internal tools are at risk, especially those handling large or complex data merges. The medium severity and high attack complexity suggest targeted exploitation rather than widespread automated attacks. However, the widespread use of PHP in Europe across government, finance, e-commerce, and critical infrastructure sectors means the potential impact is significant. Disruptions could affect customer trust, regulatory compliance (e.g., GDPR), and operational continuity. The lack of known exploits currently provides a window for proactive mitigation.
Mitigation Recommendations
1. Upgrade PHP to the fixed versions as soon as they become available: 8.1.34, 8.2.30, 8.3.29, 8.4.16, or 8.5.1 or later. 2. In the interim, audit and limit the use of array_merge() with large or untrusted input arrays, especially those that could exceed 32-bit element counts or HT_MAX_SIZE. 3. Implement input validation and size checks on arrays before merging to prevent triggering the integer overflow condition. 4. Monitor application logs and system metrics for signs of memory corruption, crashes, or abnormal terminations related to PHP processes. 5. Employ web application firewalls (WAFs) with rules to detect and block suspicious payloads that attempt to exploit large array merges. 6. Conduct code reviews and security testing focusing on array handling in PHP applications. 7. Maintain an incident response plan to quickly address potential denial of service incidents. 8. Keep PHP and all dependencies regularly updated to minimize exposure to known vulnerabilities.
Affected Countries
Germany, France, United Kingdom, Italy, Netherlands, Spain, Poland, Sweden
CVE-2025-14178: CWE-787 Out-of-bounds Write in PHP Group PHP
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, a heap buffer overflow occurs in array_merge() when the total element count of packed arrays exceeds 32-bit limits or HT_MAX_SIZE, due to an integer overflow in the precomputation of element counts using zend_hash_num_elements(). This may lead to memory corruption or crashes and affect the integrity and availability of the target server.
AI-Powered Analysis
Technical Analysis
CVE-2025-14178 is a heap buffer overflow vulnerability identified in multiple 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, and 8.5.* before 8.5.1). The flaw arises in the array_merge() function when it processes packed arrays whose combined element count exceeds the 32-bit integer limit or the internal HT_MAX_SIZE threshold. This condition triggers an integer overflow during the precomputation of element counts via zend_hash_num_elements(), leading to an incorrect allocation size for the heap buffer. Consequently, this results in a heap buffer overflow, causing memory corruption. The corrupted memory state can lead to application crashes or potentially unpredictable behavior affecting the integrity and availability of PHP applications. The vulnerability does not require any privileges or user interaction but has a high attack complexity due to the need to craft arrays exceeding specific size limits. There are no known exploits in the wild at the time of publication. The CVSS v3.1 base score is 6.5, reflecting a medium severity with network attack vector, no privileges required, no user interaction, and impact primarily on availability and integrity. This vulnerability is relevant for any PHP-based web applications or services running affected versions, especially those exposed to untrusted input that could trigger large array merges.
Potential Impact
For European organizations, this vulnerability poses a risk primarily to the availability and integrity of PHP-based web services and applications. Exploitation could lead to denial of service through application crashes or memory corruption, disrupting business operations and potentially causing downtime. While no direct confidentiality impact is indicated, the instability could be leveraged as part of a broader attack chain. Organizations running vulnerable PHP versions on public-facing websites, APIs, or internal tools are at risk, especially those handling large or complex data merges. The medium severity and high attack complexity suggest targeted exploitation rather than widespread automated attacks. However, the widespread use of PHP in Europe across government, finance, e-commerce, and critical infrastructure sectors means the potential impact is significant. Disruptions could affect customer trust, regulatory compliance (e.g., GDPR), and operational continuity. The lack of known exploits currently provides a window for proactive mitigation.
Mitigation Recommendations
1. Upgrade PHP to the fixed versions as soon as they become available: 8.1.34, 8.2.30, 8.3.29, 8.4.16, or 8.5.1 or later. 2. In the interim, audit and limit the use of array_merge() with large or untrusted input arrays, especially those that could exceed 32-bit element counts or HT_MAX_SIZE. 3. Implement input validation and size checks on arrays before merging to prevent triggering the integer overflow condition. 4. Monitor application logs and system metrics for signs of memory corruption, crashes, or abnormal terminations related to PHP processes. 5. Employ web application firewalls (WAFs) with rules to detect and block suspicious payloads that attempt to exploit large array merges. 6. Conduct code reviews and security testing focusing on array handling in PHP applications. 7. Maintain an incident response plan to quickly address potential denial of service incidents. 8. Keep PHP and all dependencies regularly updated to minimize exposure to known vulnerabilities.
Affected Countries
Technical Details
- Data Version
- 5.2
- Assigner Short Name
- php
- Date Reserved
- 2025-12-06T06:25:31.535Z
- Cvss Version
- 3.1
- State
- PUBLISHED
Threat ID: 695450badb813ff03e2bf7e2
Added to database: 12/30/2025, 10:22:50 PM
Last enriched: 1/24/2026, 7:10:00 PM
Last updated: 2/7/2026, 4:38:08 AM
Views: 104
Community Reviews
0 reviewsCrowdsource mitigation strategies, share intel context, and vote on the most helpful responses. Sign in to add your voice and help keep defenders ahead.
Want to contribute mitigation steps or threat intel context? Sign in or create an account to join the community discussion.
Actions
Updates to AI analysis require Pro Console access. Upgrade inside Console → Billing.
Need more coverage?
Upgrade to Pro Console in Console -> Billing for AI refresh and higher limits.
For incident response and remediation, OffSeq services can help resolve threats faster.