Summary
postinstall (hooks/postinstall.js) calls ensureSqliteRuntime/ensureTrayRuntime, which spawn `npm install` of [email protected], [email protected] and [email protected] into ~/.miawrouter/runtime/node_modules and delete a legacy systray dir; the same warm-up re-runs whenever cli.js is required, and cli.js also self-updates via `npm i -g miawrouter@latest`. The bundled 80 MB Next.js server is a real AI-router dashboard, but it reads/writes other agent tools' config (e.g. api/cli-tools/claude-settings writes ~/.claude/settings.json and ~/.claude.json), generates a root CA and installs it into the OS trust store (chunks/3755.js: `certutil -addstore Root`, `security add-trusted-cert ... System.keychain`, `launchctl setenv NODE_EXTRA_CA_CERTS`) to MITM-proxy traffic, and installs remote skills via `npx skills add` from miawrouter.web.id / skills.sh. No credential exfiltration, persistence, or obfuscation found; the alarming prescreen tags are regex noise on minified next/dist/compiled libraries. Treat as unverified high-capability tooling: install only in a throwaway sandbox without credentials.
Intent
MiawRouter markets itself as a local OpenAI/Claude-compatible AI routing gateway with a dashboard, and the code is a coherent product of that kind — but it also carries a broad, agent-relevant capability set: an install hook that npm-installs extra packages into the user's home, an OS root-CA/MITM proxy, and code that reads and rewrites other AI CLIs' credential/config files. No theft or exfiltration was observed.
credential_access network_egress download_execute agent_config_tamper reconnaissance privilege
Install hook npm-installs extra packages into the user home medium hooks/postinstall.js:6-19; hooks/sqliteRuntime.js:78-103,132; hooks/trayRuntime.js:74-102
postinstall requires hooks/sqliteRuntime.js and hooks/trayRuntime.js, which run `npm install
[email protected] [email protected] [email protected] --no-save` with cwd set to ~/.miawrouter/runtime (getDataDir -> ~/.miawrouter, or %APPDATA%\miawrouter on Windows). Network egress to the npm registry at install time beyond the package itself; documented as a native-dep warm-up and non-fatal, but it is undeclared side-effect installation into the user's home.
Entry file also spawns npm installs and self-updates medium cli.js:86-89,93
cli.js unconditionally calls ensureSqliteRuntime({silent:true}) and ensureTrayRuntime({silent:true}) at require time, and defines INSTALL_CMD_LATEST = `npm i -g miawrouter@latest --prefer-online`. Merely running `npx miawrouter` can trigger package installs and a global self-update over the network.
Reads and rewrites other AI tools' config and credentials high app/.next-cli-build/server/app/api/cli-tools/claude-settings/route.js:1; app/.next-cli-build/server/chunks/8039.js:1
The server reads/writes ~/.claude/settings.json and ~/.claude.json (including env.ANTHROPIC_BASE_URL / ANTHROPIC_AUTH_TOKEN), edits mcpServers, and rewrites subagent model files; the skill engine (chunks/8039.js) enumerates ~/.claude, ~/.codex, ~/.config/opencode and ~/.cursor. This is the product's stated 'point a CLI tool at the router' feature, but it is direct tampering with an agent's configuration surface.
Generates a root CA and installs it into the OS trust store (MITM) high app/.next-cli-build/server/chunks/3755.js:1-5,53-54
chunks/3755.js generates ~/.miawrouter/mitm/rootCA.key and rootCA.crt, then installs the CA into the Windows Root store (`certutil -addstore Root`), the macOS System keychain (`security add-trusted-cert ... /Library/Keychains/System.keychain`) and sets NODE_EXTRA_CA_CERTS via launchctl/reg, and runs a capturing MITM proxy. This is a full TLS-interception capability over the user's machine; it is a documented router feature but carries serious risk if abused.
Remote skill registry and npx-based skill installation medium app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/skills/page-8d0be9f73140a9d7.js:1; app/.next-cli-build/server/chunks/8039.js:1; app/.next-cli-build/server/app/api/skill-discovery/[id]/inst
The dashboard fetches skill metadata from https://miawrouter.web.id/skills and https://skills.sh (api/search, sitemap.xml), and installs skills by running `npx skills add <sourceRef> --skill <slug>` (executing third-party content) into detected CLI tool directories. Install endpoints require local authentication and are user-initiated, but they constitute remote download-and-execute into agent config dirs.
Prescreen high-risk tags are false positives on bundled libraries info app/node_modules/next/dist/compiled/**
The credential_harvest/ransomware/anti_analysis/obfuscation hits attributed to app/node_modules/next/dist/compiled/* and to minified route bundles are regex matches inside Next.js/@vercel/nft/babel/edge-runtime distributions, not package logic. No eval of encoded blobs, no Buffer.from(base64) execution, no reverse shell, and no writes to shell rc files, cron, launchd or scheduled tasks were found.
Prompt-injection hints in docs are product copy, not analyzer targeting low app/.next-cli-build/server/app/dashboard/token-saver.html:1
The 'impersonates a system/operator message' hits come from dashboard/token-saver.html describing a feature that injects a terse 'system prompt' into messages; this is user-content documentation of an opt-in token-saving behavior, not text aimed at steering an AI reviewer.
Lab detonation could not complete info
andy_detonate returned invalid output on repeated attempts, so install-hook runtime behavior is assessed from source only; a clean/benign runtime outcome was not independently confirmed.
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/.miawrouter/runtime/package.json