AI-Assisted Supply Chain Attack on Nx NPM Packages Exposes Thousands of Developer Credentials

Reviewed byNidhi Govil

4 Sources

Share

A sophisticated supply chain attack on the Nx build system has compromised NPM packages, exposing thousands of developer credentials. The attack uniquely leveraged AI tools for reconnaissance, marking a new era in cybersecurity threats.

Supply Chain Attack Targets Nx NPM Packages

On August 26, 2025, a sophisticated supply chain attack targeted the widely-used Nx build system, compromising multiple NPM packages and exposing thousands of enterprise developer credentials

1

. The attack, dubbed 's1ngularity', affected several versions of the nx package and its supporting plugins, which were published to the NPM registry with malicious code

3

.

Source: TechRadar

Source: TechRadar

Attack Methodology and Impact

The compromised packages contained post-installation scripts designed to systematically harvest sensitive developer assets. The malware targeted cryptocurrency wallets, GitHub and NPM tokens, SSH keys, and environment variables from infected enterprise systems

2

.

According to Wiz researchers, more than 1,000 valid GitHub tokens were leaked, along with around 20,000 files and dozens of valid cloud credentials and NPM tokens

1

. The attack potentially affected a significant number of developers, given that Nx claims to have 24 million NPM downloads per month and is used by more than 70% of Fortune 500 companies

4

.

Unprecedented Use of AI in the Attack

In a groundbreaking development, the attackers weaponized AI-powered CLI tools, including Claude, Google Gemini, and Amazon Q, to assist in reconnaissance and data exfiltration . This marks the first known instance where attackers have turned developer AI assistants into tools for supply chain exploitation.

"The malware leveraged installed AI CLI tools by prompting them with dangerous flags to steal filesystem contents, exploiting trusted tools for malicious reconnaissance," reported Wiz researchers

2

.

Attack Timeline and Response

The malicious packages were published to NPM at 2232 UTC on August 26, with subsequent publications continuing for over two hours. NPM was alerted at 0258 UTC and removed all affected versions within an hour

1

.

GitHub intervened by identifying and disabling repositories containing stolen secrets, which had remained freely available for download for approximately eight hours

1

.

Root Cause and Vulnerability

Source: InfoWorld

Source: InfoWorld

The root cause of the attack was traced to a vulnerable workflow in the Nx project that allowed code injection through a specially crafted pull request title. The use of the 'pull_request_target' trigger granted elevated permissions, enabling attackers to exploit the publish workflow and exfiltrate the NPM token .

Remediation and Recommendations

Nx has taken remedial actions, including rotating NPM and GitHub tokens, auditing activities for suspicious behavior, and updating publish access to require two-factor authentication .

Users who may have been affected are encouraged to:

  1. Contact Nx's support team for assistance
  2. Rotate GitHub and NPM credentials and tokens
  3. Stop using the malicious packages
  4. Check .bashrc and .zshrc files for unfamiliar instructions and remove them

Implications for Future Security

This attack highlights the evolving sophistication of supply chain attacks and the potential for AI tools to be exploited in cybersecurity breaches. As Charlie Eriksen, a malware researcher at Aikido, noted, "There's a real risk that this could just be the first wave of this attack, and there will be more to come"

1

.

TheOutpost.ai

Your Daily Dose of Curated AI News

Don’t drown in AI news. We cut through the noise - filtering, ranking and summarizing the most important AI news, breakthroughs and research daily. Spend less time searching for the latest in AI and get straight to action.

© 2025 Triveous Technologies Private Limited
Instagram logo
LinkedIn logo