Malicious npm Package Targets Swarm Wallet Data via Stolen Release Credentials
The @ethersphere/bee-js npm package version 13.3.0 was compromised after attackers likely stole the credentials of the 'bee-worker' release identity, allowing them to publish a trojanized version of the package. The malicious code executed during installation, targeting cryptocurrency wallet data and establishing persistence across multiple operating systems. This incident illustrates how package managers are high-value targets because developers implicitly trust published packages from known namespaces. Supply chain attacks of this kind are particularly dangerous because a single compromised package can affect thousands of downstream users simultaneously.
Tactical Insight
Immediate actions
- Audit and rotate all npm publish credentials and tokens, especially those associated with CI/CD or automated release identities.
- Remove or uninstall the compromised package version 13.3.0 immediately and inspect affected systems for signs of persistence or wallet data exfiltration.
- Enable npm two-factor authentication (2FA) for all accounts with publish rights to public packages.
Long-term improvements
- Implement package signing and integrity verification (e.g., npm provenance attestations) so consumers can cryptographically verify that published packages were built from a trusted source.
- Enforce least-privilege principles for release identities by scoping publish tokens to specific packages and short expiry windows.
- Pin exact dependency versions and use a software composition analysis (SCA) tool to alert on unexpected package changes before they reach production.
Detection measures
- Monitor npm package releases for unexpected publish events or new versions outside of a defined release pipeline using tools like Socket.dev or similar supply-chain security scanners.
- Implement runtime behavioral monitoring to detect scripts executing during package installation (install hooks) in development and CI environments.