9router Authentication Bypass and SSRF via Host Header Spoofing
An authentication bypass in 9router 0.4.80 and earlier allows remote attackers to spoof the 'Host' header, gaining unauthorized access to API proxy endpoints, enabling quota theft via AI relay and server-side request forgery (SSRF).
CVE search metadata
CVE search record: CVE-2026-55641. Severity: high. CVSS: 8.2. EPSS: 0.32%. KEV: no. Product: 9router (<= 0.4.80), 9router (< 0.5.2). Brief: 9router Authentication Bypass and SSRF via Host Header Spoofing. Brief link: https://feed.craftedsignal.io/briefs/2026-08-9router-auth-bypass/
What's new
- 1. added detection rule: Detects CVE-2026-55638 Exploitation - Unauthorized LLM Proxy Access via /codex Aug 28, 21:15 via ghsa
9router versions 0.4.80 and earlier contain a critical authentication bypass vulnerability (CVE-2026-55641) located in the application's request guard logic. The isLocalRequest function determines if a request should be exempt from API authentication by inspecting the client-controlled Host header rather than the actual socket peer address. Because 9router defaults to binding to 0.0.0.0 (all interfaces) while misleadingly reporting the service as bound to "localhost," remote attackers can reach the service and spoof Host: localhost to be treated as local users.
This bypass grants unauthenticated access to the /v1 proxy. Attackers can leverage this to exhaust the victim's paid AI provider quotas (AI relay) or conduct SSRF attacks. The SSRF primitive is particularly severe as the /v1/search endpoint allows arbitrary configuration of the outbound baseUrl via request parameters, enabling attackers to target internal services or cloud metadata endpoints and receive the response directly in the JSON output. The issue is exacerbated by default settings that lack mandatory API key requirements for non-loopback traffic.
Attack Chain
- Attacker identifies an internet-facing 9router instance listening on port 20128.
- Attacker sends a specially crafted HTTP request to the target
/v1/searchor/v1/messagesendpoint. - Attacker sets the HTTP
Hostheader tolocalhostto bypass theisLocalRequestguard check. - 9router middleware incorrectly validates the request as originating from a local source due to the spoofed header.
- The application grants the request bypass-level access, skipping the
hasValidApiKeycheck. - For search requests, the attacker injects an arbitrary
baseUrl(e.g.,http://169.254.169.254/) via theprovider_optionsbody parameter. - 9router's
handleSearchCoreperforms a server-sidefetchto the attacker-supplied URL. - The JSON response from the internal resource is reflected back to the attacker, completing the SSRF or unauthorized relay chain.
Impact
Successful exploitation allows remote, unauthenticated attackers to perform unauthorized actions on behalf of the victim. This results in the depletion of financial credits or usage quotas on connected AI provider accounts, the potential exfiltration of prompts and data via the AI relay, and the ability to map internal networks or exfiltrate cloud metadata via the SSRF primitive. Any deployment of 9router reachable over a network is vulnerable to this attack.
Recommendation
- Upgrade to 9router version 0.5.2 or later immediately to patch the authentication logic.
- If an immediate upgrade is not possible, modify the 9router configuration to bind only to
127.0.0.1and ensure it is not reachable from untrusted networks. - Implement network-level access control (firewall or VPN) to restrict access to port 20128 to known, authorized IP addresses.
- Enable mandatory API key authentication for all requests in the 9router settings, regardless of perceived request origin.
- Use the provided POC methods against lab environments to verify that incoming requests are correctly rejected when the
Hostheader does not match the actual connection source.
Immediate actions
Upgrade all instances of 9router to 0.5.2 or later.
Threat Hunt
Search web logs for 200 OK responses to /v1/ routes originating from non-loopback IPs
Data: c-ip, sc-status, cs-uri-stem
Mitigations
Bind 9router to 127.0.0.1 if currently bound to 0.0.0.0.
CVE-2026-55641
Detection coverage 2
Detect Suspicious Host Header Spoofing Attempting 9router Bypass
highDetects HTTP requests to potential 9router endpoints where the Host header is 'localhost' or '127.0.0.1' but originates from an external network source.
Detects CVE-2026-55638 Exploitation - Unauthorized LLM Proxy Access via /codex
highDetects exploitation attempts against CVE-2026-55638 by monitoring for POST requests to the /codex/ endpoint which bypasses intended authorization gates.
Detection queries are available on the platform. Get full rules →