The Nx npm compromise malware used AI CLIs on the machine to hunt for sensitive files

ConfirmedReviewed

On 2025-08-26, malicious versions of the npm package Nx were published. StepSecurity reports that the malware called AI command-line tools on developers' machines and had them search for the location of sensitive files.

Activity
2025-08-26
Disclosed
2025-08-27
Actor type
Unknown
What the AI did
Supply chain, Reconnaissance, AI agent hijack, Malware calls an LLM at runtime
Autonomy
Semi-autonomous
Models (as named)
Claude(CLI), Gemini(CLI), q(CLI。出典の表記)

What happened

On 2025-08-26, malicious versions of the npm package Nx, a widely used build tool, and related packages were published. According to the advisory from the Nx maintainers, the code scanned the file system, collected credentials, and posted them as a repository in the victim’s GitHub account. The malicious versions were published to npm and taken down within hours. No source identifies the attacker.

The advisory attributes the root cause to a flaw in Nx’s own GitHub Actions configuration. An npm publishing token was taken from the vulnerable workflow, which led to the malicious versions being published. StepSecurity also reported a second wave using the leaked credentials on 2025-08-28.

What the AI did

StepSecurity reports that the malware looked for AI CLIs installed on the developer’s machine (Claude, Gemini, and q, the name as written in the source) and called them to find the location of sensitive files. The AI CLIs were run with dangerous options that skip user confirmation.

StepSecurity describes this as one of the first known cases of malware abusing AI CLIs. The source goes only as far as the malware handing file discovery to the AI with a fixed prompt. It does not say the AI carried out several stages of the attack on its own. Because the malware called the AI CLI on the machine at runtime without human action, this site rates AI involvement as “Semi-autonomous.” The Nx advisory doesn’t mention the abuse of AI CLIs.

Why this confidence grade

StepSecurity, the company that investigated, analyzed the malware code and reports the code that calls AI CLIs, so the case is graded Confirmed. The Nx maintainers’ advisory confirms the compromise itself but doesn’t mention the abuse of AI CLIs.

What to check

  • If you might have installed an affected version, follow the Nx advisory. Check your GitHub security log for repositories created with the matching name, and rotate the credentials that were on the machine, such as GitHub and npm tokens.
  • If you have AI CLIs installed on the machine, StepSecurity recommends checking your shell history for launches that use options that skip confirmation. It also lists the AI CLIs’ API keys as something to rotate.

Tools to check for or defend against this

Sources

  1. Nx パッケージの侵害と AI の CLI の悪用の分析(StepSecurity)StepSecurity · www.stepsecurity.io · Primary · checked 2026-11-28(opens in a new tab)
  2. Nx の悪意あるバージョンに関するセキュリティ勧告 GHSA-cxm3-wv7p-598c(Nx の保守者)Nx(GitHub Security Advisory) · github.com · Primary · checked 2026-11-28(opens in a new tab)

Field schema from hackingincidents.ai (Daniel Miessler, MIT License). Incident text and grades are written by this site after checking the sources.