Skip to main content

Ethereum smart contracts used to push malicious code on npm

Medium
Published: Thu Sep 04 2025 (09/04/2025, 00:59:13 UTC)
Source: AlienVault OTX General

Description

A novel technique utilizing Ethereum smart contracts was discovered in two npm packages to conceal malicious commands for installing downloader malware. The packages, colortoolsv2 and mimelib2, are part of a larger campaign targeting npm and GitHub. The attackers created sophisticated GitHub repositories with fake popularity metrics to lure developers. The campaign focused on cryptocurrency-related projects, using blockchain technology to evade detection. This incident highlights the evolving strategies of malicious actors in compromising open-source repositories and the need for developers to carefully assess third-party packages before implementation.

AI-Powered Analysis

AILast updated: 09/04/2025, 10:19:49 UTC

Technical Analysis

This threat involves a novel supply chain attack technique leveraging Ethereum smart contracts to conceal malicious commands within npm packages, specifically colortoolsv2 and mimelib2. Attackers embed downloader malware installation commands inside these packages, which are then distributed via npm, a widely used package manager for JavaScript. The campaign also includes sophisticated GitHub repositories with artificially inflated popularity metrics to lure developers, particularly those working on cryptocurrency-related projects. By using blockchain technology, attackers evade traditional detection methods, as the malicious payloads are obfuscated through smart contracts on the Ethereum network. This approach complicates static and dynamic analysis since the malicious code is not directly embedded in the package but retrieved or triggered via interactions with Ethereum smart contracts. The campaign targets open-source ecosystems (npm and GitHub), exploiting trust in popular repositories and the growing interest in blockchain and cryptocurrency development. The attack techniques include social engineering (fake popularity), command execution (T1059.007 - PowerShell, T1059.001 - Command and Scripting Interpreter), supply chain compromise (T1195.001), user execution (T1204.002), and use of blockchain for evasion (T1528). The malware downloader can facilitate further payload delivery, potentially leading to data exfiltration, system compromise, or lateral movement. No known exploits in the wild have been reported yet, but the sophistication and stealth of this method pose a significant risk to developers and organizations relying on open-source packages for their software development.

Potential Impact

European organizations, especially those involved in software development, fintech, and cryptocurrency sectors, face considerable risk from this threat. The use of npm packages is widespread across Europe, and many enterprises integrate open-source components into their software supply chains. Compromise of these packages can lead to the introduction of downloader malware into development environments, potentially resulting in intellectual property theft, unauthorized access to internal systems, or the deployment of ransomware and other malware. The focus on cryptocurrency-related projects increases the risk for European fintech companies and blockchain startups, which are prominent in countries like Germany, the Netherlands, and Switzerland. Additionally, the stealthy nature of the attack leveraging Ethereum smart contracts complicates detection and response, increasing the likelihood of prolonged undetected compromise. This can undermine trust in open-source ecosystems and disrupt software development lifecycles, causing operational delays and financial losses.

Mitigation Recommendations

1. Implement strict vetting and validation processes for all third-party npm packages, especially those related to cryptocurrency or blockchain. 2. Use automated tools to analyze package dependencies and detect unusual behaviors, such as network calls to blockchain nodes or execution of scripts that interact with smart contracts. 3. Employ sandboxing and behavioral analysis in CI/CD pipelines to detect downloader or command execution activities before deployment. 4. Monitor for unusual outbound network traffic from development environments, particularly connections to Ethereum nodes or blockchain APIs. 5. Educate developers on the risks of blindly trusting package popularity metrics and encourage verification of package provenance and maintainers. 6. Maintain an allowlist of approved packages and versions, and regularly audit dependencies for updates or suspicious changes. 7. Collaborate with open-source communities to report and remediate malicious packages promptly. 8. Integrate threat intelligence feeds that include hashes and indicators related to this campaign to enhance detection capabilities. 9. Limit permissions and isolate build environments to reduce the impact of potential compromise. 10. Consider using package integrity verification mechanisms such as npm’s package signing or reproducible builds to detect tampering.

Need more detailed analysis?Get Pro

Technical Details

Author
AlienVault
Tlp
white
References
["https://www.reversinglabs.com/blog/ethereum-contracts-malicious-code"]
Adversary
null
Pulse Id
68b8e461fef64a908f432843
Threat Score
null

Indicators of Compromise

Hash

ValueDescriptionCopy
hash021d0eef8f457eb2a9f9fb2260dd2e391f009a21
hash1bb7b23f45ed80bce33a6b6e6bc4f99750d5a34b
hash678c20775ff86b014ae8d9869ce5c41ee06b6215
hashbda31e9022f5994385c26bd8a451acf0cd0b36da
hashc5488b605cf3e9e9ef35da407ea848cf0326fdea
hashdb86351f938a55756061e9b1f4469ff2699e9e27

Threat ID: 68b966f223d09a4424479487

Added to database: 9/4/2025, 10:16:18 AM

Last enriched: 9/4/2025, 10:19:49 AM

Last updated: 9/4/2025, 10:24:29 PM

Views: 6

Actions

PRO

Updates to AI analysis are available only with a Pro account. Contact root@offseq.com for access.

Please log in to the Console to use AI analysis features.

External Links

Need enhanced features?

Contact root@offseq.com for Pro access with improved analysis and higher rate limits.

Latest Threats