Ethereum Smart Contracts Used to Distribute Undetected JavaScript Malware to Developers
Ethereum
Ethereum Smart Contracts Used to Distribute Undetected JavaScript Malware to Developers

Hackers are leveraging Ethereum smart contracts to conceal malware scripts within seemingly benign npm packages, a tactic that turns the blockchain into a robust command channel and complicates efforts to halt attacks. ReversingLabs has detailed two npm packages, colortoolsv2 and mimelib2. These packages read a contract on Ethereum to retrieve a URL for a second-stage downloader, rather than hardcoding infrastructure directly into the package. This minimises static indicators and leaves fewer traces in the source code.
These packages first appeared in July and were removed following disclosure. ReversingLabs traced their promotion to a network of GitHub repositories posing as trading bots, including solana-trading-bot-v2, complete with fake stars, inflated commit histories, and sham maintainers. This social layer directed developers toward the malicious dependency chain. Although download numbers were low—seven for colortoolsv2 and only one for mimelib2—the method employed is significant. It remains an opportunity for opportunistic developers. Snyk and OSV have since classified both packages as malicious, facilitating quick checks for teams auditing historical builds.
History repeating
The use of the blockchain as a command channel mirrors a broader campaign tracked by researchers in late 2024, involving hundreds of npm typosquats. In that wave, packages executed install or preinstall scripts that consulted an Ethereum contract, requested a base URL, and subsequently downloaded OS-specific payloads with names such as node-win.exe, node-linux, or node-macos. Checkmarx documented a core contract at 0xa1b40044EBc2794f207D45143Bd82a1B86156c6b in combination with a wallet parameter 0x52221c293a21D8CA7AFD01Ac6bFAC7175D590A84. During this, infrastructure was observed such as 45.125.67.172:1337 and 193.233.201.21:3001.
Phylum’s deobfuscation shows how the ethers.js call to getString(address) worked on the same contract, as well as the rotation of C2 addresses over time. This behaviour turns the contract status into a movable pointer for retrieving malware. Socket independently mapped the typosquat flood and published matching Indicators of Compromise (IOCs), confirming consistency across sources.
The use of the blockchain as a command channel mirrors a broader campaign tracked by researchers in late 2024, involving hundreds of npm typosquats.
An old vulnerability continues to thrive
ReversingLabs positions the 2025 packages as a continuation of the technique rather than the scale, with the nuance that the smart contract houses the URL for the next stage, rather than the payload itself. Distribution via GitHub, with fake stars and trivial commits, is aimed at passing informal due diligence and leverages automatic dependency updates within clones of the fake repositories.
This design shows similarities to earlier applications of external platforms for indirection, such as GitHub Gist or cloud storage. However, on-chain storage offers immutable proof, public readability, and a neutral environment that cannot be easily taken offline by defenders. According to ReversingLabs, concrete IOCs include the Ethereum contracts 0x1f117a1b07c108eae05a5bccbe86922d66227e2b, related to the July packages, and the 2024 contract 0xa1b40044EBc2794f207D45143Bd82a1B86156c6b, as well as the wallet 0x52221c293a21D8CA7AFD01Ac6bFAC7175D590A84. The host patterns 45.125.67.172 and 193.233.201.21 revolve around ports 1337 or 3001, with the aforementioned payload names. Hashes for the second stage of 2025 include 021d0eef8f457eb2a9f9fb2260dd2e391f009a21, and for the 2024 wave, Checkmarx lists the SHA-256 values for Windows, Linux, and macOS. ReversingLabs has also published SHA-1 hashes for each malicious npm version, helping teams scan artifact stores for previous exposure.
Protection against the attack
Regarding defence, the immediate check is to prevent the execution of lifecycle scripts during installation and continuous integration (CI). npm documents the --ignore-scripts flag for npm ci and npm install, and teams can set this globally in .npmrc and then selectively allow necessary builds with a separate step. Node.js security guidelines advise the same approach, alongside pinning versions via lockfiles and stricter assessment of maintainers and metadata.
Blocking outbound traffic to the aforementioned IOCs and alerting on build logs that initialise ethers.js for calling getString(address) offer practical detections that align with the chain-based C2 design. While the packages may have disappeared, the pattern persists, and on-chain indirection now stands alongside typosquats and fake repositories as a traceable way to reach developer machines.
- eth
- Ethereum
- Smart contracts

Written by
Lieke van Dijk
Tech editor · Utrecht (NL)
Expertise
Lieke writes about blockchain technology, AI, and security. She tests protocols and wallets herself and explains why a technical choice matters to users.
Related articles
- Ethereum Surpasses Netflix And Mastercard In Value
- Standard Chartered Forecasts Ethereum at $25,000 Within 30 Months
- Ethereum Options Interest Hits $13.75 Billion Amid Bullish Bets
- Ethereum Prepares for 1.4 Billion New Users With Launch of Alipay's L2
- Assessing Ethereum's Health: The Role of Liquidation and Rising Open Interest
- Ethereum at a Crossroads: Analysis of Crucial Support Zone and Potential Rally
Stay in the loop
Follow Block #9.
Practice without real money or test your knowledge?
Read more
Other interesting articles
Crypto Overzetten Tussen Unichain En OP Mainnet Kan Binnenkort Zonder Externe Brug
- 02Thirty Years at Deere Brings Klaus Hoehn to the Board of Titan International

- 03Robinhood Biedt Getokeniseerde Aandelen Aan, AMC Eist Ingreep Van De Beurswaakhond

- 04Dolomite Closes Doors to WLFI, Existing Positions Must Be Closed

- 05Cypherpunk Acquires Tennessee Data Centre for Nearly Eight Million Dollars


