/

CVE-2026-55641

Severity:

HIGH RISK

(8.2)

Host Header Trust (CWE-290) in 9Router LLM Proxy

CVE-2026-55641

Deferred

Vulnerability type

Category:

Authentication Bypass via Header Spoofing

CWE:

CWE-290, CWE-348, CWE-918, CWE-1327

Impact:

Authentication Bypass and Server-Side Request Forgery

Severity:

HIGH RISK

(8.2)

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

9Router incorrectly trusts the client-supplied Host header to decide whether a /v1 LLM proxy request is local, enabling attackers to spoof localhost and bypass API-key checks.

When exposed in its default configuration, this can let unauthenticated remote users invoke upstream AI providers with stored credentials and drive server-side requests toward internal or metadata endpoints.

Affected context

This vulnerability affects 9Router deployments that:

  • Expose the /v1 LLM proxy endpoint over a network interface
  • Use Host-based logic to treat localhost as implicitly trusted
  • Store provider credentials for upstream AI services
  • Enable /v1/search with configurable provider_options.baseUrl values

In this context, the router relies on HTTP headers under client control to distinguish local traffic, rather than checking the actual connection source or enforcing strong authentication on all external requests.

Exploit preconditions

  • Attack surface: Publicly or internally reachable 9Router HTTP endpoints under /v1 and /v1/search
  • Required access: Remote, unauthenticated HTTP access; no prior credentials needed
  • Trigger point: Sending requests with a forged Host: localhost header (or similar trusted value) to /v1 endpoints
  • Why exploitation is possible:
  • The router interprets the Host header as evidence of a local request
  • Local requests are treated as trusted and allowed to bypass API-key authentication
  • For /v1/search, user-controlled provider_options.baseUrl is used to construct outgoing requests, enabling SSRF toward internal or cloud-metadata hosts

Why this happens

The core issue is a trust decision based on client-controlled HTTP metadata, specifically the Host header, which is not a reliable indicator of the request's true origin.

This maps primarily to CWE-290: Authentication Bypass by Spoofing and CWE-348: Use of Incorrectly-Resolved Name or Service, where security logic incorrectly relies on name resolution or header values rather than actual connection properties.

Additionally, allowing user-controlled base URLs to drive backend HTTP requests matches CWE-918: Server-Side Request Forgery, with CWE-1327 reflecting the conflation of external and internal trust boundaries.

Abstractly, the pattern is: "treat a syntactic property of a request (header or URL) as proof of trustworthiness," leading to both authentication bypass and SSRF.

Potential impact

  • Unauthenticated use of stored upstream provider credentials to invoke LLM APIs
  • Consumption of quota or incurring cost on third-party AI providers without authorization
  • Server-Side Request Forgery (SSRF) to internal services reachable from the router
  • Access to cloud metadata services, potentially exposing credentials or tokens
  • Indirect exposure of internal network topology through error responses or timing differences
  • Expansion of an attacker's foothold by chaining SSRF with other internal weaknesses

General mitigation guidance

Effective mitigation focuses on separating trust decisions from client-controlled headers and constraining outbound requests:

  • Treat all external HTTP requests as untrusted by default, regardless of Host, and require explicit authentication for sensitive routes.
  • Base "local" or "internal" checks on connection-level attributes (e.g., server binding, source IP, or listener configuration), not on Host or other headers.
  • Introduce a strict allowlist for any outbound base URLs used by /v1/search and similar features, restricting them to known, trusted domains or services.
  • Normalize and validate any user-provided URLs, rejecting IP literals, link-local addresses, and metadata endpoints by pattern or network range.
  • Isolate routing components with least privilege, limiting their ability to reach internal networks or cloud metadata endpoints at the network or firewall layer.
  • Prefer configuration-driven trust (e.g., explicit internal endpoints configuration) over implicit trust derived from request headers.

How teams detect issues like this

Detecting this type of issue and its exploitation typically involves a combination of code-level and operational techniques:

  • Static analysis and code review:
  • Search for logic that bases authentication or trust on Host, X-Forwarded-Host, or similar headers.
  • Flag any routing or access-control conditions that compare header values against "localhost" or internal hostnames.
  • Identify code paths where user-controlled URL fields (such as provider_options.baseUrl) are used directly to make backend HTTP requests.
  • Configuration and policy checks:
  • Enforce policies that disallow arbitrary outbound connections from router components, or require explicit allowlists.
  • Use security linters or automated review tools to enforce patterns like "no trust decisions based on Host."
  • Runtime monitoring:
  • Log and monitor Host headers and baseUrl parameters for anomalous values (e.g., localhost, 127.0.0.1, 169.254.169.254).
  • Enable alerting on outbound requests from the router to sensitive ranges (internal IPs, metadata services).
  • Correlate unexpected spikes in upstream provider usage with incoming requests lacking authentication tokens.

Sources

SourceLink
github.comgithub.com/decolua/9router/commit/b282f0554972ea35281520738759d76abcd0b0b3
github.comgithub.com/decolua/9router/releases/tag/v0.5.2
github.comgithub.com/decolua/9router/security/advisories/GHSA-86m2-fcxq-5q7c

Frequently asked

questions

Yes. As long as the 9Router instance is reachable over the network, a remote attacker can exploit the issue by sending HTTP requests with a forged Host header, without requiring prior authentication.

The attacker only needs network access to the affected /v1 endpoints. They do not need valid API keys or accounts, because the vulnerability centers on bypassing the API-key authentication layer by appearing as a trusted local request.

The robust fix pattern is to decouple trust decisions from client-controlled headers and ensure all externally reachable endpoints enforce authentication consistently. Additionally, constrain any user-configurable outbound base URLs via allowlists, validation, and network controls so they cannot be used for SSRF.

Future prevention relies on clear trust-boundary design and systematic checks: define "local" and "internal" status based on deployment configuration or connection properties, not on headers; subject any dynamic URLs or endpoints to strict validation and allowlisting; and incorporate security reviews or automated rules that flag header-based trust logic and unbounded outbound HTTP calls during development.

Find out what's already
exploitable in your codebase.