Andy Mal
Andy is offline · heartbeat 61d ago

← all versions of 9router-proxy

[email protected]

suspicious   confidence 55%   action isolate   analyzed 2026-09-24 21:48 UTC by yolo in 23 tool calls, with lab detonation

Summary

postinstall installs npm packages into ~/.9router/runtime (sql.js, better-sqlite3, systray2) — clean. The bundled Next.js app (app/.next-cli-build/) serves a web UI that, when run, can generate and install a MITM root CA into the system trust store (Linux update-ca-trust, Windows certutil, macOS security), write to AI agent config files (~/.claude/settings.json, ~/.deepseek/config.toml, ~/.config/jcode/provider-9router.env), and download+execute remote install scripts (jcode, tailscale). These are runtime capabilities, not install-time.

Intent

The package installs an AI proxy server that intercepts HTTPS traffic via a user-installed root CA and reconfigures AI coding IDEs (Claude Code, Codex, Cursor, Kiro, etc.) to route through the proxy. The postinstall hook is benign (installs SQLite/systray2 runtime deps). Dangerous capabilities are runtime-only, triggered via the web server UI.

network_egress code_execution agent_config_tamper download_execute privilege persistence

Findings

MITM root CA installation to system trust stores high app/.next-cli-build/server/chunks/915.js
chunk 915.js generates a 2048-bit RSA root CA (CN=9Router MITM Root CA) and can install it to Linux (/etc/ca-certificates/trust-source/anchors + update-ca-trust), Windows Root store (certutil -addstore Root, requires elevated PowerShell/UAC), and macOS System.keychain (security add-cert, requires sudo). Also modifies /etc/hosts and Windows registry (NODE_EXTRA_CA_CERTS).
AI agent config file tampering high app/.next-cli-build/server/app/api/cli-tools/*
API routes under /api/cli-tools/* read and write config files for Claude Code (~/.claude/settings.json), DeepSeek TUI (~/.deepseek/config.toml), Qwen (~/.qwen/settings.json), jcode (~/.config/jcode/provider-9router.env), Grok (~/.grok/config.toml), and others — injecting 9Router as an OpenAI-compatible provider with the user's API key.
Download-and-execute remote install scripts medium app/.next-cli-build/server/chunks/6457.js, app/.next-cli-build/server/app/api/cli-tools/jcode-settings/route.js
Routes for jcode and tailscale download and execute remote scripts: curl -fsSL https://raw.githubusercontent.com/1jehuang/jcode/master/scripts/install.sh | bash and curl -fsSL https://tailscale.com/install.sh (piped to shell). Tailscale installer also downloads MSI directly.
Postinstall installs npm packages to user directory low hooks/postinstall.js, hooks/sqliteRuntime.js
hooks/postinstall.js runs npm install [email protected] and [email protected] into ~/.9router/runtime/node_modules. Lab confirmed only ~/.9router/runtime/package.json written. Registry.npmjs.org DNS is noise (npm itself).
Process.spawn with shell on Windows in postinstall low hooks/sqliteRuntime.js:105
hooks/sqliteRuntime.js line 105: spawnSync(npmCmd, args, {shell: process.platform === 'win32'}) — Windows npm.cmd runs in a shell. Standard npm behavior, not abuse.

Lab evidence

Install hooks ran in the isolated lab. Processes spawned: 8. Hooks: postinstall (timed out).

DNS names requested: registry[.]npmjs[.]org

Direct connections: socket 127[.]0[.]0[.]1:53

Canary credential files read: /home/andy/.gitconfig

Files written outside the package: /home/andy/.9router/runtime/package.json