Attack on NPM targets developers using Nx Build Ecosystem
By Paul McCarty
The Safety research team, empowered by the Safety malicious package detection technology, identified a threat actor publishing multiple malicious packages over the weekend. These malicious packages targeted the nx build system ecosystem.
tl;dr
In late August 2025, attackers exploited an insecure GitHub Actions workflow in the Nx build system to steal NPM tokens and publish malicious packages affecting over 15M weekly downloads. The attack occurred in two phases: first, malicious code harvested sensitive data from Mac/Linux machines and created public GitHub repos with stolen information; second, compromised GitHub tokens were used to make victims' private repos public. The incident impacted thousands of developers before containment, exposing critical open-source supply chain vulnerabilities.The background
Nx ecosystem was used to compromise developers
On August 26th, an attacker compromised eight NPM packages involving the Nx ecosystem. Nx is an AI powered build system for software engineering teams. The NPM packages involved are typically downloaded more than 15 million times a week.
You can read the officialGitHub security advisory for the incident HERE.
The attacker took advantage of a insecure GitHub Action workflow that had been published several days earlier. Security researcher Adnan Khan tweeted about the insecure PR when it was published, on August 22nd, but the development team didn’t understand the threat, so unfortunately a few days later on August 24th a malicious actor made a commit to the Nx GitHub project that allowed them to exfiltrate an NPM access token.
First Wave of the Attack
Two days later on August 26th, the threat actor started publishing malicious NPM packages using the stolen NPM token.
The following packages and versions were affected:

People take notice
The thing about attacking popular packages, is that people often notice changes in those packages as they try to use them. People started noticing pretty quickly that something was dodgy with the nx packages, and a GitHub issue was created.

The malicious versions of these packages were available on npmjs.com for about 4 hours before NPM removed them.
Nature of the Attack
The attack involved malicious code in the post-install script (telemetry.js) that executed automatically upon installation. There several interesting and unique things about this payload.
Second Wave of the Attack
On August 28, a second wave of the attack was detected. GitHub tokens leaked in the initial compromise were being used to modify repositories in the compromised users GitHub account. The threat actors made private GitHub repositories public, exposing confidential data. If you searched GitHub for “s1ngularity-repo’*” you would see thousands of affected repos. In the screenshot below you can see that there were 2800 repositories in this search:

And if you examined some of those repositories you’d find sensitive data and credentials because the authors never expected those repositories to be public.


Serious impact
Over the course of three days I saw thousands of repositories with the name “s1ngularity-repository-xxxxx”. Most of the repos belonged to individual developers, but some of them belonged to companies, and I personally saw several universities affected.

GitHub advised organizations to check for new repositories named "s1ngularity-repository-*" and initiate security incidents if found.
Here’s a timeline of important events
Initial Vulnerability (August 21-22, 2025)
If you discover that you or your organization have been compromised by the Nx supply chain attack, follow these remediation steps immediately:
Based on my research this threat campaign has several IOCs you can look for:
NPM Packages:
Existing security tools like SCA and EDR do not protect you from threats like the nx attack. Fortunately, there are ways to protect both your developers and CI/CD pipelines form attacks like this one.
The world's first AI-powered Software Supply Chain Firewall analyzes every package request in real-time, automatically blocking malicious and vulnerable dependencies before installation. Stop supply chain attacks at their source while maintaining development velocity.
Read more about our exciting Firewall product!
How can Safety help protect you from these attacks?
Traditional vulnerability scanning happens too late - after potentially malicious code is already in your system. Which means that ASPM and EDR solutions don't protect you from this type of threat.
But all is not lost, as the Safety Firewall protects develoeprs and CI pipelines proactively. Every package installation request is analyzed before reaching public repositories. Malicious, vulnerable, and policy-violating packages are automatically blocked before they can enter your systems, preventing rather than just detecting threats.Every package installation request is analyzed before reaching public repositories. Malicious, vulnerable, and policy-violating packages are automatically blocked before they can enter your systems, preventing rather than just detecting threats.Every package installation request is analyzed before reaching public repositories. Malicious, vulnerable, and policy-violating packages are automatically blocked before they can enter your systems, preventing rather than just detecting threats.
You can sign up for a free Safety account and try the Safety Firewall HERE. Feel free to reach out to me with any questions!
Let us know if this blog post helped you
I hope this blog post has helped you. Feel free to hit me up directly if you have any questions about this campaign.

Paul McCarty - Head of Research, Safety
You can find me on LinkedIn and BlueSky.