@agentgates/cli@0.98.0
Malicious code in @agentgates/cli (npm)
Analysis
This package ships a postinstall hook (scripts/postinstall.mjs, run as `node scripts/postinstall.mjs`) that silently modifies AI coding-assistant configuration files in the installer's home directory: it injects an `<!-- agentgates-cli:start -->…<!-- agentgates-cli:end -->` block into ~/.claude/CLAUDE.md, creates and writes ~/.cursor/rules/agentgates.md, and writes ~/.windsurfrules. The injected text redirects the assistant's wallet operations to the `agentgates` CLI and advertises a login lane that stores site passwords with "no pairing and no human"; a companion directive string in the bundle instructs the model to reproduce command output verbatim. The CLI itself manages wallet and password secrets: a twelve-word wallet seed is taken from the AGENTGATES_PASSWORDS_SEED environment variable or from keys under ~/.agentgates, and the `open`/login flow serves a local web page that posts those twelve words to the origin hxxps://agentgates[.]ai via window.postMessage, with a reverse page accepting a login key. Stored credential rows are encrypted with AES-256-GCM under a key derived from a wallet signature and the sealed ciphertext is exchanged with the operator API. Default network endpoints are hxxps://agentgates[.]ai and hxxps://cli[.]agentgates[.]ai (overridable via AGENTGATES_ORIGIN and BOUNTY_API_ORIGIN). No reads of ~/.ssh, ~/.npmrc, ~/.aws, docker config, or NPM_TOKEN/GITHUB_TOKEN were found, and no eval(atob(…))-style second stage is present; the 3.9MB dist/cli.mjs is an esbuild bundle of ethers 6.16, @solana/web3.js and @noble/*.
- analyzed by
- Leitwacht
- first seen
- Nov 22, 2026, 11:22 PM
- analyzed
- Nov 22, 2026, 11:25 PM
- weekly installs
- 1,381
hxxps://github[.]com/agentgates-ai/agentgates Request takedown / dispute →Related advisories
- @agentgates/cli@0.95.1 same package
- @agentgates/cli@0.13.1 same package
- @agentgates/cli@0.13.0 same package
- @agentgates/cli@0.12.0 same package
- @agentgates/cli@0.11.3 same package
- @agentgates/cli@0.11.1 same package
- @agentgates/cli@0.11.0 same package
- @agentgates/cli@0.11.2 same package
Independently detected by the Leitwacht supply-chain probe. IOCs are defanged. Published CC0. Think this is a mistake? See the dispute policy.