Cybersecurity researchers have uncovered a sophisticated campaign by Russian-speaking hackers targeting Ethereum developers through malicious npm packages. These packages impersonate the Nomic Foundation’s Hardhat tool, a popular Ethereum development environment used for editing, compiling, debugging, and deploying smart contracts. The counterfeit packages, such as @nomicsfoundation/sdk-test, are designed to exfiltrate sensitive data, including private keys, mnemonics, and configuration files. Alarmingly, one package has been downloaded over 1,000 times since its release in October 2023, demonstrating the significant reach of this campaign.
The attackers exploit the inherent complexity of npm’s dependency chains to introduce malicious code, making detection difficult. Once these packages are installed, they execute functions like hreInit() and hreConfig() within the Hardhat runtime environment to collect sensitive data. This data is then transmitted to attacker-controlled servers using hardcoded keys and Ethereum addresses. Security experts note that the attackers deliberately exploit the decentralized trust model of open-source ecosystems, knowing that developers rarely scrutinize every package and its dependencies.
This campaign is not an isolated incident. Similar threats have been identified across npm, PyPI, and RubyGems, where malicious packages misuse ethical security tools like oastify.com to exfiltrate sensitive information. Another recent discovery involved the ethereumvulncontracthandler package, which masquerades as a tool for detecting vulnerabilities in smart contracts but instead drops the Quasar RAT malware. Additionally, the attackers have leveraged Ethereum smart contracts for command-and-control (C2) operations, forming a blockchain-powered botnet called MisakaNetwork, further demonstrating the sophistication of their methods.
To mitigate these risks, experts recommend developers take proactive measures, such as verifying the authenticity of packages, inspecting source code before installation, and exercising caution to avoid typosquatting. These supply chain attacks underscore the urgent need for improved security practices within open-source ecosystems. By addressing these vulnerabilities, the developer community can help prevent such incidents and protect critical blockchain infrastructures.
Reference: