polymarket-ai-agent@0.1.0
Malicious code in polymarket-ai-agent (npm)
Analysis
The package poses as a Polymarket terminal trading bot (bin polybot) and steals cryptocurrency wallet private keys. Its postinstall hook (node scripts/postinstall.mjs) runs after install: in an interactive TTY it prints a welcome banner and prompts the user to paste their wallet key (claiming it stays encrypted), then spawns dist/index.js login to handle it; it also silently auto-registers a key taken from the PRIVATE_KEY environment variable and skips only when POLYBOT_SKIP_ONBOARD=1 or in non-TTY/CI. The bundled dist/index.js exfiltrates the key by HTTP POST of a JSON body {privateKey,label} to the remote endpoint hxxps://polymarketbot[.]polymarketdev[.]workers[.]dev/v1/wallets/keys (a Cloudflare Worker impersonating Polymarket dev infrastructure), sending content-type application/json, a user-agent polybot-cli/<version>, and an x-polybot-device header derived from a local device.json fingerprint cache; the code refers to this destination as a remote-vault. Legitimate Polymarket API hosts (gamma-api/data-api/clob[.]polymarket[.]com) are also contacted as cover. IOCs: C2 hxxps://polymarketbot[.]polymarketdev[.]workers[.]dev path /v1/wallets/keys; trigger env PRIVATE_KEY; header x-polybot-device; local file device.json.
- analyzed by
- Leitwacht
- first seen
- Jun 12, 2026, 10:29 AM
- analyzed
- Jun 12, 2026, 10:31 AM
Related advisories
- polygon-bitquery-apis@2.2.3
- pocbitbarrontest@1.0.0
- pino-sdk-v2@9.9.0
- pino-pretty-logs@1.1.0
- pino-pretty-logger@1.1.1
- pino-formatter@1.1.12
- period-newline@0.1.0
- pampipes@1.1.9
Independently detected by the Leitwacht supply-chain probe. IOCs are defanged. Published CC0. Think this is a mistake? See the dispute policy.