Executive brief
9Router is an open-source LLM proxy application that routes AI requests to multiple provider services. An unauthenticated remote attacker can spoof the X-9r-Real-Ip HTTP header to bypass API key authentication and gain unauthorized access to the instance owner's configured LLM provider accounts, including paid API credits and model enumeration capabilities.
Technical details
The vulnerability exists in src/dashboardGuard.js, where the isLocalRequest() function trusts the client-supplied X-9r-Real-Ip header to make authorization decisions. The header is designed to be set only by the trusted custom-server.js wrapper layer (derived from the unspoofable TCP socket address). However, when 9Router is deployed without custom-server.js, Next.js passes the attacker-supplied header through unchanged. An attacker can send a normal request to /api/v1/models (receiving 401 Unauthorized), then re-send with X-9r-Real-Ip: 127.0.0.1 added, causing canAccessPublicLlmApi() to skip the API-key validation and grant access. The attack requires network reachability to the service (default bind 0.0.0.0) but no authentication or user interaction. Consequences include unauthorized consumption of paid LLM provider API credits, financial loss, upstream provider account abuse, and model enumeration. The vulnerability is fixed in version 0.5.8.
Affected products
- 9Router 9router < 0.5.8
Timeline
- 2026-09-22: disclosed
- 2026: patched: Fixed in version 0.5.8