Andy Mal
Andy is offline · heartbeat 61d ago

← all versions of polyrouter

[email protected]

suspicious   confidence 65%   action isolate   analyzed 2026-09-19 17:34 UTC by dsv41-flash in 35 tool calls, with lab detonation

Summary

[email protected] is a large (100 MB unpacked) proprietary AI-gateway CLI that behaves largely as advertised, but it carries an unusually invasive footprint for an npm package. Its postinstall (hooks/postinstall.js:10,17 -> hooks/sqliteRuntime.js:78-89,132 and hooks/trayRuntime.js:102) spawns `npm install [email protected]`, `[email protected]` and `[email protected]` into ~/.polyrouter/runtime and chmod +x's the systray Go binary; cli.js:86-89 repeats this on every start, then spawns a detached Next.js server bound to 0.0.0.0 (cli.js:96, 617). The bundled dashboard is built to import OAuth tokens/cookies from other AI tools and to write their config files (~/.codex/auth.json, ~/.claude/settings.json, ~/.config/jcode/provider-polyrouter.env), can install a root CA into the system trust store and edit /etc/hosts with sudo, and can register boot autostart (src/cli/tray/autostart.js:47); anonymous install telemetry goes to https://fzdduustinwqhotqlpua.supabase.co/functions/v1/public-installation-telemetry. The lab detonation tool failed three times, so no runtime evidence was obtained; static prescreen "obfuscation/credential_harvest" hits come from bundled Next.js/Sentry code. Recommended action: isolate — install only in a throwaway sandbox with no API keys, SSH keys or .env files. Same family already published as suspicious at 1.0.31.

Intent

Claimed as a local OpenAI-compatible AI gateway/router; it does implement that gateway, but it ships a 100 MB prebuilt Next.js dashboard plus an install hook that npm-installs native packages into ~/.polyrouter, and its design reads/writes other AI coding tools' credential and settings files (including ~/.codex/auth.json, ~/.claude/settings.json), installs a MITM root CA with sudo, and persists itself at boot. No credential exfiltration or hidden payload was found; the risk is capability, not proven theft.

credential_access network_egress download_execute persistence agent_config_tamper privilege reconnaissance

Findings

postinstall runs npm install into the user's home directory high hooks/postinstall.js:9-20, hooks/sqliteRuntime.js:78-137, hooks/trayRuntime.js:74-105
hooks/postinstall.js:10 and :17 call ensureSqliteRuntime/ensureTrayRuntime, which spawn `npm install [email protected] [email protected]` (hooks/sqliteRuntime.js:78-89, 132) and `npm install [email protected]` (hooks/trayRuntime.js:102) with cwd=~/.polyrouter/runtime, creating a private package.json there. Install-time network egress plus writes outside the package directory, and it pulls third-party native/bundled binaries that are later executed by the CLI.
Entry point self-heals the same runtime and runs a detached server on 0.0.0.0 high cli.js:86-96, cli.js:614-640
cli.js:86-89 re-runs the home-directory npm installs on every launch (silent), cli.js:96 defaults host to 0.0.0.0, and cli.js:617-631 spawns a detached Next.js server. Requiring/running the bin therefore executes install-like behavior and exposes a local gateway holding every connected provider credential on the LAN by default.
Reads and rewrites other AI tools' credential/config files by design high app/.next-cli-build/server/chunks/2878.js:14,33; app/.next-cli-build/server/app/api/oauth/, .../api/cli-tools/*-settings/route.js
The bundled dashboard writes gateway keys into other agents' configs, e.g. {filename:"~/.codex/auth.json", content:{auth_mode:"apikey", OPENAI_API_KEY:...}} (app/.next-cli-build/server/chunks/2878.js:14), {filename:"~/.config/jcode/provider-polyrouter.env"} (chunks/2878.js:33), settingsFile:"~/.claude/settings.json" (server/app/(dashboard)/dashboard/cli-tools/[toolId]/page.js:1), and imports OAuth tokens/cookies from Cursor, Kiro, iFlow, ChatGPT-web (server/app/api/oauth/*). Feature-driven and user-triggered, but it grants the package write access to agent configuration.
MITM mode installs a root CA into the system trust store and edits /etc/hosts with sudo medium app/.next-cli-build/server/chunks/3127.js:5,58,63
app/.next-cli-build/server/chunks/3127.js:5 runs `security add-trusted-cert`/Windows root-store install for MITM certificates, :63 writes DNS entries via a sudo-backed tee into hosts, and NODE_EXTRA_CA_CERTS is set/unset globally (:58). This is an intended feature of the MITM proxy but is a privileged, system-wide modification gated only on a dashboard action.
Optional boot persistence (launchd / Startup folder / XDG autostart) medium src/cli/tray/autostart.js:47-109, cli.js:770-774
src/cli/tray/autostart.js:47 enableAutoStart writes ~/Library/LaunchAgents/com.polyrouter.autostart.plist, %APPDATA%\...\Startup\polyrouter.vbs or ~/.config/autostart/polyrouter.desktop; reached from cli.js:772 when the user picks 'Minimize to Tray'. Persistence is user-initiated, not silent.
Anonymous installation telemetry to a third-party Supabase project low app/.next-cli-build/required-server-files.json:10-12; app/.next-cli-build/server/chunks/5767.js:24-27
app/.next-cli-build/required-server-files.json:10 sets PUBLIC_INSTALLATION_TELEMETRY_URL=https://fzdduustinwqhotqlpua.supabase.co/functions/v1/public-installation-telemetry (with a public anon key at :12); the app keeps installationIdentity/installationTelemetryQueue tables with installationId, occurredAt, ipHash and appVersion (server/chunks/5767.js:24-27). No provider secrets are included in the queue schema I could read.
Remote install-script and sudo-curl chains exposed in the product UI low app/.next-cli-build/server/app/api/cli-tools/all-statuses/route.js:15; app/.next-cli-build/server/chunks/2712.js:2
The dashboard surfaces `curl -fsSL https://raw.githubusercontent.com/1jehuang/jcode/master/scripts/install.sh | bash` as an install instruction (server/app/api/cli-tools/all-statuses/route.js:15) and can download/execute https://tailscale.com/install.sh with a sudo password prompt (server/chunks/2712.js:2). These are operator-initiated, but they bring shell-pipe-to-bash into an agent's workflow.
No hidden payload found; prescreen hits are bundle noise info app/.next-cli-build/** (bundled output)
No eval/new Function, no base64 payload decoding, and no code in cli.js, hooks/ or src/ that reads credential stores and sends them anywhere. The static 'obfuscation', 'ransomware', 'macos_stealer', 'credential_harvest' hits are almost all inside bundled Next.js, Sentry, react-dom and sqlite/systray artifacts under app/.next-cli-build. The two 'prompt-injection/hidden text' hints in docs are false positives (a README security section and a token-saver feature page); no text addressing an AI reader was found.
Dynamic analysis unavailable info
andy_detonate returned an invalid-output error on three attempts, so the postinstall hook was never actually executed in the lab for this sample. No spawned-process, connection or canary-read evidence exists for this verdict; conclusions are static-only and confidence is correspondingly capped.

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/.npmrc, /home/andy/.gitconfig

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