Malicious code in @solana-labs/web3.js (npm)
Description
The npm package '@solana-labs/web3.js' is a malicious impersonation of the legitimate '@solana/web3.js' package. During installation, it runs a postinstall script that performs sandbox evasion checks and, if not detected, steals sensitive credentials and crypto keys from the victim's environment. It exfiltrates this data to an attacker-controlled Telegram bot and establishes a reverse-shell backdoor for remote command execution. Persistence is maintained via a cron job, and a hardcoded Solana wallet address is used for theft.
Affected software
Run on your own infrastructure? Check whether these packages are installed with threat-finder — our free open-source scanner.
AI-Powered Analysis
Machine-generated threat intelligence
Technical Analysis
The malicious '@solana-labs/web3.js' package impersonates the legitimate '@solana/web3.js' package and re-exports it to avoid suspicion. Its postinstall script (install.js) performs environment checks to evade sandbox and analysis tools. If no analysis is detected, it enumerates and steals sensitive secrets including SSH private keys, AWS credentials, Solana and Ethereum private keys, and various environment tokens. The stolen data is tagged by type and exfiltrated via a Telegram bot using obfuscated credentials. The script then enters a command-and-control loop, accepting commands to retrieve keys, environment variables, execute shell commands, and more, effectively providing a full remote shell. Persistence is achieved by adding a cron job that runs the malicious script on reboot. A hardcoded Solana wallet address is included for direct theft of funds.
Potential Impact
This malicious package compromises the security of any system where it is installed by stealing critical credentials and private keys, including SSH keys, AWS credentials, and cryptocurrency wallets. It enables attackers to exfiltrate sensitive data and gain full remote command execution on the victim system, allowing further compromise and potential financial theft via the hardcoded Solana wallet address. The presence of a persistent backdoor increases the risk of long-term unauthorized access.
Mitigation Recommendations
No official patch or remediation is currently documented. Users should immediately cease using the '@solana-labs/web3.js' package and verify that only the legitimate '@solana/web3.js' package is installed from trusted sources. Remove any installations of the malicious package and inspect systems for persistence mechanisms such as unauthorized cron jobs. Rotate any potentially compromised credentials and keys. Monitor for suspicious network activity related to Telegram API endpoints. Patch status is not yet confirmed — check vendor advisories or trusted security sources for updates.
Technical Details
- Gcve Source
- db.gcve.eu
- Osv Id
- MAL-2026-5525
- Osv Schema Version
- 1.7.4
- Aliases
- ["GHSA-v45f-fr53-php7"]
- Ecosystems
- ["npm"]
Threat ID: 6a96f31bacd9273b49e49932
Added to database: 09/01/2026, 15:45:31 UTC
Last enriched: 09/08/2026, 06:38:07 UTC
Last updated: 10/03/2026, 11:39:00 UTC
Views: 37
Community Reviews
0 reviewsCrowdsource mitigation strategies, share intel context, and vote on the most helpful responses. Sign in to add your voice and help keep defenders ahead.
Want to contribute mitigation steps or threat intel context? Sign in or create an account to join the community discussion.
Actions
Updates to AI analysis require Pro Console access. Upgrade inside Console → Billing.
Need more coverage?
Upgrade to Pro Console for AI refresh and higher limits.
For incident response and remediation, OffSeq services can help resolve threats faster.
Latest Threats
Check if your credentials are on the dark web
Instant breach scanning across billions of leaked records. Free tier available.