Nx Supply Chain Attack Exposes Thousands of Developer Credentials on Github - What you should do to keep your organization secure
In August 2025, attackers compromised popular Nx npm packages, embedding malware that stole developer credentials and published them openly on GitHub. Millions risk exposure, from API keys to cloud access tokens. Organizations must urgently rotate credentials, update dependencies, audit logs, and adopt stricter supply chain security practices.
TL;DR
| Key Point | Summary |
|---|---|
| What happened | Nx npm packages compromised August 27, 2025 via stolen publishing credentials |
| Affected packages | nx versions 20.9.0-20.12.0, 21.5.0-21.8.0; plus @nx/devkit, @nx/js, @nx/node, @nx/workspace |
| What was stolen | API keys, cloud credentials (AWS/Azure/GCP), GitHub tokens, SSH keys, database strings |
| Where data went | Published to public GitHub repos (s1ngularity-repository) |
| Impact | Millions of developers potentially exposed; cascading supply chain risk |
| Action | Timeline |
|---|---|
| Rotate ALL credentials from affected machines | Within 24 hours |
| Enable vulnerability scanning + MFA | Within 72 hours |
| Disable postinstall scripts, use secrets management | Ongoing |
If your organization used Nx packages between August 24-27, 2025, immediately rotate all credentials (API keys, cloud access, tokens) from affected developer machines. The malware exfiltrated secrets to public GitHub repos. Even if you don't use Nx, the leaked credentials from other orgs create cascading supply chain risks. Disable postinstall scripts and never store credentials in local config files.
August 2025 marked a watershed moment in supply chain security when malicious actors compromised popular Nx packages on npm, potentially affecting millions of developers worldwide. Here's what your organization needs to know and do right now.
The Attack Timeline: How It Unfolded
On August 27, 2025, the developer community discovered that several widely-used Nx packages had been compromised through a supply chain attack. The malicious code, hidden within legitimate-looking updates, executed automatically during package installation, silently harvesting sensitive data from developer machines.
The attack vector was particularly insidious: threat actors gained unauthorized access to npm publishing credentials, allowing them to push malicious versions of trusted packages, including:
- Nx build system npm package (
@nrwl/nx,nx) in the following versions:20.9.0,20.10.0,20.11.0,20.12.0,21.5.0,21.6.0,21.7.0,21.8.0 - @nx/devkit in versions:
21.5.0,20.9.0 - @nx/enterprise-cloud version
3.2.0 - @nx/eslint version
21.5.0 - @nx/js in versions:
21.5.0, 20.9.0 - @nx/key version
3.2.0 - @nx/node in versions
21.5.0,20.9.0 - @nx/workspace in versions
21.5.0,20.9.0
The Technical Breakdown: Understanding the Threat
The attack operated through a two stage mechanism:
Stage 1: Initial Compromise
Attackers compromised the Nx build system's npm publishing key, enabling them to push malicious versions of this widely-used package to the npm registry. The compromised versions contained sophisticated post-installation malware that harvested sensitive developer assets including cryptocurrency wallets, GitHub and npm tokens, and SSH keys. In a particularly innovative attack technique, the malware weaponized AI command-line tools (including Claude, Gemini, and Q) to enhance reconnaissance capabilities on infected systems.
Stage 2: Data Exfiltration
Once activated on developer's local machines or CI/CD pipelines, the malware systematically searched for and exfiltrated:
- Environment variables containing API keys and tokens
- Shell configuration files (.bashrc, .zshrc, .profile)
- Cloud provider credentials (AWS, Azure, GCP)
- Version control tokens (GitHub, GitLab, Bitbucket)
- CI/CD pipeline secrets
- Database connection strings
- OAuth tokens and refresh tokens
The stolen data was then published to public GitHub repositories named s1ngularity-repository, s1ngularity-repository-0, or s1ngularity-repository-1. This made thousands of API keys, tokens, and passwords openly available, amplifying the risk of misuse across the wider software ecosystem.
The Blast Radius: Assessing Your Exposure
This attack's impact extends far beyond individual developers. Consider this sobering reality: if even one developer in your organization installed these compromised packages, your entire infrastructure could be at risk.
Risk 1: Direct Exposure for Nx Users
Your sensitive information (API tokens, database credentials, cloud access keys) may now be publicly exposed. Attackers could already be accessing your infrastructure, exfiltrating customer data, or preparing for ransomware deployment.
Critical Remediation Steps:
- Immediately rotate ALL credentials that were present on any developer machine between August 24-27, 2025
- Audit access logs for unusual activity during this period
- Update Nx packages to verified clean versions
- Clear npm cache:
npm cache clean --force - Enable multi-factor authentication on all critical systems
Risk 2: Universal Threat Regardless of Nx Usage
The massive cache of stolen credentials creates a domino effect. Compromised keys from other organizations could grant attackers access to packages and services your company depends on. This exponentially increases the risk of cascading supply chain attacks in the coming weeks.
Advanced Protection Measures:
- Implement strict allowlisting for package postinstall scripts. If using pnpm, add this to your .npmrc (by default on pnpm >= 10):
enable-pre-post-scripts=false
Then explicitly allowlist trusted packages:
{
"pnpm": {
"allowedDeprecatedVersions": {},
"onlyBuiltDependencies": ["package-name"]
}
}
- Never store credentials in local configuration files. Instead, leverage password manager CLIs for dynamic credential injection. You can also use keychain ssh agent to store and use safety your ssh keys.
- For example, with 1Password, In your .zshrc or .bashrc
export GITHUB_TOKEN=$(op read op://personal/github-account/token)
export AWS_ACCESS_KEY=$(op read op://aws/production/access-key)
Practical Security Checklist
Within 24 Hours
- Scan for compromised Nx packages
- Rotate exposed credentials
- Review authentication logs
Within 72 Hours
- Enable package vulnerability scanning in CI/CD
- Configure automated alerts for advisories
- Verify package integrity using
npm audit signatures
Longer-term
- Adopt dependency pinning, lock file verification and ****strict allowlisting for package postinstall scripts
- Leverage secrets management (e.g., Vault, 1Password CLI) cli in your local files
- Strengthen developer environments with least privilege and monitoring
Building Resilience
This incident highlights the growing importance of supply chain security. Traditional defences are not enough when attacks target trusted tools. Strengthening development environments, enforcing dependency policies, and improving credential management will reduce future risk. Isolating development work in sandboxed environments can provide an additional layer of protection by containing potential compromises and preventing attackers from accessing production systems or sensitive credentials.
For organizations pursuing compliance certifications, supply chain security is a critical component. Both SOC 2 and ISO 27001 require organizations to implement vendor risk management and secure development practices.
Conclusion
This Nx supply chain attack serves as a stark reminder that our interconnected development ecosystem remains vulnerable to sophisticated threats. Traditional security perimeters are insufficient when attackers successfully compromise the very tools we trust most.
Moving forward, organizations must strengthen their development environments through comprehensive dependency policies, robust credential management practices, and proactive threat monitoring. Isolating development work in sandboxed environments can provide critical containment, preventing compromised packages from accessing production systems or sensitive credentials.
Given that this pattern mirrors recent incidents, including the eslint-config-prettier compromise just two months earlier, and that leaked npm credentials may enable further package compromises, organizations should prepare for this threat landscape to intensify rather than diminish.
The path to resilience requires treating supply chain security not as an afterthought, but as a foundational element of modern software development. Implementing robust incident response procedures and maintaining compliance with security frameworks helps organizations respond effectively when breaches occur.
Share this article
Related Articles
Secrets Management 101: Stop Storing Credentials in .env Files
Learn why .env files are a security risk - especially with AI coding agents - and how to implement proper secrets management with tools like Vault, AWS Secrets Manager, and Doppler.
MDM for Startups: Why We Built a Security-First Solution
We built an MDM that gives startups real device security (encryption, remote wipe, inventory) without enterprise bloat, reducing risk, simplifying compliance, and avoiding yet another vendor.
ISO 42001: Do You Need It If You Only Use AI APIs?
Do you need ISO 42001 if you only use AI APIs? Learn the key differences between AI developers and AI consumers for compliance.
Learn More About Compliance
Explore our guides for deeper insights into compliance frameworks.
Secure Configuration: Reducing Your Attack Surface
Secure configuration is about ensuring computers and network devices are set up to minimise vulnerabilities. Default settings are typically designed for ease of use during setup, not for security. Adjusting them can significantly reduce your risk.
Security Update Management: Staying Protected
Security update management (also known as patch management) is about keeping software current and protected against known vulnerabilities. When a vulnerability is discovered and publicised, attackers often develop exploits quickly. Timely patching is one of the most effective ways to protect your organisation.
Who Needs ISO 42001? AI Developers vs AI Consumers
Not every organization using AI needs ISO 42001 certification. The key distinction is whether you're an AI Developer (building, training, or fine-tuning AI systems) or an AI Consumer (using third-party AI services). This guide helps you determine where you fall and what that means for certification.
Other platforms check the box
We secure the box
Get in touch and learn why hundreds of companies trust Bastion to manage their security and fast-track their compliance.
Get Started