{"vuln_id":"CVE-2025-14178","aliases":["CVE-2025-14177","CVE-2025-14180","GHSA-h96m-rvf9-jgm2"],"description":"php8.2 - security update","published_at":"2025-12-18T16:10:32Z","modified_at":"2026-11-20T01:19:12.022466Z","first_seen_at":"2026-11-21T19:15:06.060496Z","severity":"high","severity_source":"cvss","cvss_score":8.2,"cvss_vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:L/A:H","cwe":[],"vendor":null,"product":null,"kev":{"is_kev":false,"date_added":null,"due_date":null,"ransomware":false},"epss":0.00455,"epss_percentile":0.40244,"nvd_status":null,"enriched_at":null,"links":{"nvd":"https://nvd.nist.gov/vuln/detail/CVE-2025-14178"},"matched_alias":null,"items":[{"id":479,"source":{"id":"debian-php","name":"Debian 12 php8.2 (package vulnerabilities)"},"title":"php8.2 (Debian:12): DSA-6154-1 / CVE-2025-14177 - php8.2 - security update","summary":"Affected: Debian:12:php8.2\n\nFixed in: 8.2.30-1~deb12u1","url":"https://osv.dev/vulnerability/DSA-6154-1","published_at":"2026-03-02T00:00:00Z","updated_at":"2026-11-20T01:19:11.565121Z","fetched_at":"2026-11-21T19:15:05.963723Z","severity":"high","cvss_score":8.2,"epss":0.00697,"is_kev":false,"has_exploit":false,"kev_due_date":null,"vendor":"php","product":"php8.2","vuln_id":"CVE-2025-14177","vuln_ids":["CVE-2025-14177","CVE-2025-14178","CVE-2025-14180","DSA-6154-1","GHSA-3237-QQM7-MFV7","GHSA-8XR5-QPPJ-GVWJ","GHSA-H96M-RVF9-JGM2"],"tags":["package-watch","pkg:php8.2","fix-available"],"cluster_id":359,"links":{"self":"https://vulnwatch.ve1ve2.com/api/v1/items/479","html":"https://vulnwatch.ve1ve2.com/item/479"}},{"id":11913,"source":{"id":"debian13-php","name":"Debian 13 php8.4 (package vulnerabilities)"},"title":"php8.4 (Debian:13): DEBIAN-CVE-2025-14178 / CVE-2025-14178 - 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_…","summary":"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.\n\nAffected: Debian:12:php8.2, Debian:13:php8.4, Debian:14:php8.4\n\nFixed in: 8.4.16-1~deb13u1, 8.4.16-1\n\nReferences:\nhttps://security-tracker.debian.org/tracker/CVE-2025-14178","url":"https://osv.dev/vulnerability/DEBIAN-CVE-2025-14178","published_at":"2025-12-27T20:15:40.570000Z","updated_at":"2026-10-14T09:47:33.344153Z","fetched_at":"2026-11-22T13:39:48.366389Z","severity":"high","cvss_score":8.2,"epss":0.00455,"is_kev":false,"has_exploit":false,"kev_due_date":null,"vendor":"php","product":"php8.4","vuln_id":"CVE-2025-14178","vuln_ids":["CVE-2025-14177","CVE-2025-14178","CVE-2025-14180","DEBIAN-CVE-2025-14178","GHSA-H96M-RVF9-JGM2"],"tags":["package-watch","pkg:php8.4","stack","debian13","fix-available"],"cluster_id":360,"links":{"self":"https://vulnwatch.ve1ve2.com/api/v1/items/11913","html":"https://vulnwatch.ve1ve2.com/item/11913"}},{"id":519,"source":{"id":"debian-php","name":"Debian 12 php8.2 (package vulnerabilities)"},"title":"php8.2 (Debian:12): DEBIAN-CVE-2025-14178 / CVE-2025-14178 - 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_…","summary":"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.\n\nAffected: Debian:12:php8.2, Debian:13:php8.4, Debian:14:php8.4\n\nFixed in: 8.2.30-1~deb12u1\n\nReferences:\nhttps://security-tracker.debian.org/tracker/CVE-2025-14178","url":"https://osv.dev/vulnerability/DEBIAN-CVE-2025-14178","published_at":"2025-12-27T20:15:40.570000Z","updated_at":"2026-10-14T09:47:33.344153Z","fetched_at":"2026-11-21T19:15:05.963781Z","severity":"high","cvss_score":8.2,"epss":0.00455,"is_kev":false,"has_exploit":false,"kev_due_date":null,"vendor":"php","product":"php8.2","vuln_id":"CVE-2025-14178","vuln_ids":["CVE-2025-14177","CVE-2025-14178","CVE-2025-14180","DEBIAN-CVE-2025-14178","GHSA-H96M-RVF9-JGM2"],"tags":["package-watch","pkg:php8.2","fix-available"],"cluster_id":360,"links":{"self":"https://vulnwatch.ve1ve2.com/api/v1/items/519","html":"https://vulnwatch.ve1ve2.com/item/519"}},{"id":11897,"source":{"id":"debian13-php","name":"Debian 13 php8.4 (package vulnerabilities)"},"title":"php8.4 (Debian:13): DSA-6088-1 / CVE-2025-14177 - php8.4 - security update","summary":"Affected: Debian:13:php8.4\n\nFixed in: 8.4.16-1~deb13u1","url":"https://osv.dev/vulnerability/DSA-6088-1","published_at":"2025-12-21T00:00:00Z","updated_at":"2026-11-20T01:19:12.022466Z","fetched_at":"2026-11-22T13:39:48.366368Z","severity":"high","cvss_score":8.2,"epss":0.00697,"is_kev":false,"has_exploit":false,"kev_due_date":null,"vendor":"php","product":"php8.4","vuln_id":"CVE-2025-14177","vuln_ids":["CVE-2025-14177","CVE-2025-14178","CVE-2025-14180","DSA-6088-1","GHSA-3237-QQM7-MFV7","GHSA-8XR5-QPPJ-GVWJ","GHSA-H96M-RVF9-JGM2"],"tags":["package-watch","pkg:php8.4","stack","debian13","fix-available"],"cluster_id":359,"links":{"self":"https://vulnwatch.ve1ve2.com/api/v1/items/11897","html":"https://vulnwatch.ve1ve2.com/item/11897"}},{"id":12649,"source":{"id":"gh-php-src","name":"PHP releases (GitHub php/php-src tags)"},"title":"GHSA-h96m-rvf9-jgm2 / CVE-2025-14178: Heap buffer overflow in array_merge()","summary":"Heap buffer overflow in array_merge()\n\nThe following PHP code triggers a reliable heap buffer overflow:\r\n```php\r\n$arr = range(0, 2**29);\r\narray_merge($arr, $arr, $arr, $arr, $arr, $arr, $arr, $arr);\r\n```\r\n\r\nOr the general case:\r\n```php\r\n$power = 24; // You can choose this number 1 <= $power < 32\r\n$arr = range(0, 2**$power);\r\narray_merge(...array_fill(0, 2**(32-$power), $arr));\r\n```\r\n\r\nThis is because packed arrays in array_merge() have an optimization that requires precomputing the count of the elements, done using `count += zend_hash_num_elements(Z_ARRVAL_P(arg));`. However, this may overflow. Note that even if it didn't, it would cause a DoS because array_init() will trigger a bailout with too large counts.\r\n\r\nThe code provided is artificial, but I believe this can happen in the real world with for example large sets of JSON data that are then passed to array_merge(). The total count just has to exceed HT_MAX_SIZE to trigger the DoS or the 32-bit limit to trigger the buffer overflow.\r\n\r\n### Impact\r\n\r\nIf we were using a memory safe language we would \"just\" be limited to the DoS, but now we have heap corruption and all the joys of it.\r\nThis bug has been in PHP since PHP 7.1.\r\n\r\n### Workarounds\r\nPrevent a large number of inputs of long arrays to array_merge().\r\n\r\n### Security impact\r\n\r\nAs noted the example code is just a PoC exploit trigger.\r\n\r\nThe JSON file could be crafted and loaded via json_decode that results in a structure like: [array1, array2, array3, ...]. Then the code could use `array_merge(array1, array2, array3, ...)` from the JSON data. The arrays itself may be relatively small but if the sum of elements exceed the HT_MAX_SIZE bound, the buffer overflow is triggered.\r\n\r\nSomething like this:\r\n\r\n```php\r\n<?php\r\n$array = json_decode(file_get_contents('input.json')); // array of arrays\r\narray_merge(...$array);\r\n```\nPatched:  8.1.34,  8.2.30,  8.3.29,  8.4.16,  8.5.1","url":"https://github.com/php/php-src/security/advisories/GHSA-h96m-rvf9-jgm2","published_at":"2025-12-18T16:10:32Z","updated_at":"2025-12-19T09:47:08Z","fetched_at":"2026-11-22T14:05:37.431187Z","severity":"high","cvss_score":8.2,"epss":0.00455,"is_kev":false,"has_exploit":false,"kev_due_date":null,"vendor":"php","product":"php-src","vuln_id":"CVE-2025-14178","vuln_ids":["CVE-2025-14177","CVE-2025-14178","CVE-2025-14180","GHSA-H96M-RVF9-JGM2"],"tags":["repo-advisory","security","repo:php/php-src","stack"],"cluster_id":11757,"links":{"self":"https://vulnwatch.ve1ve2.com/api/v1/items/12649","html":"https://vulnwatch.ve1ve2.com/item/12649"}}]}