NPM supply chain Attack

Malicious npm packages target Ethereum developers’ private keys

Share:

Twenty malicious packages impersonating the Hardhat development environment used by Ethereum developers are targeting private keys and other sensitive data.

Collectively, the malicious packages have recorded more than one thousand downloads, researchers say.

Narrow targeting campaign

Hardhat is a widely used Ethereum development environment maintained by the Nomic Foundation. It is used for developing, testing, and deploying smart contracts and decentralized applications (dApps) on the Ethereum blockchain.

It is generally used by blockchain software developers, fintech firms and startups, and educational institutions.

These users often source their project components from the npm (Note Package Manager), a widely used tool in the JavaScript ecosystem that helps developers manage dependencies, libraries, and modules.

On npm, three malicious accounts uploaded 20 info-stealing packages that used typosquatting to impersonate legitimate packages and trick people into installing them.

Socket shared the names of 16 malicious packages, which are:

    1. nomicsfoundations
    2. @nomisfoundation/hardhat-configure
    3. installedpackagepublish
    4. @nomisfoundation/hardhat-config
    5. @monicfoundation/hardhat-config
    6. @nomicsfoundation/sdk-test
    7. @nomicsfoundation/hardhat-config
    8. @nomicsfoundation/web3-sdk
    9. @nomicsfoundation/sdk-test1
    10. @nomicfoundations/hardhat-config
    11. crypto-nodes-validator
    12. solana-validator
  1. node-validators
  2. hardhat-deploy-others
  3. hardhat-gas-optimizer
  4. solidity-comments-extractors

Once installed, code in those packages attempts to collect Hardhat private keys, configuration files, and mnemonics, encrypt them with a hardcoded AES key, and then exfiltrate them to the attackers.

“These packages exploit the Hardhat runtime environment using functions such as hreInit() and hreConfig() to collect sensitive details like private keys, mnemonics, and configuration files,” explains Socket.

“The collected data is transmitted to attacker-controlled endpoints, leveraging hardcoded keys and Ethereum addresses for streamlined exfiltration.”

Security risks and mitigations

Private keys and mnemonics are used to access Ethereum wallets, so the first potential ramification of this attack is the loss of funds through initiating unauthorized transactions.

Minimizing Risks in Ethereum supply

In addition, since many of the compromised systems belong to developers, the attackers could gain unauthorized access to production systems and compromise smart contracts or deploy malicious clones of existing dApps to lay the ground for more impactful, broader-scale attacks.

Hardhat configuration files can include API keys for third-party services as well as information about the development network and endpoints, and they can be leveraged to prepare phishing attacks.

Software developers should exercise caution, verify package authenticity, be wary of typosquatting, and inspect the source code before installation.

As a general recommendation, private keys should not be hardcoded but stored in secure vaults.

To minimize exposure to such risks, use lock files, define specific versions for your dependencies, and use as few as practically possible.

Source

Leave a Comment

Your email address will not be published. Required fields are marked *

loader-image
London, GB
11:11 pm, Jun 30, 2025
weather icon 25°C
L: 23° | H: 26°
clear sky
Humidity: 63 %
Pressure: 1014 mb
Wind: 3 mph SSE
Wind Gust: 0 mph
UV Index: 0
Precipitation: 0 mm
Clouds: 0%
Rain Chance: 0%
Visibility: 10 km
Sunrise: 4:46 am
Sunset: 9:21 pm
DailyHourly
Daily ForecastHourly Forecast
Tomorrow 10:00 pm
weather icon
23° | 26°°C 0 mm 0% 11 mph 65 % 1015 mb 0 mm/h
Wed Jul 02 10:00 pm
weather icon
19° | 26°°C 0 mm 0% 12 mph 75 % 1024 mb 0 mm/h
Thu Jul 03 10:00 pm
weather icon
14° | 26°°C 0 mm 0% 7 mph 53 % 1029 mb 0 mm/h
Fri Jul 04 10:00 pm
weather icon
16° | 28°°C 0 mm 0% 10 mph 47 % 1028 mb 0 mm/h
Sat Jul 05 10:00 pm
weather icon
16° | 21°°C 1 mm 100% 12 mph 90 % 1019 mb 0 mm/h
Tomorrow 1:00 am
weather icon
23° | 24°°C 0 mm 0% 3 mph 62 % 1014 mb 0 mm/h
Tomorrow 4:00 am
weather icon
21° | 22°°C 0 mm 0% 3 mph 65 % 1014 mb 0 mm/h
Tomorrow 7:00 am
weather icon
22° | 22°°C 0 mm 0% 5 mph 61 % 1014 mb 0 mm/h
Tomorrow 10:00 am
weather icon
28° | 28°°C 0 mm 0% 3 mph 44 % 1014 mb 0 mm/h
Tomorrow 1:00 pm
weather icon
30° | 30°°C 0 mm 0% 6 mph 32 % 1014 mb 0 mm/h
Tomorrow 4:00 pm
weather icon
34° | 34°°C 0 mm 0% 8 mph 26 % 1013 mb 0 mm/h
Tomorrow 7:00 pm
weather icon
32° | 32°°C 0 mm 0% 11 mph 31 % 1013 mb 0 mm/h
Tomorrow 10:00 pm
weather icon
25° | 25°°C 0 mm 0% 8 mph 46 % 1015 mb 0 mm/h
Name Price24H (%)
Bitcoin(BTC)
€91,726.36
0.08%
Ethereum(ETH)
€2,141.69
2.99%
Tether(USDT)
€0.85
0.00%
XRP(XRP)
€1.95
4.59%
Solana(SOL)
€134.28
4.10%
USDC(USDC)
€0.85
0.00%
Dogecoin(DOGE)
€0.142338
1.58%
Shiba Inu(SHIB)
€0.000010
0.00%
Pepe(PEPE)
€0.000009
2.69%
Scroll to Top