Eight nx npm releases from 20.9.0 to 21.8.0 added a postinstall hook that hunted for secrets, live about five hours on 26 August 2025.
The nx npm package had eight malicious releases on 26 and 27 August 2025. Each added a telemetry.js file and a postinstall hook.
What happened
An attacker published poisoned nx releases to npm with a stolen publishing token.
- The postinstall script runs
node telemetry.js. It exits at once on Windows. - On other systems it collects GitHub tokens, npm tokens, SSH private keys,
.envfiles and cryptocurrency wallet files. - It runs local Claude, Gemini and q tools with safety checks off, using
--dangerously-skip-permissions,--yoloand--trust-all-tools. A prompt tells them to write file paths to/tmp/inventory.txt. - It creates a public GitHub repository named
s1ngularity-repositoryin the victim account and uploads the data asresults.b64. - It appends
sudo shutdown -h 0to~/.bashrcand~/.zshrc.
StepSecurity lists the first bad release at 10:32 PM UTC on 26 August 2025. The releases were live for about 5 hours 20 minutes. npm removed the versions at 02:44 AM on 27 August.
Affected versions
nx: 20.9.0, 20.10.0, 20.11.0, 20.12.0, 21.5.0, 21.6.0, 21.7.0, 21.8.0.@nx/devkit: 21.5.0 and 20.9.0.@nx/eslint,@nx/js,@nx/node,@nx/workspace: 21.5.0 and 20.9.0.@nx/enterprise-cloud: 3.2.0.- VS Code Nx Console 18.63.x to 18.65.x. StepSecurity lists 18.66.0 or later as the fix.
- Snyk also lists
@nx/keyamong the affected plugins.
Indicators of compromise
- File
telemetry.jsin an installed nx package and apostinstallscript that runs it. - Files
/tmp/inventory.txtand/tmp/inventory.txt.bak. - The line
sudo shutdown -h 0in~/.bashrcor~/.zshrc. - Public GitHub repositories named
s1ngularity-repositoryors1ngularity-repository-*that holdresults.b64. - Calls to
api.github.comduringnpm installandgh auth tokenruns bytelemetry.js. - Claude, Gemini or q runs in shell history with
--dangerously-skip-permissions,--yoloor--trust-all-tools.
How to check
List the nx versions in your project and compare them with the affected list. The command does not run any install script.
npm ls nx
Check for the shutdown line and the inventory file.
grep -n "shutdown -h 0" ~/.bashrc ~/.zshrc ls -l /tmp/inventory.txt*
What to do now
- Remove
node_modules, clear the npm cache withnpm cache clean --forceand reinstall nx at a clean version. - Delete the
sudo shutdown -h 0line from~/.bashrcand~/.zshrc, and remove/tmp/inventory.txt. - Rotate all GitHub tokens, npm tokens, SSH keys and API keys. Delete any
s1ngularity-repositoryrepositories. - Update Nx Console to 18.66.0 or later. Set
ignore-scripts=truein.npmrc.
What Vigilance would show
These examples show an install hold and the corresponding owner report.
Example install message
Vigilance blocked `nx`. This version is too new or changed in a way Vigilance must check first.
Example owner report
Bad update
nx
A build tool gained an install script that hunted for secrets, even asking local AI assistants to help.
No security team? See who reads the alert.
Frequently asked questions
What was the root cause?
Snyk reports a flawed GitHub Actions workflow added by pull request on 21 August 2025. StepSecurity names bash injection in a pull request title check and the pull_request_target trigger.
Was the Nx Console extension affected?
Yes. It was affected through automatic version checks.
Sources
Send this page to the person who looks after AI at your company.