A sophisticated supply chain attack has compromized versions 1.95.6 and v1.95.7 of the widely-used @solana/web3.js JavaScript library.
Table of Contents
A sophisticated supply chain attack has compromised the widely-used @solana/web3.js JavaScript library. The attack, discovered on December 3, 2024, injected malicious code designed to steal private keys and drain cryptocurrency wallets.
Impact overview
Affected versions: 1.95.6 and 1.95.7 of @solana/web3.js
Exposure: On average, 350,000 to 450,000 weekly downloads on npm
Attack window: December 2, 2024, between 3:20 PM UTC and 8:25 PM UTC (confirmed by library maintainer Steven Luscher)
Documented losses: Approximately $160,000 in stolen SOL, plus additional tokens valued at over $31,000, according to on-chain data as of this writing
Technical analysis
Attackers compromised a publish-access account for the @solana/web3.js library. They injected malicious code that captures and transmits private keys to a hardcoded Solana address: FnvLGtucz4E1ppJHRTev6Qv4X7g8Pw6WPStHCcbAKbfx.
The attack utilized sophisticated obfuscation techniques. Datadog security researcher Christophe Tafani-Dereeper revealed the backdoor's key components:
Strategically injects into multiple code paths that access private keys
Exfiltrates data to a command-and-control server at sol-rpc[.]xyz
Although similar to previous supply chain compromises, this attack uses more advanced obfuscation methods. The attackers registered their command-and-control domain on November 22, 2024 through NameSilo, hiding behind CloudFront's services.
Who is affected
According to the library owner, the vulnerability impacts:
Projects that
Directly handle private keys
Updated dependencies during the exposure window
JavaScript bots or backend systems using private keys
Applications that integrated the compromised versions 1.95.6 or 1.95.7
The following are not affected:
Non-custodial wallets (they don't expose private keys during transactions)
Monitor official Solana channels for the latest security updates.
This incident shows the evolving sophistication of supply chain attacks. The quick response from the Solana community and security researchers limited the damage. However, it reinforces the need to stay vigilant.
Cyfrin Updraft
Learn smart contract development, how to write secure smart contracts, and scalable protocols from world's leading experts.