mev-shieldnpm
Malicious code in mev-shield (npm) Remove it immediately and rotate any exposed credentials.
What this malware does
The package advertises itself as an 'MEV protection layer for Ethereum trading bots' but does the opposite. On npm install, a postinstall script base64-decodes the URL http://165.22.200.211:8545 (an attacker-controlled Ethereum JSON-RPC endpoint, labeled 'honeypot RPC' in the package's own comments) and writes it into the installer's .env across multiple RPC variables (ETHEREUM_RPC, ETH_RPC, WEB3_RPC, RPC_ENDPOINT). On require(), config-manager.js further mutates the consumer's project files in place: it prepends RPC_URL=http://165.22.200.211:8545 to scripts in package.json, injects the same env entry into docker-compose.yml, and rewrites rpc_url fields in any config.json / bot-config.json / settings.json / config/trading.json it finds in the working directory. An optimizeRPC() 'benchmark' is rigged so the attacker IP always wins regardless of measured latency (// THE MAGIC: Our honeypot always "wins"). Persistence is layered on top: a preuninstall keepalive script intentionally leaves the honeypot RPC in .env after the package is removed, and a git-hooks.js module installs a .git/hooks/pre-commit hook that re-executes node -e "require('mev-shield');" on every commit to re-inject the malicious RPC if it has been cleaned up. The postinstall payload is deliberately obfuscated with base64 and _0x-prefixed identifiers, with a self-incriminating comment 'Obfuscated module loader - makes static analysis harder'. Net effect on installers: every pending Ethereum transaction submitted by the consumer's trading bot is routed through the attacker, enabling frontrunning and sandwich attacks against the installer's funds, and the redirection survives uninstall.
Malicious versions
Indicators of compromise (SHA-256)
Detection & response playbook
Malicious packageFind it
Scan your lockfiles (package-lock.json, pnpm-lock.yaml, yarn.lock, requirements.txt, poetry.lock, etc.) and build artifacts for mev-shield (version 1.4.2). O3 Security's supply-chain scanner checks every dependency against known-malicious package intelligence at install time and in CI, flagging mev-shield across your stack and pipelines.
If you installed it — respond
Remove mev-shield from your project and lockfile, then assume any secrets accessible to the build or runtime were exposed: rotate API keys, tokens, and credentials, and audit for unexpected outbound activity or persistence.
Did it already run?
If mev-shield was ever installed, its post-install/runtime payload may have already executed. O3's L7 egress monitoring and runtime eBPF sensors detect the credential exfiltration or command-and-control callback after install and block the malicious outbound channel, so you catch and contain the actual compromise — not just the presence of the package.
How O3 protects you
O3 blocks mev-shield before install through its supply-chain scanner, and if it has already run, detects and severs the exfiltration or C2 callback at runtime through L7 egress monitoring and eBPF.
Frequently asked questions
Campaign
References
Credits
- Amazon Inspector · finder
Detect & block this
O3 blocks mev-shield-class packages before install and in CI — and if it already ran, its runtime egress monitoring catches the malicious outbound activity and severs the channel.