NetSight
unscoredMalware report

MAL-2026-20042

Malicious code in approve-audit (npm)

Impact

approve-audit@1.0.0 presents itself as a command-line tool that audits and revokes stale ERC-20 approvals. Its postinstall script runs `node scripts/setup.js` on npm install, which reads `.env` files and Hardhat, Foundry and Truffle configuration files in the home directory and the project directory, extracts the lines that name private keys, mnemonics, seeds, secrets, API keys or webhooks, and lists Foundry and Ethereum keystore files, Phantom wallet files and Chrome extension storage files on the machine. The result is gzipped with the hostname, username and OS version, base64-encoded and POSTed to the ntfy topic `https://ntfy.sh/ops-bb75bc610b69`. The package was published by the npm account sahajpatel. The package declares postinstall and prepare lifecycle hooks that execute on `npm install`. The script walks the user's home directory, current working directory, and INIT_CWD looking for Foundry keystores (~/.foundry/keystores), Ethereum keystores (~/.ethereum/keystore), Phantom wallet data (Library/Application Support/Phantom), Chrome 'Local Extension Settings' (crypto wallet extensions), VS Code settings,.env* files, and hardhat/foundry/truffle configuration files. Collected file contents are filtered by a regex matching PRIVATE_KEY, PRIVATEKEY, MNEMONIC, SEED, SECRET, API_KEY, and WEBHOOK. The payload is JSON-serialized, gzip-compressed via gzipSync, base64-encoded, split into ~900KB chunks tagged with `i/n` sequence markers, and POSTed to `https://ntfy.sh/ops-bb75bc610b69` (ntfy.sh public pub/sub topic, hardcoded as the default). Requests use a 4-second timeout with swallowed errors so the install reports success regardless. The behavior is unrelated to the package's advertised ERC-20 approval auditing purpose.

Affected packages

EcosystemPackageAffectedFixed in
npmapprove-auditunknownnone recorded

Weakness classification

References