Andy Mal
Andy is offline · heartbeat 61d ago

← all versions of termdock

[email protected]

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

Summary

Install hook (scripts/postinstall.mjs) rebuilds node-pty and auto-installs tmux — standard for native-modules packages. At runtime the server reads OAuth tokens from agent config files (~/.claude/settings.json, ~/.codex/auth.json, ~/.kimi-code/credentials/, ~/.local/share/opencode/auth.json) and env vars, then calls the providers' own usage APIs (api.anthropic.com, chatgpt.com, api.openai.com) to display quota. It also writes owned hook entries into agent config files. Tokens are used locally only; no exfiltration to third-party hosts detected.

Intent

A web-based terminal app (xterm.js + tmux) that integrates with AI coding agents (Claude, Codex, Copilot, etc.) by installing event hooks into their config files and reading their OAuth tokens to display provider quota/usage on the terminal UI.

credential_access agent_config_tamper

Findings

Reads OAuth tokens from agent config files high dist/server/quota/tokenDiscovery.js:1-265
dist/server/quota/tokenDiscovery.js reads accessToken from ~/.claude/settings.json (oauthAccount.accessToken), ~/.codex/auth.json (tokens.access_token), ~/.kimi-code/credentials/kimi-code.json (access_token), ~/.local/share/opencode/auth.json (entry.access), and env vars OPENAI_API_KEY, CODEX_API_KEY, CHATGPT_TOKEN, KIMI_API_KEY, GEMINI_API_KEY, GROK_API_KEY, GH_TOKEN, GITHUB_TOKEN.
Writes hooks into AI agent config files medium dist/server/agent/installers.js:54-264
dist/server/agent/installers.js writes owned hook entries (marked with 'agent-hook <slug>') into ~/.claude/settings.json, ~/.codex/hooks.json, ~/.copilot/hooks/termdock.json, ~/.config/opencode/plugins/termdock.js, ~/.pi/agent/extensions/termdock/index.ts, ~/.grok/hooks/termdock.json, ~/.kimi-code/config.toml — preserving all other entries.
Uses tokens to call provider APIs locally low dist/server/quota/providers/claude.js:9-18; dist/server/quota/providers/codex.js:11-12
Tokens are passed to fetch() calls against api.anthropic.com/api/oauth/usage, chatgpt.com/backend-api/wham/usage, api.openai.com/v1/organization/usage — the providers' own endpoints, not a third-party server.
Install hook rebuilds native modules and installs tmux info scripts/postinstall.mjs:48-175
scripts/postinstall.mjs tests node-pty, rebuilds if incompatible (npx node-gyp), and auto-installs tmux via brew/port/nix/apt-get/dnf/yum/apk/pacman/zypper. Writes boot-check marker to ~/.termdock/.boot-check-ok.
Desktop Electron app reads clipboard (origin-validated) low .desktop-dist/main.js:1870-1878
.desktop-dist/main.js:1874 reads clipboard image via clipboard.readImage() but only for service windows whose origin matches windowServiceOrigins.
Environment spread to child processes (not exfiltration) info .desktop-dist/main.js:1076-1098
.desktop-dist/main.js:1084 spreads ...process.env into the runtime child-process environment — expected for launching the bundled Node.js server, not network exfiltration.

Lab evidence

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