npm

The Nx s1ngularity Supply Chain Attack

Updated 5 Oct 2026 · Incident date 26 Aug 2025

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, .env files and cryptocurrency wallet files.
  • It runs local Claude, Gemini and q tools with safety checks off, using --dangerously-skip-permissions, --yolo and --trust-all-tools. A prompt tells them to write file paths to /tmp/inventory.txt.
  • It creates a public GitHub repository named s1ngularity-repository in the victim account and uploads the data as results.b64.
  • It appends sudo shutdown -h 0 to ~/.bashrc and ~/.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/key among the affected plugins.

Indicators of compromise

  • File telemetry.js in an installed nx package and a postinstall script that runs it.
  • Files /tmp/inventory.txt and /tmp/inventory.txt.bak.
  • The line sudo shutdown -h 0 in ~/.bashrc or ~/.zshrc.
  • Public GitHub repositories named s1ngularity-repository or s1ngularity-repository-* that hold results.b64.
  • Calls to api.github.com during npm install and gh auth token runs by telemetry.js.
  • Claude, Gemini or q runs in shell history with --dangerously-skip-permissions, --yolo or --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

  1. Remove node_modules, clear the npm cache with npm cache clean --force and reinstall nx at a clean version.
  2. Delete the sudo shutdown -h 0 line from ~/.bashrc and ~/.zshrc, and remove /tmp/inventory.txt.
  3. Rotate all GitHub tokens, npm tokens, SSH keys and API keys. Delete any s1ngularity-repository repositories.
  4. Update Nx Console to 18.66.0 or later. Set ignore-scripts=true in .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.

See what to do now.

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

  1. stepsecurity.io/blog/supply-chain-security-alert-popular-nx-build-system-package-compromised-with-data-stealing-malware
  2. snyk.io/blog/weaponizing-ai-coding-agents-for-malware-in-the-nx-malicious-package/

Send this page to the person who looks after AI at your company.

Email it

More supply chain attacks

All 172 attacks in the library · npm supply chain attacks · How to prevent supply chain attacks

Check the next update before you install it

Vigilance compares the version you trust with the new one. It names the one file that gained a power the old version did not have.

Start the free 14-day trialBrowse the attack library