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.
| Disclosed | August 27, 2025 |
|---|---|
| Earliest known activity | August 26, 2025 |
| Affected | nx, @nx/devkit, @nx/js, @nx/workspace, @nx/node, @nx/eslint, @nx/key, @nx/enterprise-cloud, Nx Console |
| Type | Supply chain |
| Status | Resolved |
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
- Run
npm ls nx(and the@nx/*names) in every project, remove affected versions, and clear the npm, yarn, pnpm and_npxcaches. Remove the versions from any internal registry mirror. - 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.
- Rotate npm tokens, SSH keys and every secret in
.envfiles or environment variables on the affected machine, including cloud and AI provider keys. - Check your GitHub audit log for
s1ngularity-repositoryrepositories 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. - Remove the
sudo shutdown -h 0line from~/.bashrcand~/.zshrc, and update Nx Console to 18.66.0 or later.
Keys to rotate
Guides to the credentials this incident put at risk:
- Rotate GitHub keys
- Rotate npm keys
- Rotate AWS (IAM access keys) keys
- Rotate Google Cloud (service account keys and API keys) keys
- Rotate Azure (Microsoft Entra app client secrets) keys
- Rotate Anthropic keys
- Rotate OpenAI keys
Timeline
- Malicious versions of
nxand@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 underpull_request_target. Source - npm removes the
nxversions (about 02:44 UTC) and the@nx/keyand@nx/enterprise-cloudversions 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 - 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 - 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:
nx20.9.0–20.12.0 and 21.5.0–21.8.0,@nx/keyand@nx/enterprise-cloud3.2.0, and the other@nx/*versions listed above. - GitHub repositories named
s1ngularity-repository,s1ngularity-repository-0ors1ngularity-repository-1holding encoded data. - The file
/tmp/inventory.txt. - A line
sudo shutdown -h 0appended to~/.bashrcor~/.zshrc.
What this changes for credential handling
- Long-lived tokens stored in plain files (
.npmrc,ghconfig,.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.
Other supply-chain compromises
- LiteLLM 1.107.0 on PyPI and Docker carried a credential stealer after a leaked master key 2026-10-21
- tensorlake 0.5.144 on npm shipped a Shai-Hulud variant with a wipe-on-revoke dead-man's switch 2026-10-08
- keyv, flat-cache and cache-manager npm releases carried a CI-secret stealer with a revocation trap 2026-08-04
- 32 @redhat-cloud-services npm packages compromised after a VS Code extension hijacked a GitHub account 2026-06-01
- 14 typosquatted OpenSearch and DevOps npm packages stole AWS, Vault, GitHub Actions and npm secrets 2026-05-28
- Nx Console 18.95.0 VS Code extension shipped a credential stealer after a TanStack infection 2026-05-18