# CVE-2025-14178: Heap buffer overflow in array_merge()

> An integer overflow in PHP's array_merge function can cause heap buffer overflows, leading to crashes or potential code execution on affected servers.

- **Severity:** Medium 6.5 (`CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:N/I:L/A:H`)
- **Exploited in the wild:** Not known
- **Login needed:** Not needed
- **Attackable:** Over the internet
- **Victim action needed:** Not needed
- **Fix available:** Yes
- **Published:** 27 Dec 2025
- **Updated:** 24 Jan 2026
- **Also known as:** AZL-73198, AZL-73237, BELL-CVE-2025-14178, BIT-libphp-2025-14178, BIT-php-2025-14178, BIT-php-min-2025-14178, CLSA-2025-1766599216, CLSA-2025-1766599555, CLSA-2025-1767120767, CLSA-2026-1768299147, CLSA-2026-1768300005, CLSA-2026-1768580474, CLSA-2026-1769164237, CLSA-2026-1769164564, CLSA-2026-1769445556, DEBIAN-CVE-2025-14178, DLA-4447-1, ECHO-cb9e-7afb-1de8, GHSA-h96m-rvf9-jgm2, MINI-hgcc-8xq5-fv7p, MINI-hwj3-pm52-2g5p, MINI-jqc3-4vqx-5ff2, MINI-mx9r-j394-fpm4, MINI-xhxg-mr47-5v7m, RHSA-2026:4077, RHSA-2026:4086, RHSA-2026:4212, RHSA-2026:4266, RHSA-2026:4507, RHSA-2026:4514, RHSA-2026:4517, SUSE-SU-2026:0245-1, UBUNTU-CVE-2025-14178

## What is CVE-2025-14178?

CVE-2025-14178 is a medium-severity vulnerability in Php Php, published on 27 Dec 2025. An attacker can exploit it over the internet without logging in, with no action from the victim.

### Official 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.

Weakness: CWE-787 (Out-of-bounds Write), CWE-190 (Integer Overflow or Wraparound)

## Which versions are affected by CVE-2025-14178?

3 open source packages ship an affected version, including libphp, php and php-min. It affects 1 product.


| Package | Ecosystem | Affected | Fixed in |
| --- | --- | --- | --- |
| `libphp` | Bitnami | All versions | 8.1.34, 8.2.30, 8.3.29, 8.4.16, 8.5.1 |
| `php` | Bitnami | All versions | 8.1.34, 8.2.30, 8.3.29, 8.4.16, 8.5.1 |
| `php-min` | Bitnami | All versions | 8.1.34, 8.2.30, 8.3.29, 8.4.16, 8.5.1 |
| `apcu-panel` | Red Hat:rhel_aus:8.4::appstream | All versions | 0:5.1.18-1.module+el8.3.0+6678+b09f589e |
| `libzip` | Red Hat:rhel_aus:8.4::appstream | All versions | 0:1.6.1-1.module+el8.3.0+6678+b09f589e |
| `libzip-debuginfo` | Red Hat:rhel_aus:8.4::appstream | All versions | 0:1.6.1-1.module+el8.3.0+6678+b09f589e |
| `libzip-debugsource` | Red Hat:rhel_aus:8.4::appstream | All versions | 0:1.6.1-1.module+el8.3.0+6678+b09f589e |
| `libzip-devel` | Red Hat:rhel_aus:8.4::appstream | All versions | 0:1.6.1-1.module+el8.3.0+6678+b09f589e |
| `libzip-tools` | Red Hat:rhel_aus:8.4::appstream | All versions | 0:1.6.1-1.module+el8.3.0+6678+b09f589e |
| `libzip-tools-debuginfo` | Red Hat:rhel_aus:8.4::appstream | All versions | 0:1.6.1-1.module+el8.3.0+6678+b09f589e |
| `php` | Red Hat:rhel_aus:8.4::appstream | All versions | 0:7.4.6-5.module+el8.4.0+24050+df93a449.2 |
| `php-bcmath` | Red Hat:rhel_aus:8.4::appstream | All versions | 0:7.4.6-5.module+el8.4.0+24050+df93a449.2 |
| `php-bcmath-debuginfo` | Red Hat:rhel_aus:8.4::appstream | All versions | 0:7.4.6-5.module+el8.4.0+24050+df93a449.2 |
| `php-cli` | Red Hat:rhel_aus:8.4::appstream | All versions | 0:7.4.6-5.module+el8.4.0+24050+df93a449.2 |
| `php-cli-debuginfo` | Red Hat:rhel_aus:8.4::appstream | All versions | 0:7.4.6-5.module+el8.4.0+24050+df93a449.2 |
| `php-common` | Red Hat:rhel_aus:8.4::appstream | All versions | 0:7.4.6-5.module+el8.4.0+24050+df93a449.2 |
| `php-common-debuginfo` | Red Hat:rhel_aus:8.4::appstream | All versions | 0:7.4.6-5.module+el8.4.0+24050+df93a449.2 |
| `php-dba` | Red Hat:rhel_aus:8.4::appstream | All versions | 0:7.4.6-5.module+el8.4.0+24050+df93a449.2 |
| `php-dba-debuginfo` | Red Hat:rhel_aus:8.4::appstream | All versions | 0:7.4.6-5.module+el8.4.0+24050+df93a449.2 |
| `php-dbg` | Red Hat:rhel_aus:8.4::appstream | All versions | 0:7.4.6-5.module+el8.4.0+24050+df93a449.2 |
| `php-dbg-debuginfo` | Red Hat:rhel_aus:8.4::appstream | All versions | 0:7.4.6-5.module+el8.4.0+24050+df93a449.2 |
| `php-debuginfo` | Red Hat:rhel_aus:8.4::appstream | All versions | 0:7.4.6-5.module+el8.4.0+24050+df93a449.2 |
| `php-debugsource` | Red Hat:rhel_aus:8.4::appstream | All versions | 0:7.4.6-5.module+el8.4.0+24050+df93a449.2 |
| `php-devel` | Red Hat:rhel_aus:8.4::appstream | All versions | 0:7.4.6-5.module+el8.4.0+24050+df93a449.2 |
| `php-embedded` | Red Hat:rhel_aus:8.4::appstream | All versions | 0:7.4.6-5.module+el8.4.0+24050+df93a449.2 |
| `php-embedded-debuginfo` | Red Hat:rhel_aus:8.4::appstream | All versions | 0:7.4.6-5.module+el8.4.0+24050+df93a449.2 |
| `php-enchant` | Red Hat:rhel_aus:8.4::appstream | All versions | 0:7.4.6-5.module+el8.4.0+24050+df93a449.2 |
| `php-enchant-debuginfo` | Red Hat:rhel_aus:8.4::appstream | All versions | 0:7.4.6-5.module+el8.4.0+24050+df93a449.2 |
| `php-ffi` | Red Hat:rhel_aus:8.4::appstream | All versions | 0:7.4.6-5.module+el8.4.0+24050+df93a449.2 |
| `php-ffi-debuginfo` | Red Hat:rhel_aus:8.4::appstream | All versions | 0:7.4.6-5.module+el8.4.0+24050+df93a449.2 |
| `php-fpm` | Red Hat:rhel_aus:8.4::appstream | All versions | 0:7.4.6-5.module+el8.4.0+24050+df93a449.2 |
| `php-fpm-debuginfo` | Red Hat:rhel_aus:8.4::appstream | All versions | 0:7.4.6-5.module+el8.4.0+24050+df93a449.2 |
| `php-gd` | Red Hat:rhel_aus:8.4::appstream | All versions | 0:7.4.6-5.module+el8.4.0+24050+df93a449.2 |
| `php-gd-debuginfo` | Red Hat:rhel_aus:8.4::appstream | All versions | 0:7.4.6-5.module+el8.4.0+24050+df93a449.2 |
| `php-gmp` | Red Hat:rhel_aus:8.4::appstream | All versions | 0:7.4.6-5.module+el8.4.0+24050+df93a449.2 |
| `php-gmp-debuginfo` | Red Hat:rhel_aus:8.4::appstream | All versions | 0:7.4.6-5.module+el8.4.0+24050+df93a449.2 |
| `php-intl` | Red Hat:rhel_aus:8.4::appstream | All versions | 0:7.4.6-5.module+el8.4.0+24050+df93a449.2 |
| `php-intl-debuginfo` | Red Hat:rhel_aus:8.4::appstream | All versions | 0:7.4.6-5.module+el8.4.0+24050+df93a449.2 |
| `php-json` | Red Hat:rhel_aus:8.4::appstream | All versions | 0:7.4.6-5.module+el8.4.0+24050+df93a449.2 |
| `php-json-debuginfo` | Red Hat:rhel_aus:8.4::appstream | All versions | 0:7.4.6-5.module+el8.4.0+24050+df93a449.2 |

Products: Php Php.

## How do I fix CVE-2025-14178?

Upgrade libphp to a fixed version for your release line: 8.1.34, 8.2.30, 8.3.29 or 8.4.16.

## Is CVE-2025-14178 being exploited?

It is not confirmed as exploited in the wild, but public exploit code for CVE-2025-14178 exists.

## Other vulnerabilities in Php Php

- [CVE-2012-2688](https://insights.sbomify.com/CVE-2012-2688/): Integer overflow in n/a (critical 10.0)
- [CVE-2012-2376](https://insights.sbomify.com/CVE-2012-2376/): Memory corruption in n/a (critical 10.0)
- [CVE-2011-3268](https://insights.sbomify.com/CVE-2011-3268/): Memory corruption in n/a (critical 10.0)
- [CVE-2009-4143](https://insights.sbomify.com/CVE-2009-4143/): Other in n/a (critical 10.0)
- [CVE-2008-5557](https://insights.sbomify.com/CVE-2008-5557/): Memory corruption in n/a (critical 10.0)

## Fix prompt for AI coding agents

```text
Check this codebase for CVE-2025-14178 and fix it if it is affected.

What it is: CVE-2025-14178 is a medium-severity vulnerability in Php Php, published on 27 Dec 2025. An attacker can exploit it over the internet without logging in, with no action from the victim.
Exploitation: It is not confirmed as exploited in the wild, but public exploit code for CVE-2025-14178 exists.

Affected packages and fixed versions:
- libphp (Bitnami): affected all versions; fixed in 8.1.34, 8.2.30, 8.3.29, 8.4.16, 8.5.1
- php (Bitnami): affected all versions; fixed in 8.1.34, 8.2.30, 8.3.29, 8.4.16, 8.5.1
- php-min (Bitnami): affected all versions; fixed in 8.1.34, 8.2.30, 8.3.29, 8.4.16, 8.5.1

Task:
1. Search the dependency manifests and lockfiles (for example package.json, package-lock.json, requirements.txt, poetry.lock, uv.lock, pom.xml, build.gradle, go.mod, Cargo.lock, Gemfile.lock) and any Dockerfiles for the affected packages, including transitive dependencies.
2. If an affected version is in use, upgrade it to the fixed version for its release line with the project's package manager, so the lockfile is regenerated. Prefer the smallest upgrade that fixes it.
3. If there is no fix, or the upgrade would break the build, do not guess: explain the risk and the safest workaround instead.
4. Run the tests and summarise what changed and why.
5. If nothing in the project is affected, say so and change nothing.

Reference: https://insights.sbomify.com/CVE-2025-14178/ (Markdown: https://insights.sbomify.com/CVE-2025-14178/index.md)
```

## Sources

- CVE record: https://www.cve.org/CVERecord?id=CVE-2025-14178
- NVD: https://nvd.nist.gov/vuln/detail/CVE-2025-14178
- OSV: https://osv.dev/vulnerability/CVE-2025-14178

---
From sbomify Insights: https://insights.sbomify.com/CVE-2025-14178/
Summaries are generated and may contain mistakes; the official description above is the record.
