These write-ups are not threat intelligence and are not kept up to date as an incident develops. They are here to show how each attack worked, so you can find and fix the same techniques in your own setup. For the latest on an incident, read its sources.
Nx "s1ngularity"
August 2025 · Contained
An injectable pull_request_target workflow left on an old branch gave the attacker a write token, which ran Nx's publish job and handed over its npm token. The malicious versions used developers' own AI tools to search their machines for credentials.
- Went after
- Delete code or cover tracksSteal CI secrets and tokensPoison the build or published packageRead or expose private code
- Access held
Full summary
No zero-days were involved. A pull_request_target workflow that put pull request titles into a shell step was still on an old branch of the Nx repository, and its GITHUB_TOKEN could write because the repository kept GitHub's old read and write default. The attacker used that token to run the publish workflow on a branch of their own, took NPM_TOKEN and published malicious Nx versions. Their install script used developers' own AI command line tools to search the machine for credentials and posted what it found to new public repositories in each victim's GitHub account. The stolen GitHub tokens were then used to make thousands of private repositories public.
How it unfolded
Pick a step to zoom into it. A dashed line is a step the sources do not state. Blue dots are the checklist items that break the step.
Whole path
The whole attack, one row per step. Pick a step on the left, or click a box in its row.
A workflow that checked pull request titles ran on pull_request_target and put the title straight into a shell step. It had been removed from master but was still on an older branch. A pull request with commands in its title ran them with the workflow's GITHUB_TOKEN, which could write because the repository still had GitHub's default from before February 2023: read and write permissions.
What breaks this step
- Audit every use of pull_request_target and remove or restructure risky ones
- Set the default GITHUB_TOKEN permission to read-only at the org level
- Require approval for first-time/external contributor workflow runs on forks
- Limit who and what can trigger workflows with workflow execution protections
- Disallow self-hosted runners on public repositories
- Pass untrusted values through env variables instead of ${{ }} expressions in run steps.
- Make self-hosted runners ephemeral.
- Lint workflows with zizmor or a similar tool in CI.
With that token the attacker created a branch whose CI script was their own, then started publish.yml against that branch through the API. The workflow_dispatch trigger on publish.yml allowed it.
What breaks this step
- Rulesets applied: push restriction, tag protection, sensitive file-path protection
- Branch protection on default/release branches: required reviews of the last push + required status checks
- Set the default GITHUB_TOKEN permission to read-only at the org level
- Limit who and what can trigger workflows with workflow execution protections
- Put production secrets in environments with required reviewers
The publish job had NPM_TOKEN in scope, and the replaced script sent it out. The attacker then deleted the branch and the workflow runs.
What breaks this step
On 26 August 2025 the attacker published eight versions of nx and several @nx packages with the stolen token. They had no npm provenance, which is how Nx noticed, but provenance does not stop an install. They were live for about four hours.
What breaks this step
- Adopt artifact attestations for build provenance on published binaries/images
- Cloud credentials migrated from static keys to OIDC federation, scoped to repo + branch
- Publish packages with trusted publishing (OIDC) instead of long-lived registry tokens
- Put production secrets in environments with required reviewers
- Write and rehearse a credential-rotation runbook before you need it
On Linux and macOS a postinstall script looked for wallets, keystores, .env files, SSH keys, the npm configuration and the GitHub CLI token, and ran the Claude, Gemini and Q command line tools with their permission checks switched off to search the disk. It uploaded the results, base64 encoded, to a new s1ngularity-repository in the victim's own GitHub account, often from the Nx editor extension and sometimes from CI. Wiz counted more than 1,000 valid GitHub tokens and dozens of cloud and npm credentials before GitHub disabled the repositories on 27 August.
What breaks this step
- Set an organization-wide maximum PAT lifetime (90 days is a reasonable default)
- Disable classic PATs organization-wide, forcing migration to fine-grained PATs
- Migrate to SAML SSO / Enterprise Managed Users for centralized identity control
- Third-party Actions pinned to a full commit SHA instead of a mutable tag or branch
- Restrict which Actions can run to GitHub-verified creators or an internal allow-list
- Review new dependencies in PRs and hold new package versions for a few days before they're allowed in (a cooldown).
- Disable install scripts where you can (npm ignore-scripts).
From 28 August the attacker used stolen GitHub tokens to make victims' private repositories public and rename them s1ngularity-repository-<five letters>. By 29 August Wiz counted more than 5,500 repositories of over 400 users and organizations.
A separate threat group used the leaked credentials to reach full AWS administrator access at a victim organization in under 72 hours, chaining OIDC trust relationships with a CloudFormation IAM capability.
Frameworks
Part of
- Package worms turn each victim into the next publisher
- The developer's workstation is the way in
- AI agents hold tokens and read untrusted text
Contained. First seen August 2025. Mapping by ghtier, not yet reviewed. Threat landscape
Sources
- postmortems1ngularity: what happened, how we responded, what we learned
- researchs1ngularity: supply chain attack leaks secrets on GitHub (Wiz)
- researchLearnings from recent npm compromises
- researchOIDC trust chain abuse: cloud takeover
Reported by: Mandiant (UNC6426, downstream follow-on)