Sep 22, 2026·6 min read·16 visits
An authentication bypass in 9Router allows remote attackers to spoof their IP address via the X-9r-Real-Ip header and access sensitive APIs without validation.
CVE-2026-56681 is a high-severity authentication bypass vulnerability in 9Router, an AI router and token-saving proxy. The vulnerability arises from an improper trust boundary where the application relies on the client-controlled HTTP header X-9r-Real-Ip to determine whether an incoming request originates from a local (loopback) environment. In deployments where requests can reach the Next.js backend directly—bypassing the sanitizing custom-server.js wrapper—a remote, unauthenticated attacker can spoof their origin by supplying an X-9r-Real-Ip: 127.0.0.1 header.
The system architecture of 9Router employs a dual-layer setup consisting of a Next.js web application and a custom wrapper server defined in custom-server.js. This wrapper handles incoming client connections, resolves IP addresses from TCP sockets securely, sanitizes spoofable HTTP headers, and proxies requests to the Next.js backend.
Under normal execution, the system relies on this boundary to distinguish administrative loopback traffic from public clients. The core application exposes public LLM API routes under /api/v1/* which are intended to be guarded by robust API key validation mechanisms.
However, the application exposes a dangerous trust boundary by utilizing the custom header X-9r-Real-Ip to bypass security guards. If the Next.js server is directly exposed without the wrapper layer, this header falls entirely under client control, allowing unauthenticated remote access to internal API configurations.
The root cause is classified as CWE-807: Reliance on Untrusted Inputs in a Security Decision. The authentication logic inside the Next.js server utilizes a helper function named isLocalRequest() in src/dashboardGuard.js to authorize administrative operations.
This helper identifies loopback traffic by parsing the X-9r-Real-Ip header and matching it to local loopback addresses like 127.0.0.1 or ::1. It operates under the false assumption that only the trusted custom-server.js wrapper can write or forward this specific header.
If the application is deployed directly via standard platform mechanisms (such as next start on cloud providers or in bare Docker containers), the custom-server.js wrapper is completely bypassed. Consequently, an external attacker can append X-9r-Real-Ip: 127.0.0.1 to their HTTP requests. The backend evaluates this header, falsely asserts that the connection is local, and skips API key validation for all endpoints under /api/v1/*.
The vulnerability lies in how IP evaluation was handled prior to the patch. The custom-server.js file failed to properly validate if the physical socket connection originated from a loopback proxy before processing forwarding headers.
// Vulnerable logic flow in custom-server.js
const wrapped = (req, res) => {
const ip = req.socket && req.socket.remoteAddress ? req.socket.remoteAddress : "";
// Forwarding headers present = request arrived via a reverse proxy; loopback
// socket is the proxy hop, not the end-user, so it must not be trusted as local.
const viaProxy = !!(req.headers["x-forwarded-for"] || req.headers["x-real-ip"]);
// Vulnerable trust of incoming headers occurs hereThe patch introduced strict peer address verification and automated stripping of internal headers. The following diff outlines the secured logic in custom-server.js introduced in version 0.5.6:
@@ -10,10 +10,15 @@ http.createServer = (...args) => {
const rest = args.filter((a) => typeof a !== "function");
if (!handler) return origCreate(...args);
const wrapped = (req, res) => {
- const ip = req.socket && req.socket.remoteAddress ? req.socket.remoteAddress : "";
- // Forwarding headers present = request arrived via a reverse proxy; loopback
- // socket is the proxy hop, not the end-user, so it must not be trusted as local.
- const viaProxy = !!(req.headers["x-forwarded-for"] || req.headers["x-real-ip"]);
+ const socketIp = req.socket && req.socket.remoteAddress ? req.socket.remoteAddress : "";
+ const xff = req.headers["x-forwarded-for"];
+ const xRealIp = req.headers["x-real-ip"];
+ const viaProxy = !!(xff || xRealIp);
+ const isLoopbackProxy = socketIp === "127.0.0.1" || socketIp === "::1" || socketIp === "::ffff:127.0.0.1";
+ // Trust forwarding headers only when the TCP peer is a local reverse proxy.
+ // Direct/public sockets remain keyed by the unspoofable peer address.
+ const proxyIp = xRealIp || (xff ? String(xff).split(",")[0].trim() : "");
+ const ip = isLoopbackProxy && proxyIp ? proxyIp : socketIp;
+ delete req.headers["x-9r-real-ip"];
+ delete req.headers["x-forwarded-for"];
+ delete req.headers["x-9r-via-proxy"];The patched version validates whether socketIp is a true loopback address (127.0.0.1, ::1, or the IPv4-mapped IPv6 equivalent ::ffff:127.0.0.1). If the physical socket is not local, incoming forwarding headers are ignored and stripped, neutralizing spoofing attempts.
To exploit this vulnerability, an attacker must identify a target running 9Router where the Next.js application port (typically 3000) is exposed directly to the network. Alternatively, the target may be behind a reverse proxy that fails to strip custom HTTP headers from client requests.
An attacker craft an HTTP request to the /api/v1/models endpoint while injecting the X-9r-Real-Ip header. This allows the attacker to query the state of the router without providing any Authorization headers.
GET /api/v1/models HTTP/1.1
Host: target-9router-instance:3000
X-9r-Real-Ip: 127.0.0.1
User-Agent: Mozilla/5.0
Accept: application/jsonUpon receiving this request, the backend's local request helper processes the injected header. It returns a 200 OK response containing the configured LLM providers and models, allowing the attacker to make unauthorized inferences using the host's paid API keys.
The impact of this vulnerability is significant for organizations relying on 9Router to manage LLM access. Exploitation allows unauthenticated remote actors to execute cost-incurring inference requests against configured models.
Furthermore, the bypass facilitates information disclosure of internal system configurations and API structures. Attackers can enumerate active service integrations, revealing third-party provider accounts associated with the host.
Because the vulnerability does not provide direct filesystem access or system command execution, the impact on confidentiality, integrity, and availability is rated as Low from a system standpoint, yielding a CVSS score of 7.3.
The fix introduced in version 0.5.6 successfully secures deployments that run through custom-server.js by dropping client-supplied headers. However, structural risks remain if system administrators execute the Next.js server directly via next start or similar commands.
Because the core security guard inside dashboardGuard.js was not modified to independently validate socket origins, deployments bypassing custom-server.js remain vulnerable even on version 0.5.6. The fix is only effective if the wrapper file remains the sole entry point for network traffic.
Additionally, if an upstream reverse proxy is configured to append client IPs rather than overwrite the X-Forwarded-For header, attackers might still manipulate the list parsing logic. Standard hardening must include dropping all X-9r-* headers at the network edge.
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:L/A:L| Product | Affected Versions | Fixed Version |
|---|---|---|
9Router decolua | < 0.5.6 | 0.5.6 |
| Attribute | Detail |
|---|---|
| CWE ID | CWE-807 |
| Attack Vector | Network |
| CVSS v3.1 Score | 7.3 |
| Exploit Status | Proof of Concept |
| CISA KEV Status | No |
| Impact | Authentication Bypass / Unauthorized Resource Consumption |
The application makes a security decision based on the content of an HTTP header that can be modified or spoofed by an external attacker.
File Browser versions prior to 2.63.17 contain an authorization and state-management flaw in the BoltDB storage backend. When an authenticated user deletes a shared directory via an HTTP request with a trailing slash (e.g., DELETE /api/resources/a/), the share cleanup routine queries the database index using the unnormalized path before stripping the trailing slash. Because canonical share paths are stored without trailing slashes (e.g., /a), the database prefix query fails to match the parent directory share record. If a directory with the same name is later recreated, the dormant public share hash automatically reactivates and exposes the new directory contents to unauthenticated users.
An uncontrolled memory allocation vulnerability exists in ag-psd versions prior to 31.0.0. When parsing Adobe Photoshop Document (PSD) files, the readPsd() function reads image dimensions and color depth directly from the file header and allocates off-heap typed arrays without validating whether the requested memory size is proportional to the input stream or bounded by operational thresholds. An unauthenticated attacker can supply a crafted 52-byte PSD payload that triggers an immediate 3.35 GB memory allocation, resulting in process termination via the operating system Out-Of-Memory (OOM) killer.
CVE-2026-126297 (GHSA-v8f3-6phw-6mh9) is an uncontrolled resource consumption and algorithmic complexity vulnerability in the Natural Language Toolkit (NLTK) prior to version 3.10.4. Located in the Semantic Role Labeling (SRL) parser within `nltk/corpus/reader/conll.py`, the flaw allows an attacker to trigger quadratic O(N^2) CPU processing overhead by providing crafted CoNLL-formatted corpus inputs containing decoy span columns or nested full-width verb spans. Applications parsing untrusted linguistic corpora can experience prolonged CPU exhaustion and application-level Denial of Service (DoS).
CVE-2026-126298 (also tracked as GHSA-r53h-rw34-8h97) is an algorithmic complexity Denial of Service (DoS) vulnerability in the Natural Language Toolkit (NLTK) Python library affecting all versions prior to 3.10.4. The vulnerability resides in the nltk.tree.transforms.chomsky_normal_form function and its corresponding public method Tree.chomsky_normal_form(). When transforming a parse tree into Chomsky Normal Form using the default right-factoring strategy, the function repeatedly invokes list.pop(0) inside a loop iterating over all children of a node. In CPython, removing the initial element of a standard list requires an O(N) memory shift operation, causing the overall binarization algorithm to degrade to O(N^2) quadratic time complexity relative to the width of a node. Furthermore, converting horizontal node width into vertical tree depth bypasses initial parsing depth bounds, triggering subsequent stack exhaustion (RecursionError) when recursive methods traverse the mutated structure. Unauthenticated remote attackers who can submit bracketed tree strings to applications invoking this transformation can exhaust single-threaded CPU resources or induce unhandled application exceptions.
An algorithmic complexity vulnerability (CWE-407) in the Natural Language Toolkit (NLTK) before version 3.10.4 allows remote unauthenticated attackers to cause a denial of service via crafted Combinatory Categorial Grammar (CCG) lexicon strings. The parser in nltk.ccg.lexicon.fromstring performs repeated immutable string slicing, concatenation, and regex tail capturing, resulting in O(n^2) CPU consumption when processing wide, flat category definitions.
CVE-2026-126295 (also tracked as GHSA-fg9w-wfp5-j933) is a path confinement bypass vulnerability in the Natural Language Toolkit (NLTK) affecting versions 3.10.0 prior to 3.10.4. The flaw resides in nltk/parse/bllip.py within the BllipParser class and its factory method BllipParser.from_unified_model_dir(). Unlike sibling tool wrappers in NLTK that enforce data-root confinement via the nltk.pathsec module, BllipParser passes caller-supplied filesystem paths directly into the third-party bllipparser native C extension without validation. When an application passes untrusted input as model paths or directories to BllipParser, an attacker can force the native extension to open arbitrary files on the local filesystem. This leads to information disclosure through parser diagnostic oracles, local model tampering via shared directories, and denial of service by hanging worker threads on blocking special files (such as FIFOs or device nodes) or exhausting memory via oversized files.