Nx packages shipped s1ngularity credential stealer
The s1ngularity incident began with a vulnerable Nx GitHub Actions workflow that combined pull_request_target privileges with shell injection in pull-request metadata. The attacker used it to publish malicious nx, @nrwl/nx, and @nx package versions.
Story
Late on the evening of August 26, 2025, an attacker pushed malicious releases of the nx build tool and several related @nrwl/* packages to the npm registry, planting a postinstall script that searched developer machines for credentials and then conscripted any locally installed AI coding assistant it could find to help with the search. According to The Register, publishing began at 22:32 UTC and continued for just over two hours before npm removed the affected versions, alerted at 02:58 UTC the following morning.
Nx is a popular open-source build system for JavaScript and TypeScript monorepos, maintained by the company Nrwl, with several million weekly downloads on npm. The intrusion path did not start in the registry. It started in a GitHub Actions workflow on the Nx repository that combined pull_request_target privileges with shell-interpolated pull-request metadata, a long-recognized misconfiguration that allows attacker-supplied PR titles to execute commands with the workflow's own repository permissions. The attacker used that foothold to reach the npm publishing pipeline and pushed the eight tainted versions.
The postinstall script, telemetry.js, ran on Linux and macOS and walked the filesystem for .env files, SSH keys, cryptocurrency wallet material, and GitHub and npm credentials. The unusual element, dubbed s1ngularity by researchers, was tool abuse. The payload looked for the Claude, Gemini, and Amazon Q command-line assistants on disk and, when present, invoked them with their safety prompts disabled, passing flags such as --dangerously-skip-permissions, --yolo, and --trust-all-tools. The assistants were prompted to inventory sensitive files and write the results to /tmp/inventory.txt, which the script then double- or triple-base64 encoded and pushed into public GitHub repositories named s1ngularity-repository under the victim's own account. The script also appended sudo shutdown -h 0 to ~/.bashrc and ~/.zshrc, a noisy sabotage step that may have accelerated discovery.
GitHub disabled the harvest repositories within roughly eight hours of the first publish, but by that time researchers at Wiz had catalogued more than 1,000 valid GitHub tokens, dozens of valid cloud and npm credentials, and roughly 20,000 files in the leaked material. Wiz also tracked a second phase between August 28 and 29 in which leaked GitHub tokens were used to flip more than 5,500 private repositories to public across more than 400 users and organizations. The incident's lasting significance was the AI pivot: it was among the first publicly documented supply-chain payloads to treat the victim's own AI tooling as a reconnaissance accelerator.
Affected Artifacts
- Observed
- 2025-08-26 to 2025-08-27
- Fixed
- Not listed
- Observed
- 2025-08-26 to 2025-08-27
- Fixed
- Not listed
- Observed
- 2025-08-26 to 2025-08-27
- Compromised Versions
- Fixed
- Not listed
- Observed
- 2025-08-26 to 2025-08-27
- Compromised Versions
- Fixed
- Not listed
- Observed
- 2025-08-26 to 2025-08-27
- Fixed
- Not listed
- Observed
- 2025-08-26 to 2025-08-27
- Compromised Versions
- Fixed
- Not listed
- Observed
- 2025-08-26 to 2025-08-27
- Fixed
- Not listed
- Observed
- 2025-08-26 to 2025-08-27
- Fixed
- Not listed
- Observed
- 2025-08-26 to 2025-08-27
- Fixed
- Not listed
Nx Console
- Observed
- 2025-08-26 to 2025-08-27
- Compromised Versions
-
- 18.63.x - 18.65.x
- Fixed
- Not listed
- Affected extension versions widened exposure by running nx@latest during the malicious publish window.
Incident Context
- Motive
- Credential Theft Data Exfiltration
- Attribution
- Group
- Cause
- CI/CD Exploit
- Transitive
- No
- Actor
- Third Party
- User Impact
- 400
Indicators
- Locationdistribution: github.com/nrwl/nx/commit/3905475cfd0e0ea670e20c6a9eaeb768169dc33d
- Locationdistribution: github.com/search
- Locationdistribution: github.com/nrwl/nx/issues/32522
- Locationmirror: github.com/nrwl/nx
- filetelemetry.js
- file/tmp/inventory.txt
- file/tmp/inventory.txt.bak
- fileresults.b64
- file~/.bashrc
- file~/.zshrc
- commandsudo shutdown -h 0
- commandclaude --dangerously-skip-permissions
- commandgemini --yolo
- commandq --trust-all-tools
- domainapi.github.com
- repositorys1ngularity-repository
- repositorys1ngularity-repository-0
- repositorys1ngularity-repository-1
- repositorys1ngularity-repository-#5letters#
- Hashsha1:2379ac0e03b1a67c4ca5693136eff4945e644a91
- Hashsha1:e5d1f3c45ee7cca6ae59cf64e0573050bbe136ec
- Hashsha1:b4f20b39aa6df1002872f07973024d85aa49abaf
- Hashsha1:d2438106211ebd12c4f0a248848bc9864c97a3c0
- Commit3905475cfd0e0ea670e20c6a9eaeb768169dc33d
Notes
- Wiz observed more than 1,000 valid GitHub tokens, dozens of valid cloud credentials and npm tokens, and roughly 20,000 files leaked during the first phase.
- Wiz reported a second phase between roughly 2025-08-28 16:00 UTC and 2025-08-29 02:00 UTC that made more than 5,500 private repositories public across more than 400 users or organizations. The impact users field records that phase-two exposure count, not confirmed npm install victims.
- The Register reported malicious publishes started at 2025-08-26 22:32 UTC and continued for just over two hours; npm removed affected versions after being alerted at 2025-08-27 02:58 UTC.
External References
- Supply Chain Security Alert - Popular Nx Build System Package Compromised With Data-Stealing Malwarestepsecurity.io
- GHSA-cxm3-wv7p-598c - Malicious versions of Nx and affected pluginsgithub.com
- Nx build system s1ngularity supply-chain attackkaspersky.co.uk
- Nx NPM packages poisoned in AI-assisted supply chain attacktheregister.com
- s1ngularity: supply chain attack leaks secrets on GitHubwiz.io
Source record: oss/attacks/nx-build/meta.yaml