Compromised Nx packages use installed AI CLIs to hunt secrets
Malicious Nx versions on npm ran a postinstall script that prompted developers' installed AI CLIs, with permission checks switched off, to find secrets, then published the results to public GitHub repositories.
On 26 August 2025 an attacker used a stolen npm publish token to push malicious versions of nx and several @nx packages. The postinstall script looked for Claude Code, Gemini CLI and Amazon Q CLI on the machine and prompted them, with flags such as --dangerously-skip-permissions, --yolo and --trust-all-tools, to search the file system for credential and configuration files. Results were uploaded to public repositories on the victim's own GitHub account. The versions were live for about four hours. The Hacker News reported 2,349 distinct leaked secrets. Wiz later found that about half of affected victims had an AI CLI installed, that almost a quarter of Claude interactions were refused, and that the AI step exfiltrated data successfully in under a quarter of cases. A second wave used stolen GitHub tokens to make private repositories public.
- 1 day
- 0 days
- Someone else
- The damage
What happened
Vulnerable GitHub Actions workflow added to the Nx repo
Reverted on main the next day, but an outdated branch was later used to steal the npm publish token.
First malicious Nx versions published to npm
6:32 PM EDT; further versions follow until 8:42 PM EDT.
Community GitHub issue alerts the Nx team
8:30 PM EDT.
npm removes the versions; Nx revokes publishing tokens
Removal at 10:44 PM EDT, token revocation at 11:57 PM EDT.
First incident action
First malicious versions published at 6:32 PM EDT.
The handler finds out
A GitHub issue alerting the Nx team was posted at 8:30 PM EDT.
Nx publishes security advisory GHSA-cxm3-wv7p-598c
1:53 AM EDT.
GitHub disables the attacker-created repositories
9 AM UTC, after an exposure window of about eight hours.
Second wave uses stolen GitHub tokens to make private repositories public
Wiz reports 400+ users or organisations and 5,500+ private repositories affected.
Reports differ
Wiz measures how often the AI CLI step worked
Under a quarter of cases exfiltrated data; almost a quarter of Claude interactions were refused.
Nx publishes its postmortem
Moves to Trusted Publisher with OIDC and manual two-factor approval.
Agent failures
Supply chain compromise, Hijacked by an attacker, Data exfiltration
Supply chain compromise
Hijacked by an attacker
Data exfiltration
How it was found
Found first by someone else, from the damage
- Someone else
- The damage
- 1 day
A community member opened a GitHub issue about two hours after the first malicious publish. The Nx postmortem says the packages were identifiable because they lacked npm provenance signing. On victim machines, the visible trace was new public repositories named s1ngularity-repository on their own GitHub accounts.
What is publicly known
7 of 12 fully public
| Item | Public? | Detail | Sources |
|---|---|---|---|
| Partial | The CLIs are named (Claude Code, Gemini CLI, Amazon Q CLI); the models and versions behind them on victim machines are not. | ||
| Unknown | No source mentions reasoning settings for the CLI runs. | ||
| Known | The permission-skipping flags are published; Wiz measured provider refusals at almost a quarter of Claude interactions. | ||
| Partial | The malware's role-setting prompt is published; the CLIs' own built-in system prompts are not discussed. | ||
| Known | The full prompt text is published in the advisory, and Wiz documents how it changed across versions. | ||
| Known | The three CLIs, the non-interactive invocation and the flags used are stated plainly. | ||
| Partial | Results left via public repositories on victims' own GitHub accounts; no source describes egress controls on the victim machines. | ||
| Partial | Wiz analysed outcomes from leaked repositories in aggregate; per-run CLI output or logs are not published. | ||
| Known | A community GitHub issue two hours after publish; missing provenance signing; new repositories on victim accounts. | ||
| Known | 2,349 secrets leaked; Wiz sample of 225 users; AI step exfiltrated data in under a quarter of cases. | ||
| Known | Nx names a GitHub Actions injection that leaked the publish token; the flags explain why the CLIs acted without approval. | ||
| Known | Nx moved to Trusted Publisher with manual 2FA approval and revoked tokens. No source reports changes by the AI CLI vendors. |
Controls that apply
Govern
Identify
Protect
Detect
- All controls →
Coverage and commentary
1 post on X, 2 statements, 1 article
What the parties involved said
Wiz Research
The AI step worked less often than the framing suggests: under a quarter of cases exfiltrated data, and fewer than 100 unique valid secrets came from about 20,000 exfiltrated files.
Nx
Moved publishing to npm Trusted Publisher with OIDC and required manual two-factor approval for releases.
All 5 sources
Malicious versions of Nx and some supporting plugins were published (GHSA-cxm3-wv7p-598c) ↗
S1ngularity - What Happened, How We Responded, What We Learned ↗
s1ngularity's aftermath: analysis of Nx supply chain attack ↗
s1ngularity: supply chain attack leaks secrets on GitHub: everything you need to know ↗
Malicious Nx Packages in 's1ngularity' Attack Leaked 2,349 GitHub, Cloud, and AI Credentials ↗