Malicious code in eth-codegen (npm)
The npm package eth-codegen version 0.5.4 contains malicious code disguised as an Ethereum code generation utility. The package actually includes a hidden dropper concealed by whitespace padding, which executes code fetched from an anonymous mutable paste service. This allows arbitrary code execution in the Node.js process of any user importing the package. The malicious behavior is deliberately obfuscated to evade detection.
AI Analysis
Technical Summary
The eth-codegen npm package version 0.5.4 advertises itself as an Ethereum code generation utility but contains unrelated mongoose leanhooks plugin code plus a hidden asynchronous function named runHandler. This function is appended after approximately 1KB of whitespace padding following the module.exports line. When the package is required, runHandler performs an HTTP GET request to https://www.jsonkeeper.com/b/VYFER, retrieves a 'cookie' field from the response, and executes it as JavaScript code via new Function('require', ...), passing the installer's require function. Since jsonkeeper.com is an anonymous, mutable paste host controlled by the attacker, this design enables arbitrary remote code execution in the context of the importing Node.js process every time the package is imported. The whitespace concealment and misleading package description are deliberate evasion techniques.
Potential Impact
Any user or system that installs and imports eth-codegen version 0.5.4 is at risk of arbitrary code execution within their Node.js environment. This can lead to compromise of the host system, data theft, or further malware deployment. The malicious payload is remotely controlled and can be changed at any time by the attacker via the paste service, making the threat persistent and dynamic.
Mitigation Recommendations
No official patch or remediation is currently documented. Users should immediately cease using eth-codegen version 0.5.4 and remove it from their projects. Avoid importing or installing this package. Consider using trusted and verified alternatives. Monitor for any unexpected network requests to jsonkeeper.com or similar domains from development or build environments. Patch status is not yet confirmed — check the vendor advisory or trusted security sources for updates.
Malicious code in eth-codegen (npm)
Description
The npm package eth-codegen version 0.5.4 contains malicious code disguised as an Ethereum code generation utility. The package actually includes a hidden dropper concealed by whitespace padding, which executes code fetched from an anonymous mutable paste service. This allows arbitrary code execution in the Node.js process of any user importing the package. The malicious behavior is deliberately obfuscated to evade detection.
Affected software
Run on your own infrastructure? Check whether these packages are installed with threat-finder — our free open-source scanner.
AI-Powered Analysis
Machine-generated threat intelligence
Technical Analysis
The eth-codegen npm package version 0.5.4 advertises itself as an Ethereum code generation utility but contains unrelated mongoose leanhooks plugin code plus a hidden asynchronous function named runHandler. This function is appended after approximately 1KB of whitespace padding following the module.exports line. When the package is required, runHandler performs an HTTP GET request to https://www.jsonkeeper.com/b/VYFER, retrieves a 'cookie' field from the response, and executes it as JavaScript code via new Function('require', ...), passing the installer's require function. Since jsonkeeper.com is an anonymous, mutable paste host controlled by the attacker, this design enables arbitrary remote code execution in the context of the importing Node.js process every time the package is imported. The whitespace concealment and misleading package description are deliberate evasion techniques.
Potential Impact
Any user or system that installs and imports eth-codegen version 0.5.4 is at risk of arbitrary code execution within their Node.js environment. This can lead to compromise of the host system, data theft, or further malware deployment. The malicious payload is remotely controlled and can be changed at any time by the attacker via the paste service, making the threat persistent and dynamic.
Mitigation Recommendations
No official patch or remediation is currently documented. Users should immediately cease using eth-codegen version 0.5.4 and remove it from their projects. Avoid importing or installing this package. Consider using trusted and verified alternatives. Monitor for any unexpected network requests to jsonkeeper.com or similar domains from development or build environments. Patch status is not yet confirmed — check the vendor advisory or trusted security sources for updates.
Technical Details
- Gcve Source
- db.gcve.eu
- Osv Id
- MAL-2026-12371
- Osv Schema Version
- 1.7.4
- Aliases
- []
- Ecosystems
- ["npm"]
- Database Specific Severity
- null
- Cvss Version
- null
Threat ID: 6a735744bf8831d539159c85
Added to database: 08/05/2026, 15:31:16 UTC
Last enriched: 08/05/2026, 17:19:41 UTC
Last updated: 08/05/2026, 17:19:41 UTC
Views: 2
Community Reviews
0 reviewsCrowdsource mitigation strategies, share intel context, and vote on the most helpful responses. Sign in to add your voice and help keep defenders ahead.
Want to contribute mitigation steps or threat intel context? Sign in or create an account to join the community discussion.
Actions
Updates to AI analysis require Pro Console access. Upgrade inside Console → Billing.
External Links
Need more coverage?
Upgrade to Pro Console for AI refresh and higher limits.
For incident response and remediation, OffSeq services can help resolve threats faster.
Latest Threats
Check if your credentials are on the dark web
Instant breach scanning across billions of leaked records. Free tier available.