# CVE-2025-32996: http-proxy-middleware can call writeBody twice because "else if" is not used

> A logic error in http-proxy-middleware allows the response body to be written twice, potentially causing data corruption or unexpected behavior in proxied requests.

- **Severity:** Medium 4.0 (`CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:C/C:N/I:N/A:L`)
- **Exploited in the wild:** Not known
- **Login needed:** Not needed
- **Attackable:** Over the internet
- **Victim action needed:** Not needed
- **Fix available:** Yes
- **Published:** 15 Apr 2025
- **Updated:** 15 Apr 2025
- **Also known as:** CLEANSTART-2026-CL11266, CLSA-2026-1784077482, GHSA-4www-5p9h-95mh, ROOT-APP-NPM-CVE-2025-32996

## What is CVE-2025-32996?

CVE-2025-32996 is a medium-severity vulnerability in chimurai http-proxy-middleware, published on 15 Apr 2025. An attacker can exploit it over the internet without logging in, with no action from the victim.

### Official description

In http-proxy-middleware before 2.0.8 and 3.x before 3.0.4, writeBody can be called twice because "else if" is not used.

Weakness: CWE-670 (Always-Incorrect Control Flow Implementation)

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

4 open source packages ship an affected version, including http-proxy-middleware. It affects 1 product.


| Package | Ecosystem | Affected | Fixed in |
| --- | --- | --- | --- |
| `http-proxy-middleware` | npm | From 1.3.0 | 2.0.8 |
| `http-proxy-middleware` | npm | From 1.3.0 | 2.0.8 |
| `http-proxy-middleware` | npm | From 3.0.0 | 3.0.4 |
| `http-proxy-middleware` | npm | From 3.0.0 | 3.0.4 |

Products: Chimurai Http-Proxy-Middleware.

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

Upgrade http-proxy-middleware to a fixed version for your release line: 2.0.8 or 3.0.4.

## Is CVE-2025-32996 being exploited?

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

## Other vulnerabilities in chimurai http-proxy-middleware

- [CVE-2024-21536](https://insights.sbomify.com/CVE-2024-21536/): Denial of service in http-proxy-middleware (high 8.7)
- [CVE-2026-55603](https://insights.sbomify.com/CVE-2026-55603/): http-proxy-middleware: multipart/form-data field injection via unescaped CRLF in `fixRequestBody` (high 7.5)
- [CVE-2026-55602](https://insights.sbomify.com/CVE-2026-55602/): http-proxy-middleware `router` host+path substring matching allows Host-header-driven backend routing bypass (medium 6.9)
- [CVE-2025-32997](https://insights.sbomify.com/CVE-2025-32997/): http-proxy-middleware allows fixRequestBody to proceed even if bodyParser has failed (medium 4.0)

## Fix prompt for AI coding agents

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

What it is: CVE-2025-32996 is a medium-severity vulnerability in chimurai http-proxy-middleware, published on 15 Apr 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-32996 in the wild and no public exploit code.

Affected packages and fixed versions:
- http-proxy-middleware (npm): affected from 1.3.0; fixed in 2.0.8
- http-proxy-middleware (npm): affected from 1.3.0; fixed in 2.0.8
- http-proxy-middleware (npm): affected from 3.0.0; fixed in 3.0.4
- http-proxy-middleware (npm): affected from 3.0.0; fixed in 3.0.4

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

## Sources

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

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