/

CVE-2026-55602

Severity:

HIGH RISK

(8.6)

Host Header Routing Flaw (CWE-187) in Node Proxy

CVE-2026-55602

Analyzed

Vulnerability type

Category:

Improper Request Routing / Host Header Handling

CWE:

CWE-20, CWE-187

Impact:

Unauthorized Request Routing / Backend Access

Severity:

HIGH RISK

(8.6)

CVSS version:

3.1

Catch this CVE while code is being written

Detect vulnerable code directly in pull requests, so CVEs are fixed before merge.

Summary

A routing flaw in http-proxy-middleware allows crafted Host headers to be matched via unanchored substrings against router proxy-table host+path entries.

Under certain configurations, this can cause requests to be proxied to unintended backends, enabling abuse of internal services or bypass of expected routing controls.

Affected context

This vulnerability appears in Node.js applications that rely on http-proxy-middleware's router proxy-table using host+path selectors. It is relevant where upstream routing decisions are made based on the Host header, and multiple backends are configured behind a single entry point. Systems are most exposed when internal or privileged services are reachable via proxy rules that expect exact host+path matches, but do not enforce strict hostname validation or normalization on incoming requests.

Exploit preconditions

  • Attack surface: HTTP endpoints fronted by http-proxy-middleware using router proxy-table host+path rules.
  • Required access: Ability to send arbitrary HTTP requests to the application, including controlling the Host header and URL path.
  • Trigger point: The router logic evaluates the attacker-supplied Host header and path against configured host+path keys using substring matching.
  • Why exploitation is possible: The host+path comparison logic is not anchored or normalized, so superstring or partial matches can satisfy routing rules intended for more specific hostnames, causing misrouting to backends not meant for the requester.

Why this happens

The underlying issue is an input validation and comparison flaw in routing logic. The router proxy-table documentation describes host+path selectors as if they were precise identifiers, but the implementation uses unanchored substring matching against attacker-controlled request metadata. This corresponds to CWE-187: Partial Comparison and CWE-20: Improper Input Validation, where untrusted Host headers and paths are not strictly validated or canonicalized before being used for security-sensitive routing decisions. As a result, a request whose Host header merely contains a configured key as a substring can be treated as a valid match.

Potential impact

  • Requests may be routed to unintended internal or privileged backends.
  • Attackers could access internal admin APIs or microservices indirectly exposed via proxy rules.
  • Security controls that rely on hostname-based separation can be bypassed.
  • Misrouted traffic can lead to data exposure or modification in backends not meant to serve the attacker.
  • Confusion in logging and monitoring due to traffic appearing under unexpected routes.

General mitigation guidance

Effective mitigation focuses on treating routing criteria as security-sensitive inputs and enforcing strict comparisons. Common patterns include:

  • Using exact, anchored hostname and path matching rather than substring or partial comparisons.
  • Normalizing and validating Host headers and request paths before using them in routing decisions.
  • Restricting reliance on client-controlled Host headers when determining backend selection; prefer explicit configuration or trusted headers added by front proxies.
  • Designing proxy rules so internal or sensitive backends are not reachable solely based on host+path matching, and applying additional authorization checks.
  • Applying defense-in-depth controls such as network segmentation and least-privilege access for backends behind the proxy.

How teams detect issues like this

Detection typically involves reviewing routing and proxy configurations for partial or substring-based matching:

  • Static analysis or configuration linting to flag non-anchored matches on Host or path values used for backend selection.
  • Code review focused on how http-proxy-middleware's router proxy-table is configured, checking for assumptions of exact matches.
  • Security tests that fuzz Host headers and paths to observe whether requests can be routed to unintended backends.
  • Policy enforcement that requires strict equality or pattern anchoring for host/path routing rules and discourages direct use of untrusted Host headers.
  • Use of automated review tools that understand common Node.js proxy patterns and can highlight unsafe routing logic.

Sources

SourceLink
github.comgithub.com/chimurai/http-proxy-middleware/security/advisories/GHSA-64mm-vxmg-q3vj

Frequently asked

questions

Yes. Any attacker who can send HTTP requests to an endpoint using http-proxy-middleware with host+path router rules can potentially craft Host headers and paths to trigger unintended routing.

Not inherently. If the vulnerable routes are publicly reachable, exploitation only requires the ability to control request headers and paths. However, if the proxy rules are only accessible after authentication, then an attacker would need whatever access is required to reach those routes.

The safest approach is to enforce strict, anchored comparisons for host and path routing keys, coupled with normalization and validation of the Host header. Routing decisions should not depend on substring matches of attacker-controlled metadata, and sensitive backends should have additional access controls beyond hostname checks.

Treat routing criteria as part of the security boundary: validate and canonicalize inputs, avoid partial comparisons, and use explicit, well-defined rules for backend selection. Incorporate security-focused reviews of proxy and routing configurations, and consider automated checks that flag reliance on untrusted Host headers or unanchored pattern matching.

Find out what's already
exploitable in your codebase.