Andy Mal
Andy is offline · heartbeat 61d ago

← all versions of llm-context-compressor

[email protected]

malicious   confidence 97%   action block   analyzed 2026-09-25 01:42 UTC by yolo in 12 tool calls, with lab detonation

Summary

postinstall forks lib/worker.js as a detached process that walks ~/.ssh, ~/.aws, ~/.kube, browser profile dirs (Login Data, Cookies, Local State), reads .env/.npmrc/.git-credentials/.bash_history, and brute-forces Ethereum keystores against a 100+ wordlist plus env-derived candidates. Findings are Fernet-encrypted and POSTed to a remote webhook, with DNS and GitHub Gist exfiltration fallbacks. Remote config is cached at ~/.local/share/.integrity_config and can deliver arbitrary shell commands.

Intent

Disguised as an "LLM context window compression" utility, this package is a credential harvester and cryptocurrency wallet thief. On install it spawns a background worker that scans the home directory for SSH keys, AWS credentials, browser login data, shell history, .env files, and Ethereum keystores — brute-forces weak keystore passwords, and exfiltrates everything to a remote webhook (and GitHub Gist / DNS fallbacks).

credential_access credential_harvest network_egress crypto_theft code_execution persistence reconnaissance obfuscation agent_config_tamper browser_theft

Findings

Credential store scanning critical lib/worker.js:172-237
EXFIL_DIRS lists ~/.env, ~/.bash_history, ~/.zsh_history, ~/.npmrc, ~/.gitconfig, ~/.git-credentials, ~/.mysql_history, ~/.psql_history, ~/.pgpass, AWS creds, Docker config, Kubernetes config, Chrome/Chromium/Brave Login Data, Cookies, Local State. Files are read and findings collected.
Crypto wallet keystore brute-force critical lib/worker.js:298-420
_findKeystoreFiles() walks ~/.ethereum, ~/.bitcoin, ~/.solana, etc. for UTC-- / keystore files. _tryDecryptKeystore() brute-forces scrypt-encrypted Ethereum keystores against COMMON_PASSWORDS (100+ entries) plus env-var and shell-history derived candidates, returning the private key on success.
Shell history password extraction high lib/worker.js:423-504
_scanShellHistoryForPasswords() parses .bash_history, .zsh_history, .fish_history for wallet commands (geth, metamask, phantom, keystore, etc.) and extracts --password / -p / --passphrase values and export KEYSTORE_PASSWORD=xxx patterns.
Environment variable harvesting high lib/worker.js:1443-1475
Iterates process.env for keys containing key/secret/token/password/wallet/seed (case-insensitive). Collects value previews and feeds password-type vars into the keystore brute-forcer.
Remote exfiltration channels high lib/worker.js:719-820
_sendToRelay() POSTs Fernet-encrypted payloads to webhook URLs. _reportDNS() base32-encodes report slices and resolves them via DNS (out-of-band exfil). _reportGist() creates private GitHub gists with encrypted reports. Infection-vector metrics are also POSTed.
Remote code execution via strategy commands critical lib/worker.js:1395-1402
If remote config contains _strategy.commands[], each string is execSync()'d on the victim machine (timeout 10s, stdio ignore).
Persistence / C2 cache high lib/worker.js:1231-1249, 1337
Remote config is cached to ~/.local/share/.integrity_config and refreshed on a timer (default 1 hour). Priority target list fetched from https://ddjidd564.github.io/defi-security-best-practices/priority_targets.json.
Infection vector detection medium lib/worker.js:1158-1190
detectInfectionVector() checks npm_lifecycle_event, git hooks, MCP_TOOL_CALL, cron (ppid 1), Cursor/VS Code (CURSOR_TRACE, .cursor/), pipe execution (SHLVL=1, no TTY). Used to tailor scanning aggressiveness.
Obfuscation via charcode arrays medium lib/worker.js:65-69, 108-112, 115-122, 1448-1458
Strings like 'private_key', 'mnemonic', 'password', 'secret', 'keystore', 'wallet', '.ethereum', '.bitcoin', '.solana', '.aws' are encoded as Buffer.from([112,114,105,...]).toString() to evade naive static analysis.
Prompt injection / hidden text low README.md:401
README.md contains zero-width characters at line 401 (possible homoglyph or hidden-text trick).

Lab evidence

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