Supply chain · August 27, 2025

Nx "s1ngularity" npm compromise used local AI CLIs to hunt for secrets and leaked them to GitHub

On 26 August 2025 an attacker used a stolen npm token to publish malicious versions of nx and several @nx/* packages. A postinstall script collected GitHub and npm tokens, SSH keys, .env files and crypto wallets, and uploaded them, encoded, to a public s1ngularity-repository in the victim's own GitHub account. If you installed an affected version, rotate your GitHub, npm and cloud credentials and check your GitHub account for those repositories.

DisclosedAugust 27, 2025
Earliest known activityAugust 26, 2025
Affectednx, @nx/devkit, @nx/js, @nx/workspace, @nx/node, @nx/eslint, @nx/key, @nx/enterprise-cloud, Nx Console
TypeSupply chain
StatusResolved

What was exposed

On Linux and macOS machines that installed an affected version: the GitHub CLI's token (gh auth token), the contents of .npmrc and npm tokens, SSH keys, .env files, cryptocurrency wallets and keystores, and the paths of other files the malware listed. Wiz counted more than 1,000 valid GitHub tokens, dozens of valid cloud credentials and npm tokens, and about 20,000 other files in the first phase. In the second phase, private source code was exposed when stolen tokens were used to make private repositories public. The malware also prompted locally installed AI coding CLIs (Wiz names Claude, Gemini and Amazon Q) with permission-skipping flags to help search the disk.

Am I affected?

You are affected if your machine or CI ran npm install (or npx) with any of these versions: nx 20.9.0, 20.10.0, 20.11.0, 20.12.0, 21.5.0, 21.6.0, 21.7.0 or 21.8.0; @nx/devkit, @nx/js, @nx/workspace or @nx/node 20.9.0 or 21.5.0; @nx/eslint 21.5.0; @nx/key or @nx/enterprise-cloud 3.2.0. The Nx Console VS Code extension from 18.6.30 to 18.65.1 could install nx@latest when the editor opened, so editor users may be affected without running a command. Signs on disk are /tmp/inventory.txt and a sudo shutdown -h 0 line in ~/.bashrc or ~/.zshrc. On GitHub, look for a repository named s1ngularity-repository, -0 or -1 in your account or organization audit log.

What to do now

  1. Run npm ls nx (and the @nx/* names) in every project, remove affected versions, and clear the npm, yarn, pnpm and _npx caches. Remove the versions from any internal registry mirror.
  2. Revoke your GitHub CLI token by revoking the GitHub CLI OAuth app in your GitHub settings, then sign in again. Rotate GitHub personal access tokens and your GitHub password.
  3. Rotate npm tokens, SSH keys and every secret in .env files or environment variables on the affected machine, including cloud and AI provider keys.
  4. Check your GitHub audit log for s1ngularity-repository repositories and for private repositories that were made public on 2025-08-28 or 2025-08-29. Keep a copy for your records, then delete or re-privatize them.
  5. Remove the sudo shutdown -h 0 line from ~/.bashrc and ~/.zshrc, and update Nx Console to 18.66.0 or later.

Keys to rotate

Guides to the credentials this incident put at risk:

Timeline

  1. Malicious versions of nx and @nx/* packages are published to npm from about 22:32 UTC. The token had been stolen through a GitHub Actions workflow that interpolated pull-request titles into a shell step under pull_request_target. Source
  2. npm removes the nx versions (about 02:44 UTC) and the @nx/key and @nx/enterprise-cloud versions later that day. Nx publishes advisory GHSA-cxm3-wv7p-598c. Wiz reports that GitHub disabled the attacker-created repositories at about 09:00 UTC. Source
  3. Wiz reports a second phase: leaked GitHub tokens are used to make victims' private repositories public and rename them s1ngularity-repository- plus five random letters. Wiz's final count was more than 400 users and organizations and more than 5,500 repositories. Source
  4. Nx publishes a postmortem and says it has moved publishing to npm trusted publishing with OIDC and manual 2FA approval. Source

Indicators

From the advisories listed below. Use them to search your logs, lockfiles and workflow runs.

  • Affected versions: nx 20.9.0–20.12.0 and 21.5.0–21.8.0, @nx/key and @nx/enterprise-cloud 3.2.0, and the other @nx/* versions listed above.
  • GitHub repositories named s1ngularity-repository, s1ngularity-repository-0 or s1ngularity-repository-1 holding encoded data.
  • The file /tmp/inventory.txt.
  • A line sudo shutdown -h 0 appended to ~/.bashrc or ~/.zshrc.

What this changes for credential handling

  • Long-lived tokens stored in plain files (.npmrc, gh config, .env) were the main prize. BotPassword keeps such tokens encrypted and hands them only to the specific command that needs them.
  • Local AI agents run with the developer's own file access, so malware can try to recruit them. BotPassword is built so that agents use credentials through scoped intents without receiving the values.

Frequently asked questions

Am I affected by the nx incident?

You are affected if your machine or CI ran npm install (or npx) with any of these versions: nx 20.9.0, 20.10.0, 20.11.0, 20.12.0, 21.5.0, 21.6.0, 21.7.0 or 21.8.0; @nx/devkit, @nx/js, @nx/workspace or @nx/node 20.9.0 or 21.5.0; @nx/eslint 21.5.0; @nx/key or @nx/enterprise-cloud 3.2.0. The Nx Console VS Code extension from 18.6.30 to 18.65.1 could install nx@latest when the editor opened, so editor users may be affected without running a command. Signs on disk are /tmp/inventory.txt and a sudo shutdown -h 0 line in ~/.bashrc or ~/.zshrc. On GitHub, look for a repository named s1ngularity-repository, -0 or -1 in your account or organization audit log.

What was exposed in the nx incident?

On Linux and macOS machines that installed an affected version: the GitHub CLI's token (gh auth token), the contents of .npmrc and npm tokens, SSH keys, .env files, cryptocurrency wallets and keystores, and the paths of other files the malware listed. Wiz counted more than 1,000 valid GitHub tokens, dozens of valid cloud credentials and npm tokens, and about 20,000 other files in the first phase. In the second phase, private source code was exposed when stolen tokens were used to make private repositories public. The malware also prompted locally installed AI coding CLIs (Wiz names Claude, Gemini and Amazon Q) with permission-skipping flags to help search the disk.

Which keys should I rotate?

Rotate any GitHub, npm, AWS (IAM access keys), Google Cloud (service account keys and API keys), Azure (Microsoft Entra app client secrets), Anthropic, OpenAI credentials that were reachable from affected systems, starting with the ones that can publish code or reach production.

Keep keys out of reach of the next compromised package

BotPassword is in early access. Request an invite and we'll email you when your spot opens.