Nx npm Packages Compromised in Supply-Chain Attack Stealing Credentials

A supply-chain attack compromised Nx build system packages on npm, with malicious versions 20.9–20.12 and 21.5–21.8 stealing credentials and crypto wallets via postinstall scripts, targeting Linux/macOS users and using AI for exfiltration. npm removed the packages, and experts urge enhanced dependency verification. This incident underscores the urgent need for robust open-source security measures.
Nx npm Packages Compromised in Supply-Chain Attack Stealing Credentials
Written by Maya Perez

In the fast-paced world of software development, where open-source tools underpin vast ecosystems, a recent supply-chain attack on the popular Nx build system has sent shockwaves through the industry. On August 26, 2025, malicious versions of the Nx package were uploaded to npm, the Node Package Manager, compromising systems and pilfering sensitive data from unsuspecting developers. According to a detailed alert from Semgrep, a leading application security platform, the attack involved versions 20.9 through 20.12 and 21.5 through 21.8, which executed harmful postinstall scripts designed to steal cryptocurrency wallets, API keys, and other credentials.

The breach highlights the vulnerabilities inherent in dependency management, as Nx, a widely used monorepo tool for building and scaling JavaScript applications, boasts millions of weekly downloads. Developers installing these tainted packages unwittingly triggered scripts that scoured filesystems for valuable data, including SSH keys, GitHub tokens, and environment secrets. The malware then exfiltrated this information to attacker-controlled GitHub repositories, employing sophisticated techniques like AI-assisted tools such as Claude CLI or Google’s Gemini to obfuscate and automate the theft.

The Mechanics of the Malware: A Sophisticated Exfiltration Strategy

Delving deeper, the attack’s ingenuity lies in its targeted approach, primarily affecting Linux and macOS users, as outlined in a blog post by StepSecurity. The postinstall scripts not only harvested credentials but also injected destructive commands into shell configurations, potentially leading to system shutdowns and further data leaks. This multi-stage operation evaded basic detection by mimicking legitimate build processes, a tactic that underscores the evolving threat of supply-chain compromises.

Industry observers note that this incident occurs amid a 160% surge in credential theft attacks, as reported by WebProNews. The use of AI for data exfiltration adds a layer of complexity, allowing attackers to dynamically adapt and cover their tracks. SafeDep, in its analysis on safedep.io, emphasized how the malware specifically probed for developer tools like the Claude Code CLI, exploiting them to explore and extract sensitive filesystem data.

Industry Impact and Developer Responses: A Call to Action

The fallout has been swift, with at least 1,400 developers potentially affected, based on installation metrics and social media chatter. Posts on X (formerly Twitter) from security researchers like Alex Nguyen highlight the scale, warning of compromised keys and wallets. While not conclusive, these online discussions reflect growing alarm, with users urging immediate audits of installed packages.

In response, npm administrators quickly removed the malicious versions, and Nx maintainers issued patches, advising users to downgrade or verify hashes. Semgrep’s own security alert recommends scanning dependencies with tools like their AI-assisted SAST and SCA solutions to detect similar threats. Broader lessons point to the need for enhanced verification processes, such as multi-factor authentication for package publishing and automated vulnerability scanning in CI/CD pipelines.

Broader Implications for Supply-Chain Security: Lessons from Recent Breaches

This Nx compromise echoes prior incidents, such as the XRP Ledger developer kit backdoor reported by CryptoSlate in April 2025, where malware stole wallet private keys. It also aligns with patterns seen in EncryptHub campaigns targeting Web3 developers, as detailed in The Hacker News, using fake AI platforms for credential theft.

For industry insiders, the event underscores the fragility of open-source ecosystems. As attacks grow more AI-driven, companies must invest in proactive defenses, from dependency pinning to real-time monitoring. While the immediate threat has been contained, the episode serves as a stark reminder that in the arms race of cybersecurity, vigilance is not optional—it’s imperative for safeguarding the digital foundations of modern development.

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