CVE-2026-56681: 9router Authentication Bypass Vulnerability

HIGH
Advisory Identifier: GHSA-5mj8-gf6m-fhw8
CVSS 7.3
CWE-807
Published
Advisory Summary

CVE-2026-56681 is a HIGH (CVSS 7.3) authentication bypass vulnerability (CWE-807: Reliance on Untrusted Inputs in a Security Decision) affecting 9router libraries in the npm ecosystem. The issue involves 9router has an authentication bypass in public llm api via spoofable x-9r-real-ip header. Remediation is available by upgrading affected packages to version 0.5.8.

CVE-2026-56681 at a Glance

CVE Identifier CVE-2026-56681
GHSA Identifier GHSA-5mj8-gf6m-fhw8
Severity HIGH
CVSS v3.1 Base Score 7.3
CWE Classification CWE-807: Reliance on Untrusted Inputs in a Security Decision
Affected Product 9router
Package Ecosystem npm
Published Date
Last Updated

Security Impact

CVSS: 7.3

The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:L/A:L).

Attack Vector Network (AV:N)
Attack Complexity Low (AC:L)
Privileges Required None (PR:N)
User Interaction None (UI:N)
Scope Unchanged (S:U)
Confidentiality Low (C:L)
Integrity Low (I:L)
Availability Low (A:L)

How to Fix CVE-2026-56681

To remediate this vulnerability, upgrade all affected 9router dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.

9router fixed: 0.5.8
npm install 9router@0.5.8
Verify Direct and Transitive Dependencies

Run the following command in your project directory to verify that all resolved dependencies use the patched release:

npm ls 9router

How to Check if You Are Affected

To determine whether your Node.js application is affected by CVE-2026-56681, inspect your project dependencies using npm:

npm ls 9router

Analyze the terminal output to locate any version of 9router in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 0.5.8), your application is affected.

Note: The npm ls 9router command inspects dependencies declared in your package.json and lockfile; it does not perform automated runtime dynamic scanning.

Technical Details

Vulnerability Mechanism & Technical Analysis

This vulnerability is classified under CWE-807: Reliance on Untrusted Inputs in a Security Decision, where the product uses a protection mechanism that relies on the existence or values of an input, but the input can be modified by an untrusted actor in a way that bypasses the protection mechanism. In 9router, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.

Source Advisory Statement

## Summary 9router determines whether an incoming request originates from localhost by trusting the X-9r-Real-Ip HTTP request header. This header is intended to be produced and sanitized exclusively by the bundled custom-server.js layer from the TCP socket address. In deployment modes where requests reach Next.js directly (the header is never stripped/regenerated), a remote, unauthenticated attacker can simply send X-9r-Real-Ip: 127.0.0.1 and be treated as a local client. This bypasses the API-key requirement on the public LLM API (/api/v1/*), granting unauthenticated access to the instance owner's configured provider resources. ## Affected Component - src/dashboardGuard.js - isLocalRequest() — trusts the client-supplied X-9r-Real-Ip header to decide loopback origin - canAccessPublicLlmApi() — grants access to /api/v1/* when isLocalRequest() returns true, skipping API-key validation - Verified affected route: GET /api/v1/models - Product version tested: 9router-app 0.5.4 (Next.js 16.2.9) ## Root Cause The authorization layer makes a security decision based on a client-controllable HTTP header. isLocalRequest() reads X-9r-Real-Ip and, if its value is a loopback address (127.0.0.1), classifies the request as local. The design assumes this header can only be set by the trusted custom-server.js wrapper (which derives it from the unspoofable socket address and strips any inbound copy). When the application is served without that wrapper, Next.js passes the attacker-supplied header through unchanged, so the trust assumption is violated: ```text Untrusted Client Input ↓ X-9r-Real-Ip: 127.0.0.1 ↓ isLocalRequest() → true ↓ canAccessPublicLlmApi() → allowed (API key not required) ↓ 200 OK ``` ## Attack Scenario 1. The instance is deployed in a mode that does not use custom-server.js, and the LLM API is reachable by the attacker (the default bind is 0.0.0.0). 2. The attacker sends a normal request to /api/v1/models and receives 401 Unauthorized (API key required for remote access). 3. The attacker re-sends the identical request with the single added header X-9r-Real-Ip: 127.0.0.1. 4. The request is classified as local, the API-key check is skipped, and the attacker receives 200 OK with the owner's model catalog and ongoing access to the LLM API. ## Proof of Concept ### Baseline Request <img width="1211" height="402" alt="Screenshot 2026-06-19 174727" src="https://github.com/user-attachments/assets/170b635f-1bd6-4dfd-ad85-30a03a9f6f72" /> ### Exploit Request <img width="1207" height="816" alt="Screenshot 2026-06-19 174844" src="https://github.com/user-attachments/assets/b7b4efde-c071-4aa2-ab13-9bde7c88a7b8" /> The only difference between the two requests is the addition of X-9r-Real-Ip: 127.0.0.1. ## Impact An unauthenticated remote attacker who can reach the service can bypass API-key enforcement on the public LLM API and act as a trusted local client. Consequences include: - Unauthorized use of the owner's configured LLM provider connections - Consumption of paid API credits / financial loss to the instance owner - Abuse of upstream provider accounts via the proxy - Enumeration of configured providers and available models ## Remediation - Do not trust X-9r-Real-Ip (or any X-9r-* header) when received directly from clients. - Derive the client address for authorization from a trusted transport-level source, e.g. req.socket.remoteAddress, rather than a request header. - If custom-server.js is required for the security model, fail closed when its trusted marker is absent, and explicitly strip/reject any inbound client-supplied X-9r-* headers at the edge. - Document supported, secure startup modes so the application is not run in a configuration where the header is attacker-controllable.

CVE-2026-56681 Affected 9router Versions

1 component(s)
Fixed Versions:
0.5.8
Product / Package Ecosystem Affected Versions Fixed Version
9router
npm
< 0.5.8
0.5.8

References

Frequently Asked Questions

What is CVE-2026-56681?
CVE-2026-56681 is a security vulnerability in 9router involving 9Router has an Authentication Bypass in Public LLM API via Spoofable X-9r-Real-Ip Header under CWE-807: Reliance on Untrusted Inputs in a Security Decision.
Which 9router versions are affected?
Affected versions include releases prior to 0.5.8 across affected packages: 9router.
What version fixes CVE-2026-56681?
Upgrading to 0.5.8 (or the latest patched release for your respective branch) resolves the vulnerability.
Is 9router affected?
Yes, 9router is affected in releases prior to 0.5.8. Upgrade your dependency to 0.5.8 or later.
What is the CVSS score of CVE-2026-56681?
CVE-2026-56681 has a CVSS v3.1 base score of 7.3 (HIGH) with vector string CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:L/A:L.
What CWE is associated with CVE-2026-56681?
CVE-2026-56681 is classified under CWE-807: Reliance on Untrusted Inputs in a Security Decision (The product uses a protection mechanism that relies on the existence or values of an input, but the input can be modified by an untrusted actor in a way that bypasses the protection mechanism.).
How can I check npm dependencies for CVE-2026-56681?
Run the dependency tree command: 'npm ls 9router'. This command lists direct and transitive dependencies in your build configuration so you can verify if a vulnerable version is resolved.
Machine-readable OSV JSON OSV v1.5 Schema
Normalized schema output
{
  "schema_version" : "1.4.0",
  "id" : "GHSA-5mj8-gf6m-fhw8",
  "modified" : "2026-09-22T16:34:06Z",
  "published" : "2026-09-22T16:34:06Z",
  "aliases" : [ "CVE-2026-56681" ],
  "summary" : "9Router has an Authentication Bypass in Public LLM API via Spoofable X-9r-Real-Ip Header",
  "details" : "## Summary\n\n9router determines whether an incoming request originates from localhost by trusting the X-9r-Real-Ip HTTP request header. This header is intended to be produced and sanitized exclusively by the bundled custom-server.js layer from the TCP socket address. In deployment modes where requests reach Next.js directly (the header is never stripped/regenerated), a remote, unauthenticated attacker can simply send X-9r-Real-Ip: 127.0.0.1 and be treated as a local client. This bypasses the API-key requirement on the public LLM API (/api/v1/*), granting unauthenticated access to the instance owner's configured provider resources.\n\n## Affected Component\n\n- src/dashboardGuard.js  \n- isLocalRequest() — trusts the client-supplied X-9r-Real-Ip header to decide loopback origin  \n- canAccessPublicLlmApi() — grants access to /api/v1/* when isLocalRequest() returns true, skipping API-key validation  \n- Verified affected route: GET /api/v1/models  \n- Product version tested: 9router-app 0.5.4 (Next.js 16.2.9)\n## Root Cause\n\nThe authorization layer makes a security decision based on a client-controllable HTTP header. isLocalRequest() reads X-9r-Real-Ip and, if its value is a loopback address (127.0.0.1), classifies the request as local. The design assumes this header can only be set by the trusted custom-server.js wrapper (which derives it from the unspoofable socket address and strips any inbound copy). When the application is served without that wrapper, Next.js passes the attacker-supplied header through unchanged, so the trust assumption is violated:\n\n```text\nUntrusted Client Input\n        ↓\nX-9r-Real-Ip: 127.0.0.1\n        ↓\nisLocalRequest()  → true\n        ↓\ncanAccessPublicLlmApi()  → allowed (API key not required)\n        ↓\n200 OK\n```\n\n## Attack Scenario\n\n1. The instance is deployed in a mode that does not use custom-server.js, and the LLM API is reachable by the attacker (the default bind is 0.0.0.0).\n2. The attacker sends a normal request to /api/v1/models and receives 401 Unauthorized (API key required for remote access).\n3. The attacker re-sends the identical request with the single added header X-9r-Real-Ip: 127.0.0.1.\n4. The request is classified as local, the API-key check is skipped, and the attacker receives 200 OK with the owner's model catalog and ongoing access to the LLM API.\n\n## Proof of Concept\n\n### Baseline Request\n<img width=\"1211\" height=\"402\" alt=\"Screenshot 2026-06-19 174727\" src=\"https://github.com/user-attachments/assets/170b635f-1bd6-4dfd-ad85-30a03a9f6f72\" />\n\n### Exploit Request\n\n<img width=\"1207\" height=\"816\" alt=\"Screenshot 2026-06-19 174844\" src=\"https://github.com/user-attachments/assets/b7b4efde-c071-4aa2-ab13-9bde7c88a7b8\" />\n\n\nThe only difference between the two requests is the addition of X-9r-Real-Ip: 127.0.0.1.\n## Impact\n\nAn unauthenticated remote attacker who can reach the service can bypass API-key enforcement on the public LLM API and act as a trusted local client. Consequences include:\n\n- Unauthorized use of the owner's configured LLM provider connections\n- Consumption of paid API credits / financial loss to the instance owner\n- Abuse of upstream provider accounts via the proxy\n- Enumeration of configured providers and available models\n\n## Remediation\n\n- Do not trust X-9r-Real-Ip (or any X-9r-* header) when received directly from clients.\n- Derive the client address for authorization from a trusted transport-level source, e.g. req.socket.remoteAddress, rather than a request header.\n- If custom-server.js is required for the security model, fail closed when its trusted marker is absent, and explicitly strip/reject any inbound client-supplied X-9r-* headers at the edge.\n- Document supported, secure startup modes so the application is not run in a configuration where the header is attacker-controllable.",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:L/A:L"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "npm",
      "name" : "9router"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "0.5.8"
      } ]
    } ],
    "database_specific" : {
      "last_known_affected_version_range" : "<= 0.5.4"
    }
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/decolua/9router/security/advisories/GHSA-5mj8-gf6m-fhw8"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/decolua/9router/commit/efd20be8d81ef2e256a7037f3aa78e6b567b5fd3"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/decolua/9router"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/decolua/9router/releases/tag/v0.5.6"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-807" ],
    "severity" : "HIGH",
    "github_reviewed" : true,
    "github_reviewed_at" : "2026-09-22T16:34:06Z",
    "nvd_published_at" : null
  }
}