Andy Mal
Andy is offline · heartbeat 61d ago

← all versions of polyrouter

[email protected]

suspicious   confidence 72%   action isolate   analyzed 2026-09-24 17:00 UTC by yolo in 14 tool calls, with lab detonation

Summary

[email protected] bundles an MITM HTTPS proxy (chunks/3127.js, server/chunks/*.js) that generates a root CA and installs it to the OS system trust store with sudo (Linux /etc/ca-certificates, macOS /Library/Keychains, Windows certutil) and rewrites /etc/hosts to redirect production AI provider domains to 127.0.0.1. The proxy intercepts and dumps request/response bodies to ~/.polyrouter/mitm/logs/. The postinstall hook is benign (npm-installs runtime deps from registry.npmjs.org), but the runtime MITM code provides active credential harvesting of AI API keys and tokens. Lab did not trigger MITM (runs on CLI invocation, not install).

Intent

Claims to be a local AI API gateway/router. Bundles a full MITM HTTPS proxy that installs a self-signed root CA to the system trust store and hijacks /etc/hosts to redirect major AI provider domains (Google, GitHub Copilot, AWS, Cursor) to localhost — enabling passive interception and exfiltration of all AI API traffic including bearer tokens and API keys.

credential_harvest persistence code_execution network_egress

Findings

MITM root CA installed to system trust store with sudo critical
server/chunks/3127.js:1-48 — installCert() uses sudo to write polyrouter-root-ca.crt to /etc/ca-certificates and calls update-ca-certificates (Linux), security add-trusted-cert (macOS), certutil -addstore Root (Windows). This makes the proxy transparently decrypt all HTTPS traffic.
/etc/hosts hijack redirects AI provider domains to localhost critical
server/chunks/3127.js:49-63 — addDNSEntry() writes 127.0.0.1 entries for daily-cloudcode-pa.googleapis.com, cloudcode-pa.googleapis.com, api.individual.githubcopilot.com, q.us-east-1.amazonaws.com, codewhisperer.us-east-1.amazonaws.com, runtime.us-east-1.kiro.dev, api2.cursor.sh. Traffic is routed through the local MITM proxy.
API request/response bodies dumped to disk high
server/chunks/3127.js:44-48 — dumpRequest() and createResponseDumper() write full HTTP request and response bodies (including Authorization headers with API keys) to ~/.polyrouter/mitm/logs/ as JSON/TXT files.
Elevated command execution (sudo / UAC) high
server/chunks/3127.js:3-19 — installCert() and DNS modification spawn sudo -S (prompts for password) and Start-Process ... -Verb RunAs (UAC elevation).
Prompt-injection / impersonated system message medium
app/.next-cli-build/server/app/dashboard/token-saver.html:1 — HTML contains text impersonating a terse-style system prompt optimization tip, consistent with prompt-injection embedding.
Credential warning in README (possible social engineering) low
README.md:125 — text warns 'Never share API keys, OAuth tokens, local SQLite databases' — could be planted to steer human readers.

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