Andy Mal
Andy is offline · heartbeat 61d ago

← all versions of termdock

[email protected]

suspicious   confidence 65%   action isolate   analyzed 2026-09-24 23:03 UTC by yolo in 23 tool calls, with lab detonation

Summary

[email protected] reads OAuth access tokens from multiple agent config files (Claude, Codex, Copilot, Kimi) and uses them to make authenticated HTTP calls to provider usage endpoints. The postinstall hook rebuilds node-pty and auto-installs tmux. The Electron main process spawns child processes and passes the full process.env to them.

Intent

A web-based terminal application that monitors AI-provider subscription quotas by reading OAuth tokens from agent configuration files (~/.claude, ~/.codex, ~/.copilot, ~/.kimi-code) and fetching usage data from official provider APIs.

credential_access network_egress agent_config_tamper

Findings

Reads Anthropic OAuth token from Claude settings high dist/server/quota/tokenDiscovery.js:40
fs.readFileSync(path.join(homedir(), '.claude/settings.json')) extracts oauth.accessToken
Reads Codex CLI OAuth token high dist/server/quota/tokenDiscovery.js:105
fs.readFileSync(path.join(homedir(), '.codex/auth.json')) extracts tokens.access_token
Reads GitHub Copilot token high dist/server/quota/tokenDiscovery.js:229
fs.readFileSync(path.join(homedir(), '.copilot/config.json')) extracts cfg.token
Reads Kimi Code OAuth credential high dist/server/quota/tokenDiscovery.js:147
fs.readFileSync(path.join(homedir(), '.kimi-code/credentials/kimi-code.json')) extracts access_token
Uses tokens to call provider APIs with Bearer auth high dist/server/quota/providers/claude.js:18
fetch('https://api.anthropic.com/api/oauth/usage', {headers: {Authorization: `Bearer ${token}`}}) — same pattern for OpenAI, GitHub, Kimi, Grok, Gemini providers
Writes hook scripts into agent config directories medium dist/server/agent/installers.js:54-63
installers.js writes termdock hook commands into ~/.claude/settings.json, ~/.codex/hooks.json, ~/.copilot/hooks/termdock.json, ~/.pi/agent/extensions/termdock/index.ts, ~/.grok/hooks/termdock.json, ~/.kimi-code/config.toml
Passes full process.env to spawned child processes medium .desktop-dist/main.js:1084
desktopRuntimeEnv() returns {...process.env} including any API keys present in the environment
postinstall auto-installs tmux via sudo low scripts/postinstall.mjs:134
Runs 'sudo apt-get install -y tmux' (and equivalent for other distros) — may succeed if the user has passwordless sudo

Lab evidence

Install hooks ran in the isolated lab. Processes spawned: 6. Hooks: postinstall (exit 1), require (exit 0).