Summary
postinstall (hooks/postinstall.js) shells out via spawnSync to `npm install [email protected]`, `[email protected]` and `[email protected]` into ~/.polyrouter/runtime (hooks/sqliteRuntime.js:78-95, hooks/trayRuntime.js:74-104) — an install-time download-and-execute of registry code, and it also rm -rf's a legacy `systray` directory and chmod +x's a bundled Go tray binary (hooks/trayRuntime.js:25-58). The shipped runtime is a closed-source, minified Next.js standalone build (package.json license UNLICENSED; README.md:130), so most behavior is only verifiable in compiled chunks: those write other agents' config (~/.codex/auth.json auth_mode=apikey, ~/.claude/settings.json, jcode/cline/cursor settings), can create and system-trust a MITM root CA (~/.polyrouter/mitm/rootCA.key|crt, chunk 3127), and queue anonymous install telemetry (installationId/eventType/ipHash/appVersion — no keys observed) for https://fzdduustinwqhotqlpua.supabase.co/functions/v1/public-installation-telemetry. I found no credential exfiltration, no embedded payload decoder, and no unexpected egress in readable source; cli.js only checks registry.npmjs.org for updates (cli.js:478) and spawns the local server. The isolated detonation could not be completed (the lab tool errored twice), so dynamic confirmation is missing — treat as isolate-and-inspect, not allow.
Intent
Marketed as a local OpenAI-compatible AI gateway/router for coding tools. It really is that app (a large closed-source Next.js bundle plus a CLI), but it also runs `npm install` for extra native/tray packages during postinstall, auto-writes other AI tools' config files, can install a system-trusted MITM root CA, and reports anonymous installation telemetry to a Supabase endpoint — capabilities that are declared in the docs but not provably benign from the shipped bytes alone.
network_egress download_execute credential_access agent_config_tamper persistence privilege reconnaissance
postinstall runs npm install at install time medium package.json:21, hooks/sqliteRuntime.js:78-95, hooks/trayRuntime.js:74-104
package.json:21 → hooks/postinstall.js:6-20 calls ensureSqliteRuntime/ensureTrayRuntime, which use spawnSync('npm', ['install', ...]) (hooks/sqliteRuntime.js:78-95) to pull
[email protected],
[email protected] and
[email protected] into ~/.polyrouter/runtime/node_modules. Third-party code is fetched and executed during `npm install polyrouter`, outside the tarball's integrity scope.
Hook deletes dirs and chmods a bundled Go binary low hooks/trayRuntime.js:25-58
hooks/trayRuntime.js:25-43 rmSync(recursive,force) on ~/.polyrouter/runtime/node_modules/systray and <pkg>/node_modules/systray; :48-58 chmodSync 0o755 on systray2/traybin/tray_darwin_release|tray_linux_release, which the CLI then spawns (node-forge/native tray). Destructive-ish cleanup of paths outside the package, explained as AV/dyld workaround.
Package writes other AI tools' configuration (agent supply chain) medium app/.next-cli-build/server/app/api/cli-tools/, app/.next-cli-build/server/chunks/2878.js:14
Compiled routes/dashboard apply settings into ~/.claude/settings.json, ~/.codex/auth.json (auth_mode:apikey + OPENAI_API_KEY), cline/kilo/opencode/hermes/jcode and others (e.g. chunks/2878.js:14; app/.next-cli-build/server/app/api/cli-tools/*/route.js). It also writes ~/.config/jcode/provider-polyrouter.env. These are the stated product feature and require dashboard action, but they mutate agent configs and hold gateway API keys.
Capable of installing a system-trusted MITM root CA medium app/.next-cli-build/server/chunks/3127.js:48-49
chunks/3127.js:48-49 reads/writes ~/.polyrouter/mitm/rootCA.key and rootCA.crt, installs the cert into the Windows Root store / deletes it from /Library/Keychains/System.keychain, runs `launchctl setenv NODE_EXTRA_CA_CERTS ...`, and spawns the MITM server with ROUTER_API_KEY in env. User-initiated through the dashboard, but it is a privileged, traffic-intercepting capability shipped in the same tarball.
Anonymous installation telemetry to a third-party Supabase endpoint low app/.next-cli-build/required-server-files.json:10, app/.next-cli-build/server/chunks/5767.js:23-27
PUBLIC_INSTALLATION_TELEMETRY_URL=https://fzdduustinwqhotqlpua.supabase.co/functions/v1/public-installation-telemetry (app/.next-cli-build/required-server-files.json:10) plus a SPONSORS Supabase URL/key. Local queue fields are eventId/eventType/occurredAt/ipHash/appVersion/attempts (chunks/5767.js:23-27) — I saw no API-key or env contents in the telemetry schema, and there is a /api/settings/public-telemetry toggle.
Autostart/persistence and network exposure by default medium cli.js:96, cli.js:772-773
Choosing 'Hide to Tray' calls enableAutoStart (cli.js:772-773), which per published IOCs writes ~/Library/LaunchAgents/com.polyrouter.autostart.plist and ~/.config/autostart/polyrouter.desktop. The gateway also defaults to host 0.0.0.0 (cli.js:96) and prints a LAN-IP warning, i.e. the key-holding gateway is reachable from the network by default.
Runtime is closed-source minified bundle; entry logic is the only readable code info cli.js:478, cli.js:611-630, README.md:130
The tarball ships ~100 MB of prebuilt Next.js output (app/.next-cli-build/**) plus vendored node_modules; the server that proxies prompts and provider keys is not shipped as readable source (UNLICENSED, README.md:130). cli.js:3-9, 478, 611-630 contain the only clear install/run behavior: registry update check, local server spawn, browser open.
Detonation could not be completed info n/a
andy_detonate returned an internal error (invalid output) on both attempts, so there is no lab evidence of hook processes, connection attempts or canary credential reads for this version. Confidence in the 'clean' direction is therefore reduced; the verdict rests on static reading of hooks, cli.js and compiled bundles.
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