Malicious code in eth-batcher (npm)
The npm package eth-batcher contained malicious obfuscated code disguised as an Ethereum JSON-RPC batching library. The package's index.js was a copy of an unrelated Mongoose plugin with a ~149 KB obfuscated payload appended, which executes arbitrary code at require time via XOR/rotation decoding.
- Disclosed
- Last updated
- Blast radius
- Any Node.js process importing eth-batcher executes malicious payload at load time
- Ecosystems
- Attack vectors
- Affected entities
- eth-batchernpm package
The npm package eth-batcher was published with malicious code that executes immediately upon import. The package's index.js file contained a verbatim copy of an unrelated Mongoose LeanHooks Plugin, with a ~149 KB obfuscated Function(...) payload concatenated to the module.exports line.
The package.json advertised the package as an Ethereum JSON-RPC batching utility, but the actual shipped code contained no Ethereum or Web3 logic. This mismatch between advertised and actual functionality served as cover for the malicious dropper.
Upon require(), the payload constructs and executes code decoded from a hex byte table using an XOR/rotation decoder. Any Node.js process that imports this package will execute the decoded payload at load time, potentially compromising the entire application.
The incident was identified and credited to the OpenSSF's malicious-packages repository.
Indicators of compromise
- Packages
- eth-batcher
Remediation
- Immediately remove eth-batcher from all dependencies and package.json files
- Audit all Node.js processes that may have imported eth-batcher for signs of compromise
- Review npm audit logs and package lock files to identify when eth-batcher was installed
- Regenerate any credentials or secrets that may have been exposed to compromised processes
- Update to a safe version if a patched release is available, or use an alternative Ethereum batching library
- Implement package verification and code review processes for npm dependencies
Sources
- GitHub Advisory GHSA-vhg6-363w-6376 · GitHub Advisory Database
Cite this entry
"Malicious code in eth-batcher (npm)." supplychainattack.org, Supply Chain Attack Incident Catalog. Disclosed August 19, 2026; last updated August 19, 2026. https://supplychainattack.org/incident/malicious-code-in-eth-batcher-npm-1pctqr
Suggest a correction
Found an error or have a newer source? Corrections to factual errors take priority over new entries.
Related incidents
- containedcritical
Malicious code in 3-buildsight-web (npm)
The npm package 3-buildsight-web contains malicious code that fetches and executes arbitrary JavaScript from a remote Bitbucket URL on module load, granting full page privileges to an unverified third party.
npmCompromised package - resolvedcritical
Malicious code in @usaa-grp-personal-profile/personal-profile-common (npm)
Malicious package @usaa-grp-personal-profile/personal-profile-common version 999.0.0 published to public npm as a dependency-confusion attack targeting an organization's internal registry. The package contains preinstall and postinstall hooks that exfiltrate hostname, username, and working directory to an attacker-controlled OAST endpoint on every install.
npmDependency confusionCompromised package - resolvedcritical
Malicious code in create-coin (npm)
create-coin@20.1.1 on npm contained malicious postinstall code that collected sensitive environment variables, credentials, and host reconnaissance data. The package impersonated an esbuild platform build and exfiltrated data to a hardcoded endpoint.
npmCompromised packageTyposquatting - resolvedcritical
Malicious code in @syncraft-labs/vue (npm)
The npm package @syncraft-labs/vue version 0.4.1 contained malicious obfuscated code in its ESM build that implements a blockchain-hosted C2 dropper (EtherHiding pattern), enabling remote code execution on any consumer importing the package.
npmCompromised package