chore(deps): update dependency http-proxy-middleware to v3.0.7 [security]#8318
Merged
renovate[bot] merged 1 commit intoJun 18, 2026
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR contains the following updates:
3.0.5→3.0.7http-proxy-middleware
routerhost+path substring matching allows Host-header-driven backend routing bypassCVE-2026-55602 / GHSA-64mm-vxmg-q3vj
More information
Details
Summary
http-proxy-middlewaredocumentsrouterproxy-table entries as host, path, or host+path selectors, but the host+path implementation uses unanchored substring matching on attacker-controlled request metadata. As a result, a craftedHostheader that is only a superstring match for a configured host+path key can still route a request to an unintended backend.Details
Tested code state:
v4.0.0-beta.5339f09ede860197807d4fd99ed9020fa5d0bd358Relevant code locations:
src/router.tssrc/http-proxy-middleware.tsAffected public API:
createProxyMiddleware({ router: { 'host/path': 'http://target' } })Code explanation:
When a proxy-table router key contains
/,getTargetFromProxyTable()concatenates attacker-controlledreq.headers.hostandreq.urlinto a singlehostAndPathstring, then accepts the route if:That is a substring test, not an exact host match plus intended path match. In the validated PoC, the configured router key is:
but the attacker-controlled host is:
and the request path is:
The concatenated attacker-controlled string:
still contains the configured router key as a substring, so the middleware selects the alternate backend even though the host is not equal to the configured host.
Exploit path:
routerfeature with at least one host+path ruleHostheaderHttpProxyMiddleware.prepareProxyRequest()applies router selection before proxyinggetTargetFromProxyTable()accepts the craftedHost + pathstring through substring matchingPoC
Create these files in the same working directory and run:
File:
run.shFile:
DockerfileFile:
verify.mjsThis PoC starts:
DEFAULTSECRETIt then sends:
/apiwithHost: safe.example:3000/apiwithHost: evillocalhost:3000Observed result from the validated PoC:
STEP baseline-route body=DEFAULTSTEP crafted-route body=SECRETRESULT reproduced host_header_injection router substring match bypassThe PoC is considered successful only if:
Impact
This is a backend-selection integrity issue in a documented library feature. Applications that use host+path router-table rules for backend segmentation, tenant routing, or separation of public and more sensitive upstreams can have that routing boundary bypassed by an unauthenticated external client using an ordinary crafted
Hostheader.Severity
CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:N/VI:L/VA:N/SC:N/SI:N/SA:NReferences
This data is provided by the GitHub Advisory Database (CC-BY 4.0).
http-proxy-middleware: multipart/form-data field injection via unescaped CRLF in
fixRequestBodyCVE-2026-55603 / GHSA-gcq2-9pq2-cxqm
More information
Details
Summary
fixRequestBody()is the library's documented helper for re-emitting a request body that was already consumed by a body parser. When the outgoingContent-Typeismultipart/form-data, it rebuilds the body withhandlerFormDataBodyData(), which interpolates eachreq.bodykey and value directly into the multipart wire format without neutralizing CR/LF:A
\r\ninside a value (or key) lets an attacker close the current part and inject an entirely new form part. Because the proxy's own body parser saw a single opaque value, any gateway-side policy or validation performed onreq.bodyis evaluated against a different set of fields than the upstream backend ultimately parses a request/parameter desynchronization across the trust boundary.By contrast, the sibling output branches are safe:
application/jsonusesJSON.stringify(escapes control chars) andapplication/x-www-form-urlencodedusesquerystring.stringify(percent-encodes). Only the multipart branch lacks escaping.Preconditions
All three must hold; this narrows real-world exposure and is the basis for
AC:H:req.bodywith a non-multipart parser (express.urlencoded,express.json, or text) so an injected boundary in a value is not split on input.multipart/form-data(e.g. an adaptation layer, or any flow that sets the upstream content-type to multipart), so the vulnerable branch runs.fixRequestBody(the documented pattern for "I body-parsed, now re-stream"), and an attacker controls at least one body field value or key.Impact
When the preconditions hold, an attacker injects/overrides multipart fields seen only by the backend:
role=adminis bypassed; backend grants admin).filename="..."part into the upstream multipart stream.Proof of Concept
Output: one input field becomes two parts;
role=adminwas injected via the unescaped CRLF:req.bodyhad a single key (user), so any gateway policy checkingreq.body.rolepasses, yet the backend's multipart parser receivesrole=admin. On the wire the attacker simply sends, asapplication/x-www-form-urlencoded:user=alice%0D%0A--BB%0D%0AContent-Disposition:%20form-data;%20name="role"%0D%0A%0D%0Aadmin%0D%0A--BB--Remediation
Neutralize CR/LF (and
") in keys/values before interpolation, or build the body with a real multipart encoder (e.g.FormData/form-data) instead of string concatenation. Minimal fix:(Reject is preferable to silent stripping, to avoid masking malicious input.)
Severity
CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:C/C:L/I:H/A:NReferences
This data is provided by the GitHub Advisory Database (CC-BY 4.0).
Release Notes
chimurai/http-proxy-middleware (http-proxy-middleware)
v3.0.7Compare Source
What's Changed
Full Changelog: chimurai/http-proxy-middleware@v3.0.6...v3.0.7
v3.0.6Compare Source
What's Changed
node:protocol imports by @chimurai in #1127New Contributors
Full Changelog: chimurai/http-proxy-middleware@v3.0.5...v3.0.6
Configuration
📅 Schedule: (UTC)
🚦 Automerge: Enabled.
♻ Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.
🔕 Ignore: Close this PR and you won't be reminded about this update again.
This PR was generated by Mend Renovate. View the repository job log.