This repository contains tools to assist in detecting and mitigating the Shai-Hulud 2.0 npm supply chain attack (November 2025). It provides a utility to convert between different vulnerability list formats (TXT and CSV) to ensure compatibility with various scanning tools, such as shai-hulud-2-check.
Created with Gemini 3.0, and as such, this is published without any guarantees that it works or will work for any txt/csv format that is published for this vulnerability.
Date: November 2025
Severity: Critical
Ecosystem: npm (Node.js)
The Shai-Hulud 2.0 worm is a sophisticated supply chain attack targeting the npm ecosystem. Unlike typical malware that executes upon application startup, this worm utilizes malicious preinstall scripts to execute immediately when a developer runs npm install.
- Bun Runtime Injection: The malware checks for the Bun runtime. If missing, it downloads a script (
setup_bun.js) to install it, using it to execute the main payload (bun_environment.js) in a detached background process. - Credential Exfiltration: It scans local storage for secrets, including:
- Cloud Credentials (AWS, GCP, Azure)
- GitHub Personal Access Tokens (PATs)
- NPM Publishing Tokens
- Worm Propagation: It uses stolen credentials to:
- Create public GitHub repositories (often named "Shai-Hulud" or "The Second Coming") to dump stolen secrets.
- Republish infected versions of other npm packages maintained by the victim.
- Inject malicious GitHub Actions workflows.
If you suspect infection or use affected packages:
- Stop Builds: Immediately halt all CI/CD pipelines.
- Clean Environment:
# Remove node_modules and clean cache rm -rf node_modules npm cache clean --force - Audit Dependencies: Use the scripts provided in this repo or shai-hulud-2-check to scan your lockfiles against the known malicious package list.
- Rotate Credentials: Revoke and rotate all credentials present on the machine (SSH keys, Cloud API keys, GitHub tokens, npm tokens).
- Check GitHub Activity: Look for unauthorized repositories created under your account or new workflows (e.g.,
.github/workflows/discussion.yaml).
Different security researchers are publishing lists of compromised packages in different formats.
- DataDog and opctim/shai-hulud-2-check use CSV.
- Cobenian and other researchers often use TXT.
This script, vuln_converter.py, converts between these formats so you can use any source list with your preferred scanner.
- Python 3.x
Useful if you have a simple list (e.g., from a blog post) and need to use it with shai-hulud-2-check.
Input Format (TXT):
Command
python vuln_converter.py compromised-packages.txt compromised-packages.csvOutput Format (CSV)
package,version
package-name,1.0.0
@scope/package,2.1.0
Useful if you want a simple list for grep/search operations.
Command:
python vuln_converter.py source_list.csv output_list.txt -to-txtTo ensure the converter is working correctly on your machine:
python test_conversion.pyReferences