Cointime

Download App
iOS & Android

Supply Chain Attack Detected in Solana's web3.js Library

Cointime Official

From socket dev by Sarah Gooding

A supply chain attack has been detected in versions 1.95.6 and 1.95.7 of the popular @solana/web3.js library, which receives more than ~350,000 weekly downloads on npm. These compromised versions contain injected malicious code that is designed to steal private keys from unsuspecting developers and users, potentially enabling attackers to drain cryptocurrency wallets.

What We Know So Far:

  • Affected Versions: 1.95.6 and 1.95.7 of the @solana/web3.js library on npm.
  • Malicious Activity: The injected code captures private keys and transmits them to a hardcoded address.
  • Linked Wallet: The activity has been traced to the Solana address FnvLGtucz4E1ppJHRTev6Qv4X7g8Pw6WPStHCcbAKbfx.
  • Cause: Believed to be the result of a social engineering/phishing attack targeting maintainers of the official Web3.js open source library maintained by Solana.

Potential Impact:

  • Developers integrating these versions into their projects risk exposing their private keys.
  • Users of applications relying on the compromised library may have their wallets drained if private keys are compromised.

Immediate Actions for Developers:

  1. Check Dependencies: Audit your projects for any usage of @solana/web3.js and identify if versions 1.95.6 or 1.95.7 are in use.
  2. Rollback or Update: Downgrade to a safe version prior to 1.95.6 or update to version 1.95.8, which was released to remove the injected code.
  3. Verify Code: Manually inspect your node_modules directory and dependency trees for suspicious modifications.
  4. Revoke Access: Regenerate compromised keys and revoke permissions as needed.

How to Check If Your Application Is Affected

You can use Socket's free tools to check if your code is affected:

  • Install Socket and run a scan with the CLI (with socket scan create .). This is an easy way to see if you’re affected in a local repository.
  • Install the free Socket for GitHub app, which will let you find out if any repos across your organization are using the affected version (though repos won’t be scanned until there is a new commit in each repo on the default branch).

This is a developing story and we will update as we get more information.

Update:

npm has moved swiftly to remove the affected versions.

12/4/2024 - 6:50PM EST: In a post on Bluesky, Datadog cloud security researcher Christophe Tafani-Dereeper highlighted that the backdoor in v1.95.7 includes an "addToQueue" function designed to exfiltrate private keys using seemingly-legitimate CloudFlare headers.

"This function is strategically injected into various legitimate code paths that access the private key," Tafani-Dereeper explained.

He also noted that the associated domain (sol-rpc[.]xyz) was registered on November 22 via NameSilo and is currently hosted behind CloudFlare, although the C2 is currently down.

Impact of the Supply Chain Attack#

At 6:12PM on December 3, Anza, a Solana focused research and development firm, disclosed that a publish-access account was compromised, allowing the threat actor to steal private key material and drain funds from dapps, like bots, that handle private keys directly.

Anza clarified that the attack should not affect non-custodial wallets, because they don't expose private keys during transactions.

This is not an issue with the Solana protocol itself, but with a specific JavaScript client library and only appears to affect projects that directly handle private keys and that updated within the window of 3:20pm UTC and 8:25pm UTC on Tuesday, December 2, 2024.

Anza recommends developers who suspect they were compromised to rotate any suspect authority keys, including multisigs, program authorities, and server keypairs.

Mert Mumtaz, CEO of Helius Labs, a Solana development tools company, estimated the damage from this attack to be roughly $130K. Decrypt projected the breach led to $160K in stolen assets, including SOL tokens and other crypto assets, based on Solscan data for the hardcoded wallet.

Mumtaz reports that most major wallets and apps were not affected or not using the compromised versions, including Phantom, Backpack, Coinbase, Exodus, and Kamino. Apps that were not blindly upgrading to the latest versions from npm during the few hours when the compromised versions were live, are likely not affected by the incident. These packages were promptly removed from npm to mitigate the damage to developers and apps relying on Solana's web3.js library.

Comments

All Comments

Recommended for you

  • Japanese listed company ANAP Holdings increased its holdings of Bitcoin by 127.73.

    according to market sources, Japanese listed company ANAP Holdings has disclosed an increase in its Bitcoin holdings by 127.73 coins. As of now, the company's total Bitcoin holdings have reached 1,346.58 coins, valued at approximately 118 million USD.

  • Changpeng Zhao: Binance Wallet now supports identifying malicious addresses; you will receive a warning if you transfer funds to them.

    Zhao Changpeng posted on Binance Plaza stating, "The cryptocurrency industry should be able to completely eradicate address poisoning attacks and protect users. All wallets should simply check whether the receiving address is a poisoned address and block the user.This is a blockchain query. Wallets should not even display these junk transactions anywhere. If the value of the transaction is very small, filter it out. Security alliances in the industry should maintain a real-time blacklist of these addresses so that wallets can check before sending transactions. Binance Wallet is already doing this. If a user tries to send to a malicious address, they will receive a warning.

  • Bitcoin spot ETFs saw a total net outflow of $189 million yesterday, marking the fourth consecutive day of net outflows.

     according to SoSoValue data, the total net outflow of Bitcoin spot ETFs is 189 million USD.The Bitcoin spot ETF with the largest single-day net outflow yesterday was Blackrock's ETF IBIT, with a single-day net outflow of 157 million USD. Currently, IBIT's total historical net inflow has reached 62.34 billion USD. The second is Fidelity's ETF FBTC, with a single-day net outflow of 15.2979 million USD. Currently, FBTC's total historical net inflow has reached 12.189 billion USD. As of the time of writing, the total net asset value of Bitcoin spot ETFs is 114.289 billion USD, with the ETF net asset ratio (market value as a proportion of Bitcoin's total market value) reaching 6.53%, and the cumulative historical net inflow has reached 57.076 billion USD.

  • BTC falls below $88,000

     market shows BTC fell below $88,000, currently at $87,997.85, 24-hour decline reaches 0.88%, market volatility is significant, please manage your risk accordingly.

  • The U.S. spot Ethereum ETF saw net inflows of $84.59 million yesterday.

     according to Trader T monitoring, the US spot Ethereum ETF had a net inflow of 84.59 million USD yesterday.

  • ETH breaks $3,000

     the market shows ETH breaking through $3000, currently at $3000.08, with a 24-hour decline of 0.38%. The market is highly volatile, please manage your risk accordingly.

  • Binance Wallet launches "secure auto-signature" service

     according to the official announcement, Binance Wallet has launched the "Secure Auto Sign" (SAS) service: it now supports mnemonic/private key wallets to trade on Binance Wallet (web version).

  • Circle minted 500 million USDC on the Solana network.

    according to Onchain Lens monitoring, Circle has minted 500 million USDC on the Solana network. Since October 11, Circle has issued a total of 18 billion USDC on the Solana network.

  • Sources familiar with the matter: JPMorgan Chase is considering offering cryptocurrency trading services to institutional clients.

    according to Bloomberg, as major global banks deepen their involvement in the cryptocurrency asset class, JPMorgan Chase is considering offering cryptocurrency trading services to its institutional clients. A knowledgeable source revealed that JPMorgan is evaluating what products and services its market division can offer to expand its business in the cryptocurrency field. The source stated that these products and services may include spot and derivatives trading.