NPM Package NX Hit by Supply-Chain Attack Stealing Credentials

The popular NPM package NX was compromised on August 26, 2025, with malicious versions 20.9–20.12 and 21.5–21.8 stealing credentials and crypto data via postinstall scripts, exfiltrating to GitHub using AI tools. This supply-chain attack, amid a 160% rise in credential theft, urges developers to audit dependencies and enhance security measures.
NPM Package NX Hit by Supply-Chain Attack Stealing Credentials
Written by Mike Johnson

The NX Compromise Unveiled

In a startling development that underscores the vulnerabilities in modern software supply chains, the popular NPM package NX—a tool widely used for managing monorepos and build processes—has been compromised. According to a detailed security alert published by Semgrep, malicious versions of NX were uploaded to the NPM registry on August 26, 2025, affecting versions 20.9 through 20.12 and 21.5 through 21.8. These tainted packages, which boast over 4.6 million weekly downloads, execute a postinstall script that scans users’ systems for sensitive data, including cryptocurrency wallets and credentials, before exfiltrating them to attackers’ GitHub repositories.

The breach highlights a growing trend of supply-chain attacks, where adversaries target widely adopted open-source tools to maximize impact. Semgrep’s analysis reveals that the malware not only harvests credentials but also leverages AI-powered tools like Claude Code CLI and Gemini CLI to navigate and explore compromised filesystems, adding a layer of sophistication to the theft process.

Ripples Across the Developer Community

Posts on X, formerly Twitter, erupted with warnings shortly after the compromise, with cybersecurity firm Aikido Security alerting its followers to the malicious scripts embedded in the affected NX versions. This real-time chatter on social platforms amplified the urgency, as developers scrambled to audit their dependencies and remove vulnerable installations. The incident comes amid a broader surge in credential theft, with reports indicating a 160% increase in such attacks in 2025 alone, as noted in a recent article by IT Pro.

Industry insiders point out that NX’s popularity in enterprise environments makes this breach particularly alarming. Companies relying on NX for scalable builds in Angular, React, and other frameworks now face the risk of widespread credential exposure, potentially leading to further downstream compromises like unauthorized access to cloud services or code repositories.

Mechanics of the Malware

Diving deeper, the malicious code in the compromised NX packages operates stealthily during the installation phase. It scans for environment variables, configuration files, and even browser storage that might contain API keys, passwords, or wallet seeds. Semgrep’s blog post details how the script posts stolen data to GitHub, a tactic that allows attackers to retrieve information without maintaining persistent command-and-control servers, thereby evading detection.

This method echoes patterns seen in other high-profile incidents, such as the 2022 LastPass hacks linked to over $150 million in cyberheists, as reported by Krebs on Security. In those cases, stolen master passwords enabled thieves to drain cryptocurrency wallets, a parallel that resonates here given NX’s targeting of crypto-related credentials.

Broader Implications for Supply-Chain Security

The NX incident fits into a pattern of escalating identity-based attacks, with 1.8 billion logins stolen in the first half of 2025 alone, according to Daily Security Review. Experts warn that poor patching practices and the rise of AI-driven phishing exacerbate these risks, driving one in five data breaches through credential theft.

For developers and organizations, the fallout demands immediate action: isolating affected systems, rotating credentials, and implementing stricter dependency vetting. Tools like Semgrep’s static analysis can help detect such anomalies early, but the episode serves as a stark reminder of the need for vigilant monitoring in an era where open-source ecosystems are both a boon and a battleground.

Preventive Measures and Future Outlook

In response, cybersecurity communities on X have shared mitigation strategies, emphasizing the use of non-custodial wallets and multi-factor authentication to safeguard assets. Publications like Bleeping Computer in their Red Report 2025 debunk the hype around AI threats while noting a threefold spike in credential theft, underscoring that traditional tactics like these supply-chain injections remain highly effective.

As investigations continue, with NPM likely to purge the malicious versions, the NX breach may prompt regulatory scrutiny on package registries. For industry insiders, it’s a call to bolster defenses, ensuring that the tools powering innovation don’t become vectors for exploitation. This event, while contained, signals that 2025’s wave of credential thefts is far from cresting, demanding proactive resilience from all quarters.

Subscribe for Updates

CybersecurityUpdate Newsletter

The CybersecurityUpdate Email Newsletter is your essential source for the latest in cybersecurity news, threat intelligence, and risk management strategies. Perfect for IT security professionals and business leaders focused on protecting their organizations.

By signing up for our newsletter you agree to receive content related to ientry.com / webpronews.com and our affiliate partners. For additional information refer to our terms of service.

Notice an error?

Help us improve our content by reporting any issues you find.

Get the WebProNews newsletter delivered to your inbox

Get the free daily newsletter read by decision makers

Subscribe
Advertise with Us

Ready to get started?

Get our media kit

Advertise with Us