Andy Mal
Andy is offline · heartbeat 61d ago

← all versions of polyrouter

[email protected]

suspicious   confidence 55%   action isolate   analyzed 2026-09-24 17:10 UTC by yolo in 19 tool calls, with lab detonation

Summary

Postinstall installs native deps (sql.js, better-sqlite3, systray2) into ~/.polyrouter/runtime — standard for CLI tools. The bundled Next.js app exposes 100+ API routes for managing AI provider configs, including reading Cursor access tokens from state.vscdb and writing API keys to ~/.codex/auth.json and ~/.config/jcode/provider-polyrouter.env. No evidence of actual credential exfiltration; the canary .gitconfig read came from npm itself, not polyrouter code.

Intent

A local AI gateway CLI with a 100MB bundled Next.js web UI for managing 60+ AI provider configurations. Reads and writes AI coding tool config files (~/.claude/settings.json, ~/.codex/auth.json, ~/.config/jcode/provider-polyrouter.env) and can import OAuth tokens from IDEs like Cursor. Capabilities could be used for credential theft but appear intended for configuration management.

credential_access network_egress code_execution agent_config_tamper

Findings

Native dep install at postinstall info hooks/postinstall.js:10-19
hooks/postinstall.js runs npm install [email protected] and [email protected] into ~/.polyrouter/runtime/node_modules. Harmless if the runtime dir is user-writable; standard pattern.
Reads Cursor IDE OAuth tokens medium app/.next-cli-build/server/app/api/oauth/cursor/auto-import/route.js:1
app/api/oauth/cursor/auto-import/route.js queries Cursor's SQLite state.vscdb for keys cursorAuth/accessToken and cursorAuth/token — exports them as JSON.
Writes API keys to AI coding tool configs medium app/.next-cli-build/server/chunks/2878.js:14
app/api/cli-tools/codex-settings/route.js writes OPENAI_API_KEY to ~/.codex/auth.json. app/api/cli-tools/jcode-settings/route.js writes JCODE_POLYROUTER_API_KEY to ~/.config/jcode/provider-polyrouter.env.
Download-and-execute URL in UI medium app/.next-cli-build/server/app/api/cli-tools/all-statuses/route.js:15
app/api/cli-tools/all-statuses/route.js contains text: 'Install via: curl -fsSL https://raw.githubusercontent.com/1jehuang/jcode/master/scripts/install.sh | bash'. Not auto-executed — displayed as a warning.
Canary .gitconfig read (npm, not polyrouter) info lab report
The isolated lab read /home/andy/.gitconfig during the postinstall hook. This is npm reading the file for registry auth, not polyrouter code directly.

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/.polyrouter/runtime/package.json