# CVE-2025-1861: Stream HTTP wrapper truncates redirect location to 1024 bytes

> PHP's HTTP wrapper truncates redirect locations to 1024 bytes, potentially causing incorrect redirections due to non-compliance with RFC9110 recommendations.

- **Severity:** Medium 6.3 (`CVSS:4.0/AV:N/AC:L/AT:P/PR:N/UI:N/VC:L/VI:N/VA:N/SC:N/SI:N/SA:N`)
- **Exploited in the wild:** Not known
- **Login needed:** Not needed
- **Attackable:** Over the internet
- **Victim action needed:** Not needed
- **Fix available:** Yes
- **Published:** 30 Mar 2025
- **Updated:** 3 Nov 2025
- **Also known as:** AZL-59306, AZL-59330, BELL-CVE-2025-1861, BIT-libphp-2025-1861, BIT-php-2025-1861, BIT-php-min-2025-1861, CLSA-2025-1744723009, CLSA-2025-1744783252, DEBIAN-CVE-2025-1861, ECHO-9420-fb00-0db8, GHSA-52jp-hrpf-2jff, MINI-2ppq-hc77-6vv6, MINI-8g9j-2p33-6rxg, MINI-c355-6pfq-p7q4, MINI-xqxw-jc5g-3x6q, UBUNTU-CVE-2025-1861

## What is CVE-2025-1861?

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

### Official description

In PHP from 8.1.* before 8.1.32, from 8.2.* before 8.2.28, from 8.3.* before 8.3.19, from 8.4.* before 8.4.5, when parsing HTTP redirect in the response to an HTTP request, there is currently limit on the location value size caused by limited size of the location buffer to 1024. However as per RFC9110, the limit is recommended to be 8000. This may lead to incorrect URL truncation and redirecting to a wrong location.

Weakness: CWE-131 (Incorrect Calculation of Buffer Size)

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

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


| Package | Ecosystem | Affected | Fixed in |
| --- | --- | --- | --- |
| `libphp` | Bitnami | All versions | 8.1.32, 8.2.28, 8.3.19, 8.4.5 |
| `php` | Bitnami | All versions | 8.1.32, 8.2.28, 8.3.19, 8.4.5 |
| `php-min` | Bitnami | All versions | 8.1.32, 8.2.28, 8.3.19, 8.4.5 |

Products: Netapp Ontap, Php Php.

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

Upgrade libphp to a fixed version for your release line: 8.1.32, 8.2.28, 8.3.19 or 8.4.5.

## Is CVE-2025-1861 being exploited?

There is no known exploitation of CVE-2025-1861 in the wild and no public exploit code.

## Other vulnerabilities in Php Php

- [CVE-2024-8932](https://insights.sbomify.com/CVE-2024-8932/): OOB access in ldap_escape (critical 9.8)
- [CVE-2026-22049](https://insights.sbomify.com/CVE-2026-22049/): Auth bypass in ONTAP 9 (high 8.7)
- [CVE-2026-22050](https://insights.sbomify.com/CVE-2026-22050/): Business logic in ONTAP 9 (medium 6.9)
- [CVE-2025-1734](https://insights.sbomify.com/CVE-2025-1734/): Streams HTTP wrapper does not fail for headers with invalid name and no colon (medium 6.3)
- [CVE-2025-1736](https://insights.sbomify.com/CVE-2025-1736/): Stream HTTP wrapper header check might omit basic auth header (medium 6.3)

## Fix prompt for AI coding agents

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

What it is: CVE-2025-1861 is a medium-severity vulnerability in Php Php, published on 30 Mar 2025. An attacker can exploit it over the internet without logging in, with no action from the victim.
Exploitation: There is no known exploitation of CVE-2025-1861 in the wild and no public exploit code.

Affected packages and fixed versions:
- libphp (Bitnami): affected all versions; fixed in 8.1.32, 8.2.28, 8.3.19, 8.4.5
- php (Bitnami): affected all versions; fixed in 8.1.32, 8.2.28, 8.3.19, 8.4.5
- php-min (Bitnami): affected all versions; fixed in 8.1.32, 8.2.28, 8.3.19, 8.4.5

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-1861/ (Markdown: https://insights.sbomify.com/CVE-2025-1861/index.md)
```

## Sources

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

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