CVE-2025-32996: Http proxy middleware Http-proxy-middleware Can Call WriteBody Twice Vulnerability

MODERATE
Advisory Identifier: GHSA-4www-5p9h-95mh
CVSS 4.0
CWE-670
Published
Advisory Summary

CVE-2025-32996 is a MODERATE (CVSS 4.0) http-proxy-middleware can call writebody twice vulnerability (CWE-670: Always-Incorrect Control Flow Implementation) affecting Http proxy middleware libraries in the npm ecosystem. The issue involves http-proxy-middleware can call writebody twice because "else if" is not used. Remediation is available by upgrading affected packages to version 2.0.8, 3.0.4.

CVE-2025-32996 at a Glance

CVE Identifier CVE-2025-32996
GHSA Identifier GHSA-4www-5p9h-95mh
Severity MODERATE
CVSS v3.1 Base Score 4.0
CWE Classification CWE-670: Always-Incorrect Control Flow Implementation
Affected Product Http proxy middleware
Package Ecosystem npm
Published Date
Last Updated

Security Impact

CVSS: 4.0

The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:C/C:N/I:N/A:L).

Attack Vector Network (AV:N)
Attack Complexity High (AC:H)
Privileges Required None (PR:N)
User Interaction None (UI:N)
Scope Changed (S:C)
Confidentiality None (C:N)
Integrity None (I:N)
Availability Low (A:L)

How to Fix CVE-2025-32996

To remediate this vulnerability, upgrade all affected Http proxy middleware dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.

http-proxy-middleware fixed: 2.0.8
npm install http-proxy-middleware@2.0.8
http-proxy-middleware fixed: 3.0.4
npm install http-proxy-middleware@3.0.4
Verify Direct and Transitive Dependencies

Run the following command in your project directory to verify that all resolved dependencies use the patched release:

npm ls http-proxy-middleware

How to Check if You Are Affected

To determine whether your Node.js application is affected by CVE-2025-32996, inspect your project dependencies using npm:

npm ls http-proxy-middleware

Analyze the terminal output to locate any version of Http proxy middleware in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 2.0.8), your application is affected.

Note: The npm ls http-proxy-middleware command inspects dependencies declared in your package.json and lockfile; it does not perform automated runtime dynamic scanning.

Technical Details

Vulnerability Mechanism & Technical Analysis

This vulnerability is classified under CWE-670: Always-Incorrect Control Flow Implementation, where the code contains a control flow path that does not reflect the algorithm that the path is intended to implement, leading to incorrect behavior any time this path is navigated. In Http proxy middleware, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.

Source Advisory Statement

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.

CVE-2025-32996 Affected Http proxy middleware Versions

2 component(s)
Fixed Versions:
2.0.83.0.4
Product / Package Ecosystem Affected Versions Fixed Version
http-proxy-middleware
npm
≥ 1.3.0
< 2.0.8
2.0.8
http-proxy-middleware
npm
≥ 3.0.0
< 3.0.4
3.0.4

References

Frequently Asked Questions

What is CVE-2025-32996?
CVE-2025-32996 is a security vulnerability in Http proxy middleware involving http-proxy-middleware can call writeBody twice because "else if" is not used under CWE-670: Always-Incorrect Control Flow Implementation.
Which Http proxy middleware versions are affected?
Affected versions include releases prior to 2.0.8, 3.0.4 across affected packages: http-proxy-middleware.
What version fixes CVE-2025-32996?
Upgrading to 2.0.8, 3.0.4 (or the latest patched release for your respective branch) resolves the vulnerability.
Is http-proxy-middleware affected?
Yes, http-proxy-middleware is affected in releases prior to 2.0.8, 3.0.4. Upgrade your dependency to 2.0.8, 3.0.4 or later.
What is the CVSS score of CVE-2025-32996?
CVE-2025-32996 has a CVSS v3.1 base score of 4.0 (MODERATE) with vector string CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:C/C:N/I:N/A:L.
What CWE is associated with CVE-2025-32996?
CVE-2025-32996 is classified under CWE-670: Always-Incorrect Control Flow Implementation (The code contains a control flow path that does not reflect the algorithm that the path is intended to implement, leading to incorrect behavior any time this path is navigated.).
How can I check npm dependencies for CVE-2025-32996?
Run the dependency tree command: 'npm ls http-proxy-middleware'. This command lists direct and transitive dependencies in your build configuration so you can verify if a vulnerable version is resolved.
Machine-readable OSV JSON OSV v1.5 Schema
Normalized schema output
{
  "schema_version" : "1.4.0",
  "id" : "GHSA-4www-5p9h-95mh",
  "modified" : "2025-04-28T14:27:14Z",
  "published" : "2025-04-15T03:30:34Z",
  "aliases" : [ "CVE-2025-32996" ],
  "summary" : "http-proxy-middleware can call writeBody twice because \"else if\" is not used",
  "details" : "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.",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:C/C:N/I:N/A:L"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "npm",
      "name" : "http-proxy-middleware"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "1.3.0"
      }, {
        "fixed" : "2.0.8"
      } ]
    } ]
  }, {
    "package" : {
      "ecosystem" : "npm",
      "name" : "http-proxy-middleware"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "3.0.0"
      }, {
        "fixed" : "3.0.4"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2025-32996"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/chimurai/http-proxy-middleware/pull/1089"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/chimurai/http-proxy-middleware/commit/020976044d113fc0bcbbaf995e91d05e2829a145"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/chimurai/http-proxy-middleware"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/chimurai/http-proxy-middleware/releases/tag/v2.0.8"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/chimurai/http-proxy-middleware/releases/tag/v3.0.4"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-670" ],
    "severity" : "MODERATE",
    "github_reviewed" : true,
    "github_reviewed_at" : "2025-04-16T15:23:58Z",
    "nvd_published_at" : "2025-04-15T03:15:18Z"
  }
}