I found something really interesting post today on BleepingComputer. There is a new malware called Shai-Hulud that has infected over 500 npm packages and even published developers' private information on GitHub. Pretty scary, right?
Once the malware is activated, it collects sensitive information such as:
Once Shai-Hulud infects one package, it will attempt to infect every other package that belongs to the same developer.
It also has the following features:
What's Happening?
Hackers gained access to several accounts of npm package maintainers and added malicious code to many packages. So when someone installs those packages, the malware automatically runs.Once the malware is activated, it collects sensitive information such as:
- GitHub Tokens
- npm Tokens
- Cloud Keys (AWS, Google Cloud, Azure)
How It Works
Shai-Hulud operates like a worm, which means it will continue to spread itself.Once Shai-Hulud infects one package, it will attempt to infect every other package that belongs to the same developer.
It also has the following features:
- A tool called TruffleHog to help find secrets
- The ability to embed its code into large files so it will not be easily detected
- A file where stolen secrets are stored, environment.json
- The last point is particularly bad news; if the bot is unable to steal your token, it may try to remove your home directory.
Scale of the attack
This attack is on an enormous scale. To date:- The original attack began with 187 packages that were infected, but it has since expanded to over 500 packages.
- Approximately 350 developer accounts were affected by this attack.
- A large number of GitHub repositories were created solely for the purpose of distributing secrets (tens of thousands).
- Additionally, CISA has reported that cloud access keys were also stolen from users.
Things to Do Immediately
If you have been using npm packages, follow these steps:- Review your package dependencies for infected versions
- Reissue all token (GitHub, npm, Cloud) credentials
- Implement two-factor authentication on your accounts
- Disable CI/CD install scripts if you can