Truth in IT
    • Sign In
    • Register
        • Videos
        • Channels
        • Pages
        • Galleries
        • News
        • Events
        • All
Truth in IT Truth in IT
  • Data Management ▼
    • Converged Infrastructure
    • DevOps
    • Networking
    • Storage
    • Virtualization
  • Cybersecurity ▼
    • Application Security
    • Backup & Recovery
    • Data Security
    • Identity & Access Management (IAM)
    • Zero Trust
    • Compliance & GRC
    • Endpoint Security
  • Cloud ▼
    • Hybrid Cloud
    • Private Cloud
    • Public Cloud
  • Webinar Library
  • TiPs
  • DRAW

Snyk: Nx npm Malware Attack: AI Agent Hijacking Explained

Snyk
06/28/2026
0 (0%)
Share
  • Comments
  • Download
  • Transcript
Report Like Favorite
  • Share/Embed
  • Email
Link
Embed

Transcript


It weaponized local AI coding agents on developer machines to do the recon for it. Right now, you're likely thinking, oh no, am I impacted by this? And what should I do? By the end of this, you'll know what to do and have the confidence to take proper action. You'll understand what happened, how it happened, if you're impacted, and what you should do to protect yourself. And by the way, the last thing you should consider is something you might not have expected. So what happened? Between August 26th and 27th, eight malicious NX and NX Powerpack package releases were published to NPM across two version lines. They were live for roughly 5 hours and 20 minutes before being removed. Now that may not seem like a long time, so to understand the impact of all this, let's get an understanding of what NX is and what it does. NX is a popular build system and monorepo tool used widely across JavaScript and TypeScript projects with millions of weekly downloads, which means incidents like this can have a big blast radius. So this gives us an idea of what happened, but why does it stand out? Well, instead of relying solely on classic data theft, the malware's post-install payload attempted to invoke local AI coding agents, including Anthropic's Claude CLI, Google's Gemini CLI, and Amazon's QCLI. It did this using unsafe flags for those tools to bypass their guardrails. The end goal of all this was to inventory sensitive files and exfiltrate secrets off-host. As a result, the agents were prompted to recursively scan the file system and write a list of file paths to inventory.txt and a backup file. This is one of the first documented cases of malware coercing AI assistants CLIs for reconnaissance and exfiltration. So how did this payload work? Well, a script named telemetry.js ran on post-install. It set up a prompt to find high-value targets, SSH keys, .env files, wallet artifacts, tokens, and more. Then it tried multiple AI CLIs to produce the inventory file. From there, the malware attempted to harvest GitHub and NPM credentials and upload those results to a public GitHub repository named Singularity with a 1, repository, and then a number. Now you're probably wondering, well, what caused this? What made it possible to happen? It is believed that a compromised NPM token with publish rights was used to push the malicious versions out. Arguably, these versions lack provenance, highlighting the importance of adopting and forcing provenance across open-source supply chains. How it was executed was when developers ran npm install nx, the post-install script executed locally, performed the AI agent recon, and if possible, stole tokens and created a public repo under the victim's account to upload the loot. But that wasn't everything. It also had a destructive touch to it. As a disruptive side effect, the malware appended sudo shutdown-h 0 to both bash-rc and zshell configuration files, causing new shells to shut down immediately. That leads us to finding out which NX packages and versions are impacted by this. Well, NX versions that are impacted are between version 20 and 21, and affected NX plugins include examples like NXDevKit, NXJS, Workspace, Node, ESLint, and a few more. At the time of this recording, all malicious versions have been removed from the NPM registry so they can no longer be installed by users. However, you and your systems may have already installed the affected versions, so keep that in mind. Also, this is still a developing incident, so we at Snyk are tracking this incident via the following advisories that you see on screen. So be sure to make note of the ones that you are using that are impacted by this incident. I mentioned earlier there is one area you might not have considered, and that is VS Code extensions. In addition to the packages themselves from NX, the NX console VS Code extension is likely to be impacted, and users have already been reporting suspicions of compromise via this vector. So what should you do? Well, if you have reason to believe you installed or used any of these affected packages and extensions, do the following now. Check your GitHub account and organizations for repos named singularity-repository-a-number under your account. If you find one of those, act per your prod security or info security team guidance. You'll want to note the contents of the repository as an indicator of specific data that was impacted before taking further action on that repository. You want to rotate credentials that could be on the host, GitHub tokens, NPM tokens, SSH keys, and any API keys you might have in .env files. If the target repo was found in your account or org, start with the credentials you noted in the data of that repository. Next, you want to audit and clean your environment, again, following your prod security or info security team's guidelines. You'll want to identify NX usage across projects. Run npm ls nx and check package lock json files. If you find your projects affected by this, uninstall that dependency, then install nx at latest to get the unaffected version of the package. Snyk users can use Snyk open source and Snyk SBOM to locate and monitor projects org-wide. Last but not least, if AICLIs are installed on your machines, review shell history for dangerous flags like dangerously skip permissions, YOLO, or trust all tools. That'll give you an indicator of this attack being exploited on your machine. Speaking of indicators, some other indicators you can look out for on your file system is having that inventory.txt file or a .bak file. In addition to that, your shell configuration files having sudo shutdown-h0 tacked onto them. You can also look out for those new repositories being created under your accounts. And last but not least, you can check for API calls to api.github.com during npm install or GitHub auth token CLI invocations being run by that telemetry.js file. So why is this so significant? Well, this attack shows how helpful local AI agents can be for malicious actors. They're coerced into automated recon tools given the level of privilege and permissions they're granted. It's a sharp escalation in open source supply chain attacks and one of the first publicly documented instances of AI assistance CLIs being used this way. As a reminder, if you use NX, double check your versions, rotate sensitive credentials, and hunt for that singularity repository footprint right now. Full details and advisories along with updates as this incident evolves can be found in the sneak post linked below. That does it for this video. If you got value out of it, be sure to like it down below and share it with somebody who could put it to use. And if you made it this far, subscribe to the channel so you don't miss out on upcoming videos. Thanks for watching and happy, safe coding, everyone.

TL;DR

  • Malicious Nx npm packages published August 26-27, 2025 weaponized local AI coding agents (Claude, Gemini, Amazon Q) to scan developer machines for sensitive credentials and files
  • The attack used a post-install script to bypass AI agent guardrails and exfiltrate stolen data to public GitHub repositories named "s1ngularity-repository-*" under victims' accounts
  • Affected Nx versions 20-21 and multiple plugins were live for 5+ hours; the Nx Console VS Code extension was also compromised
  • Immediate response required: check for singularity repositories in your GitHub account, rotate all credentials (GitHub tokens, npm tokens, SSH keys), audit Nx usage, and hunt for indicators of compromise including inventory.txt files and modified shell configurations

The Attack Timeline and Scope

Between August 26-27, 2025, attackers published eight malicious Nx and Nx Powerpack package releases to npm across two version lines, affecting versions 20 and 21. The compromised packages remained live for approximately 5 hours and 20 minutes before removal. The attack leveraged a compromised npm token with publish rights to push malicious versions that lacked provenance verification. Affected packages included core Nx components like NxDevKit, NXJS, Workspace, Node, and ESLint plugins. The incident also impacted the Nx Console VS Code extension, with users reporting suspected compromises through this vector. Given Nx's popularity as a build system and monorepo tool with millions of weekly downloads across JavaScript and TypeScript projects, the potential blast radius was significant.

AI Agent Weaponization Technique

The malware introduced a novel attack vector by weaponizing local AI coding agents installed on developer machines. A post-install script named telemetry.js executed automatically during npm install, attempting to invoke Anthropic's Claude CLI, Google's Gemini CLI, and Amazon Q CLI using unsafe flags to bypass their built-in guardrails. The payload prompted these AI agents to recursively scan the file system for high-value targets including SSH keys, .env files, cryptocurrency wallet artifacts, and authentication tokens. The agents were instructed to write discovered file paths to inventory.txt and backup files. Successfully harvested GitHub and npm credentials were then exfiltrated to public GitHub repositories following the naming pattern "s1ngularity-repository-*" created under victims' accounts. This represents one of the first documented cases of malware coercing AI assistant CLIs for reconnaissance and data exfiltration, marking a sharp escalation in open-source supply chain attack sophistication.

Chapters

0:00 - Introduction
0:32 - What Happened
1:04 - Attack Significance
1:44 - How the Attack Worked
2:52 - Impacted Packages and Versions
3:44 - Response Actions
5:03 - Indicators of Compromise

Key Quotes

0:04 "It weaponized local AI coding agents on developer machines to do the recon for it."
1:37 "This is one of the first documented cases of malware coercing AI assistants CLIs for reconnaissance and exfiltration."
2:17 "Arguably, these versions lack provenance, highlighting the importance of adopting and forcing provenance across open-source supply chains."
5:37 "They're coerced into automated recon tools given the level of privilege and permissions they're granted."

FAQ

How can I tell if my system was compromised by the malicious Nx packages?

Check your GitHub account for repositories named 's1ngularity-repository-*', look for inventory.txt or .bak files on your file system, inspect shell configuration files (.bashrc, .zshrc) for 'sudo shutdown -h 0' entries, review shell history for dangerous AI CLI flags like '--dangerously-skip-permissions' or '--yolo', and monitor for unexpected API calls to api.github.com during npm install operations.

What immediate actions should I take if I installed affected Nx versions?

First, check for singularity repositories in your GitHub account and note their contents before deletion. Immediately rotate all credentials that could have been on the affected host including GitHub tokens, npm tokens, SSH keys, and API keys in .env files. Run 'npm ls nx' to identify affected projects, uninstall the compromised dependency, and reinstall with 'npm install nx@latest'. If you use Snyk, leverage Snyk Open Source and Snyk SBOM to locate impacted projects organization-wide.


Categories:
  • » Cybersecurity » Application Security
  • » Data Protection
Channels:
News:
Events:
Tags:
  • Application Security
  • DevSecOps
  • Threat Intelligence
  • Security Operations
  • Technical Deep Dive
  • Supply chain security
  • npm malware
  • AI agent exploitation
  • Credential theft
  • Post-install scripts
  • Package provenance
  • Incident response
  • Developer security
Show more Show less

Browse videos

  • Related
  • Featured
  • By date
  • Most viewed
  • Top rated
  •  

              Video's comments: Snyk: Nx npm Malware Attack: AI Agent Hijacking Explained

              Upcoming Webinar Calendar

              • 06/30/2026
                01:00 PM
                06/30/2026
                Master Active Directory Certificate Services and Maintain Your Edge
                https://www.truthinit.com/index.php/channel/2018/master-active-directory-certificate-services-and-maintain-your-edge/
              • 07/01/2026
                04:00 AM
                07/01/2026
                Integrating Security in AI: Automated Red Teaming Strategies for Private Models
                https://www.truthinit.com/index.php/channel/1969/integrating-security-in-ai-automated-red-teaming-strategies-for-private-models/
              • 07/01/2026
                04:00 AM
                07/01/2026
                Schutz von KI in Anwendungen, Agenten und APIs.
                https://www.truthinit.com/index.php/channel/2008/schutz-von-ki-in-anwendungen-agenten-und-apis/
              • 07/01/2026
                01:00 PM
                07/01/2026
                How to Prevent Your AI from Outsmarting You
                https://www.truthinit.com/index.php/channel/2021/how-to-prevent-your-ai-from-outsmarting-you/
              • 07/02/2026
                10:00 AM
                07/02/2026
                Resilience Insights from Hybrid Threats in a Dark Cloud Environment
                https://www.truthinit.com/index.php/channel/2011/resilience-insights-from-hybrid-threats-in-a-dark-cloud-environment/
              • 07/08/2026
                02:00 PM
                07/08/2026
                Understanding the Crucial Role of Context in AI Data
                https://www.truthinit.com/index.php/channel/2037/understanding-the-crucial-role-of-context-in-ai-data/
              • 07/09/2026
                01:00 PM
                07/09/2026
                The HUMAN Experience: Empowering Agentic Trust in Practice
                https://www.truthinit.com/index.php/channel/2026/the-human-experience-empowering-agentic-trust-in-practice/
              • 07/14/2026
                01:00 PM
                07/14/2026
                Crafting a Championship-Worthy Security Team for Maximum Defense Effectiveness
                https://www.truthinit.com/index.php/channel/2025/crafting-a-championship-worthy-security-team-for-maximum-defense-effectiveness/
              • 07/21/2026
                04:00 AM
                07/21/2026
                Strategies for Managing AI Governance and Securing App-to-LLM API Traffic
                https://www.truthinit.com/index.php/channel/1967/strategies-for-managing-ai-governance-and-securing-app-to-llm-api-traffic/
              • 07/21/2026
                01:00 PM
                07/21/2026
                HUMAN Dialogue: Insights from Attackers During the FIFA World Cup
                https://www.truthinit.com/index.php/channel/2029/human-dialogue-insights-from-attackers-during-the-fifa-world-cup/
              • 07/22/2026
                06:30 AM
                07/22/2026
                Insights and Strategies from the DPDP Webinar
                https://www.truthinit.com/index.php/channel/2000/insights-and-strategies-from-the-dpdp-webinar/
              • 07/28/2026
                01:00 PM
                07/28/2026
                Illumio + Netskope: Zero Trust in the Age of AI Autonomy
                https://www.truthinit.com/index.php/channel/2031/illumio-netskope-zero-trust-in-the-age-of-ai-autonomy/
              • 07/29/2026
                04:00 AM
                07/29/2026
                Real-Time Strategies for Safeguarding Against Prompt Injections
                https://www.truthinit.com/index.php/channel/1968/real-time-strategies-for-safeguarding-against-prompt-injections/
              • 08/19/2026
                12:00 PM
                08/19/2026
                Get Prepared to Thrive as an Agent in Just 30 Days
                https://www.truthinit.com/index.php/channel/2036/get-prepared-to-thrive-as-an-agent-in-just-30-days/
              • 09/30/2026
                04:00 AM
                09/30/2026
                AI Command Center: Optimizing Visibility and Control in Your Operations
                https://www.truthinit.com/index.php/channel/2024/ai-command-center-optimizing-visibility-and-control-in-your-operations/

              Upcoming Events

              • Jun
                30

                Master Active Directory Certificate Services and Maintain Your Edge

                06/30/202601:00 PM ET
                • Jul
                  01

                  Schutz von KI in Anwendungen, Agenten und APIs.

                  07/01/202604:00 AM ET
                  • Jul
                    01

                    Integrating Security in AI: Automated Red Teaming Strategies for Private Models

                    07/01/202604:00 AM ET
                    • Jul
                      01

                      How to Prevent Your AI from Outsmarting You

                      07/01/202601:00 PM ET
                      • Jul
                        02

                        Resilience Insights from Hybrid Threats in a Dark Cloud Environment

                        07/02/202610:00 AM ET
                        More events
                        Truth in IT
                        • Sponsor
                        • About Us
                        • Terms of Service
                        • Privacy Policy
                        • Contact Us
                        • Preference Management
                        Desktop version
                        Standard version