- On August 26, 2025, malicious versions of Nx packages were published to npm for about four hours using a stolen token.
- The packages scanned for sensitive data and, per the maintainers, attempted to use local AI tools such as Claude and Gemini.
- The root cause was a workflow injection that exposed elevated permissions to an outside pull request.
What happened
On August 26, 2025, malicious versions of the Nx build system and several of its plugins were published to npm 12. The maintainers report that the packages were live for about four hours before removal, and that Nx has roughly six million weekly installs 2.
A postinstall script scanned each machine for sensitive files, collected credentials, and posted them, encoded, to a new public GitHub repository under the victim's own account, named with the string s1ngularity-repository 1. The maintainers' postmortem adds that the script "attempted to use local AI tools (like Claude and Gemini)" 2. The advisory publishes the instruction the malware handed those tools: a prompt telling an AI agent to search the file system and inventory configuration and environment files 1. The script also appended a shutdown command to shell startup files 1.
Why it happened
The maintainers trace it to a GitHub Actions workflow that echoed a pull request title into a shell command, combined with the pull_request_target trigger, which runs with the target repository's permissions 12. Repository workflow permissions were still set to read and write, and the publishing workflow could be triggered through the API 2. An attacker used that chain to run the publishing workflow with a modified script and take the npm token 12.
The AI angle is new. Developer machines now carry AI command line tools that can read files and run commands. Malware that can talk to them gains a capable assistant without shipping one.
What it cost or risked
Anyone who installed an affected version, directly or through a dependency, an editor extension or an agent, may have had credentials published to a public repository 1. The maintainers note that their own editor extension installed the latest package version in the background, which widened exposure until it was changed 1. Affected users were told to rotate GitHub, npm and other credentials 1.
What a verification-first team does differently
- Locks down CI before it locks down code. Read-only default tokens, no secrets reachable from outside pull requests, and approval before outside contributors run workflows.
- Publishes with short-lived identity. Nx moved to npm Trusted Publishers with OIDC and manual two-factor approval for releases 2.
- Keeps long-lived secrets off developer laptops, so a scan finds little worth taking.
- Scopes local AI tools. An assistant that cannot read the whole home directory or run unrestricted commands is a poor accomplice.
How our services map
- Governance and security. Policy for AI command line tools on developer machines and for secrets storage.
- Implementation and custom builds. Hardened CI and publishing pipelines with short-lived credentials.
- Code Verification. Review of workflows and dependencies in AI-built repositories.
Swallowtail Systems™ did not work on this incident or study. This case is our reading of the public record, and every figure belongs to the organization cited. The service mapping shows where our work applies to the same risk, not work we performed here. Read how we choose and source cases.