Automated Threat Modeling

Nx npm Supply Chain Attack (CVE-2025-10894): Brief Summary and Technical Review

A brief summary and technical review of CVE-2025-10894, a critical supply chain attack that put malicious code into the Nx build system npm package and related plugins. It covers how the attack was carried out, which versions were affected, and where to read further.

CVE Analysis

9 min read

ZeroPath CVE Analysis
ZeroPath CVE Analysis

2025-09-24

Nx npm Supply Chain Attack (CVE-2025-10894): Brief Summary and Technical Review
Experimental AI-Generated Content

This CVE analysis is an experimental publication that is completely AI-generated. The content may contain errors or inaccuracies and is subject to change as more information becomes available. We are continuously refining our process.

If you have feedback, questions, or notice any errors, please reach out to us.

[email protected]

Introduction

A coordinated supply chain attack through the Nx build system stole thousands of developer credentials and compromised hundreds of npm packages. CVE-2025-10894 shows how a single workflow misconfiguration can spread into widespread compromise across the JavaScript ecosystem.

Nx, developed by Nrwl, is a widely adopted build system for JavaScript monorepos. Major enterprises and open source teams build their projects with it, it has millions of weekly downloads, and it is deeply integrated into CI/CD pipelines. A compromise of Nx therefore has far-reaching consequences for the global software supply chain.

Technical Information

The CVE-2025-10894 attack chain began when attackers exploited a GitHub Actions workflow in the Nx repository. The workflow used the pull_request_target trigger, which grants elevated permissions (including a writable GITHUB_TOKEN) to workflows running on pull requests from forks. Attackers crafted pull requests whose titles contained bash injection payloads. When the workflow ran, it processed the malicious title, and the payload executed arbitrary commands inside the CI environment.

That access let the attackers exfiltrate npm publishing tokens from the workflow environment. They used the tokens to publish malicious versions of Nx and related plugins to the npm registry. The affected packages included post-install scripts (such as telemetry.js or embedded code in bundle.js) that ran automatically on installation.

The malware payload did the following:

  • Scanned the file system for sensitive credentials, including:
    • SSH private keys
    • GitHub personal access tokens
    • npm authentication tokens
    • Cloud provider credentials (AWS, GCP, Azure)
    • Cryptocurrency wallet files (MetaMask, Electrum, Ledger, Trezor, Exodus, Phantom, Solflare)
  • Exfiltrated the collected credentials by creating new GitHub repositories under the victim's account and uploading the data as repository content
  • Checked for AI command-line tools (Claude, Gemini, Amazon Q) and, when they were present, used them for further reconnaissance
  • Skipped Windows and ran only on macOS and Linux
  • Tried to persist by injecting malicious workflow files into GitHub repositories

The campaign escalated when a self-replicating worm, Shai-Hulud, used harvested npm credentials to infect more packages. Over 500 npm projects were compromised. The worm automatically found the packages each victim could publish to, injected malicious code, and published new versions, which widened the attack's reach.

No public code snippets are available for the exact exploit payloads, but vendor advisories and security research document the attack chain well.

Affected Systems and Versions

  • Nx build system npm package: eight versions published between August 21 and August 26, 2025 (the exact version numbers are in the official advisory)
  • Related Nx plugins published in the same timeframe
  • Over 500 npm packages compromised by the Shai-Hulud worm (see StepSecurity and Wiz for lists)
  • Vulnerable configurations: any project or CI/CD pipeline that installed the affected versions during the compromise window, especially on macOS or Linux

Vendor Security History

Nrwl (Nx) has a generally strong security track record. Workflow misconfigurations have caused supply chain risk in the npm ecosystem before, and earlier incidents involved similar misuse of GitHub Actions triggers. Nrwl responded quickly by revoking tokens, adopting npm Trusted Publisher, and publishing a detailed postmortem. The npm registry has faced supply chain attacks before this one, and the risk to the ecosystem is ongoing.

References

Detect & fix
what others miss

Works with
  • GitHub
  • GitLab
  • Bitbucket
  • Azure DevOps Services
  • Gerrit
  • CVS
  • Jira
  • Linear
  • Slack
  • Security Compass
Explore integrations
Security magnifying glass visualization