Defense against the dark arts to restore user credentials and ensure comprehensive safety response.
The S1ngularity attack was a supply-chain attack targeting the Nx build tool (versions 20.9.0-20.12.0 and 21.5.0-21.8.0) that occurred on August 26-27, 2025. Malicious versions automatically created public GitHub repositories named s1ngularity-repository-*
containing stolen credentials including GitHub tokens, npm tokens, cloud keys, SSH keys, and API keys.
# Emergency response (immediate containment)
./scripts/emergency-response.sh
# Check for exposure
npm run check:all
# Clean up malicious code
npm run cleanup:all
# Revoke all credentials
npm run revoke:all
# Secure repositories
npm run repos:secure
# Restore original repository names
npm run repos:restore <csv_file>
npm run check:all
- Run all exposure checksnpm run check:nx
- Check for malicious Nx versionsnpm run check:repos
- Scan for rogue GitHub repositoriesnpm run check:local
- Check local system for indicatorsnpm run detect:events
- Detect repository renames via GitHub Events API
npm run cleanup:all
- Remove all malicious codenpm run cleanup:nx
- Uninstall malicious Nx versionsnpm run cleanup:persistence
- Remove shell persistence and malicious files
npm run revoke:all
- Revoke all credentialsnpm run revoke:github
- Revoke GitHub PATs, OAuth tokens, SSH keysnpm run revoke:npm
- Revoke npm authentication tokensnpm run revoke:cloud
- Revoke cloud provider and API keys
npm run repos:secure
- Make malicious repositories privatenpm run repos:restore
- Restore original repository names from CSV data
npm run monitor:all
- Run all monitoring checksnpm run monitor:github
- Monitor GitHub activitynpm run monitor:secrets
- Scan for exposed secrets
scripts/detection/
- Scripts to identify exposure and analyze eventsscripts/cleanup/
- Scripts to remove malicious codescripts/credentials/
- Scripts to revoke and rotate credentialsscripts/repos/
- Scripts for repository management and restorationscripts/monitoring/
- Scripts for ongoing security monitoringevents/
- CSV files containing repository rename data
The toolkit includes advanced event detection capabilities:
# Detect repository renames and public events
npm run detect:events
# Use specific CSV file for lookup
./scripts/detection/detect-renames-events.sh events/rename-bunsdev.csv
# Restore repository names using CSV data
./scripts/repos/restore-repos.sh events/rename-bunsdev.csv
Malicious Nx versions:
- 20.9.0 → 20.12.0
- 21.5.0 → 21.8.0
- Certain @nx/* plugins at 20.9.0 and 21.5.0
Safe version to install: nx@21.4.1
- Public GitHub repos named
s1ngularity-repository-*
- Files:
/tmp/inventory.txt
or/tmp/inventory.txt.bak
- Shell persistence:
grep -H "sudo shutdown -h 0" ~/.bashrc ~/.zshrc
- Repository renames to malicious patterns
- Unauthorized repository visibility changes
- Response Playbook - Complete incident response guide
- GitHub Checks Guide - How to review GitHub logs
- Credential Revocation Guide - GitHub token management
If you discover active compromise:
- Immediate containment: Run
./scripts/emergency-response.sh
- Disconnect from network if necessary
- Document everything for incident response
- Contact your security team
- Pin dependencies in lockfiles
- Require manual approval for GitHub Actions from forks
- Use short-lived OIDC tokens in CI/CD
- Regular credential rotation
- Monitor for suspicious repository activity