Detection queries Reported campaignDeveloper workflows

s1ngularity Nx npm supply-chain attack abusing AI CLIs

Malicious Nx packages stole developer secrets, using local Claude, Gemini and Amazon Q CLIs to find files. Stolen tokens later made 5,500+ private repos public.

What happened

Attackers stole an Nx npm publish token via GitHub Actions injection and published malicious Nx packages. Postinstall harvested environment, GitHub, npm, SSH, and wallet data and invoked local Claude, Gemini, and Amazon Q CLIs with dangerous flags to inventory sensitive files, then pushed loot to public GitHub repos named s1ngularity-repository*. Phase 2 used stolen tokens to make 5,500+ private repos public. Later Mandiant reporting described a hijacked coding-assistant session spreading Shai-Hulud through malicious package recommendations.

Read the original sourceAdditional source: Wiz: s1ngularity's AftermathAdditional source: Nx: s1ngularity PostmortemAdditional source: Snyk: Weaponizing AI Coding Agents for Malware in NxAdditional source: Mandiant: Hijacked Coding-Assistant Session Spreads Shai-Hulud

How it happened

Select a stage to explore its defenses
Detect this stage
Detect this stage
Detect this stage
Detect this stage
Select a stage · Drag to explore · + / − to zoom · Dashed edges are loopsSelect a stage · Arrows show reported connectionsReported sequence
Read the flow as text & sources

A catalog reconstruction of the supplied source account. Unknown steps remain explicit; an edge describes the reported relationship between steps.

  1. 01 · Publish token is stolen

    GitHub Actions injection enables malicious Nx package releases.

    Hunt: A package or workflow change introduces a lifecycle hook, remote dependency or new command that accesses secrets or external services.

    Package installation and unfamiliar names are not malicious by themselves. Dependency resolution and CI audit records are required.

    Source for step 1
  2. 02 · Package postinstall harvests secrets

    Installation starts environment, developer-token and file collection.

    Hunt: An unexpected process or tool accesses credential stores and is followed by token use or outbound transfer inconsistent with the owner.

    Defender DeviceFileEvents is not a general file-read audit trail. Collect suitable object-access, EDR or application logs; legitimate developer tools also read secrets.

    Source for step 2
  3. 03 · Local AI CLIs inventory sensitive files

    Claude, Gemini and Amazon Q are invoked with permissive flags.

    Hunt: Untrusted content or a changed tool definition precedes a file read, command, or remote call outside the user's intended task.

    Process logs cannot recover model intent. Remote connectors and in-process interpreters may produce no local child process. Prompt content alone is not a reliable signature.

    Source for step 3
  4. 04 · Loot and private repositories become public

    Collected data is pushed to public repositories; later token abuse exposes additional private repositories.

    Hunt: A token or agent reads private material and creates a public issue, repository, commit or visibility change inconsistent with the approved task.

    Git-provider audit completeness depends on product and plan. Not every file read or issue body is present in organization audit logs.

    Source for step 4

Why it matters

Reported entry point: Malicious npm postinstall on nx/@nx packages (versions around 20.9–21.8). Reported impact: Collected data is pushed to public repositories; later token abuse exposes additional private repositories; reported targets include Nx ecosystem developers (~4M weekly downloads cited); 400+ users/orgs in phase 2.

Check these source-linked conditions against your setup.

Claude CodeGemini / Gemini CLInpm / PyPI dependencies

Compromised Nx packages invoke installed AI CLIs to search for secrets.

Conditions to check
  • Confirm installation of an affected Nx package and execution of its malicious postinstall.
  • Local Claude / Gemini / Amazon Q CLI use is a step after package compromise, not evidence of a flaw in those AI services.

Source-linked applicability guidance. Confirm current scope in the original report.

Read the original report

What you can do

Protection & prevention

Start here

Review dependency and postinstall history, audit local CLI permissions and rotate credentials exposed by affected packages.

Pin npm provenance; gate AI CLIs; app control on unexpected gh/cli from node postinstall; rotate tokens

Catalog defensive guidance based on the reported behavior. Confirm scope and current mitigations in the original source.

Review the original guidance Additional source 2 Additional source 3 Additional source 4 Additional source 5
Investigate each phase

Detection queries

Draft query starters grouped by the attack stages where they apply.

Download stage pack

Start with the logs you collect. Each hunt identifies its required visibility, field mapping and limits. Queries are catalog-authored drafts using reusable behavior profiles; test with known activity and your normal baseline before alerting.

01Publish token is stolenDependency / CI trust boundaryCustom schema · Draft

GitHub Actions injection enables malicious Nx package releases.

What to look for

A package or workflow change introduces a lifecycle hook, remote dependency or new command that accesses secrets or external services.

Visibility: Defender-side logs where collected

Required logs

  • Package-manager and CI job logs
  • Lockfile / manifest / workflow diffs
  • Runner process trees, secret access and egress

Coverage limit. Package installation and unfamiliar names are not malicious by themselves. Dependency resolution and CI audit records are required.

Custom-schema candidates, not out-of-box detectors. Map your application / cloud / platform logs to EventType, Actor, Asset, Action, Target and CorrelationId. KQL uses a custom OpenAttacksAudit_CL table; SPL uses openattacks:audit. EventType values are proposed normalization names, not native vendor event names. Correlation and environment-specific alert logic remain to be built.

Sigma
Draft SigmaDownload Sigma
title: Hunt - Dependency / CI trust boundary
id: 5fa9c45a-ac1c-4666-a598-e80626320997
status: experimental
description: A package or workflow change introduces a lifecycle hook, remote
  dependency or new command that accesses secrets or external services.
author: MagicSword OpenAttacks catalog
date: 2026-10-23
falsepositives:
  - Authorized activity matching this broad hunt; baseline and investigate
    before alerting.
level: low
logsource:
  category: application
  product: openattacks_audit
  definition: Custom normalized audit schema; map EventType, Actor, Asset, Action,
    Target and CorrelationId from the required source logs first.
detection:
  selection:
    EventType:
      - package.install
      - ci.workflow.change
      - package.lifecycle.exec
  condition: selection
KQL
Draft KQLDownload KQL
// SCHEMA TEMPLATE: create/map this custom table before use; not a built-in Sentinel table.
// OpenAttacksAudit_CL: TimeGenerated(datetime), EventType/Actor/Asset/Action/Target/CorrelationId(string).
// Selects candidates only. Apply the stage hypothesis and correlation steps before alerting.
OpenAttacksAudit_CL
| where TimeGenerated > ago(7d)
| where EventType in ("package.install", "ci.workflow.change", "package.lifecycle.exec")
| project TimeGenerated, EventType, Actor, Asset, Action, Target, CorrelationId
| order by TimeGenerated desc
SPL
Draft SPLDownload SPL
sourcetype="openattacks:audit"
EventType IN ("package.install", "ci.workflow.change", "package.lifecycle.exec")
| table _time EventType Actor Asset Action Target CorrelationId
| sort - _time
Investigation steps
  1. Compare package provenance, publish identity, lifecycle scripts and resolved dependency URLs with the approved version.
  2. Correlate the install or workflow to secret reads and subsequent token use; distinguish exposure from confirmed compromise.
02Package postinstall harvests secretsSensitive store access → credential useCustom schema · Draft

Installation starts environment, developer-token and file collection.

What to look for

An unexpected process or tool accesses credential stores and is followed by token use or outbound transfer inconsistent with the owner.

Visibility: Defender-side logs where collected

Required logs

  • File-read / API access telemetry for relevant secret stores
  • Process identity and command lines
  • Identity, token and outbound-network audit logs

Coverage limit. Defender DeviceFileEvents is not a general file-read audit trail. Collect suitable object-access, EDR or application logs; legitimate developer tools also read secrets.

Custom-schema candidates, not out-of-box detectors. Map your application / cloud / platform logs to EventType, Actor, Asset, Action, Target and CorrelationId. KQL uses a custom OpenAttacksAudit_CL table; SPL uses openattacks:audit. EventType values are proposed normalization names, not native vendor event names. Correlation and environment-specific alert logic remain to be built.

Sigma
Draft SigmaDownload Sigma
title: Hunt - Sensitive store access → credential use
id: 46c46c62-2d83-4198-a8bf-d6637094527b
status: experimental
description: An unexpected process or tool accesses credential stores and is
  followed by token use or outbound transfer inconsistent with the owner.
author: MagicSword OpenAttacks catalog
date: 2026-10-23
falsepositives:
  - Authorized activity matching this broad hunt; baseline and investigate
    before alerting.
level: low
logsource:
  category: application
  product: openattacks_audit
  definition: Custom normalized audit schema; map EventType, Actor, Asset, Action,
    Target and CorrelationId from the required source logs first.
detection:
  selection:
    EventType:
      - secret.read
      - credential.store.read
  condition: selection
KQL
Draft KQLDownload KQL
// SCHEMA TEMPLATE: create/map this custom table before use; not a built-in Sentinel table.
// OpenAttacksAudit_CL: TimeGenerated(datetime), EventType/Actor/Asset/Action/Target/CorrelationId(string).
// Selects candidates only. Apply the stage hypothesis and correlation steps before alerting.
OpenAttacksAudit_CL
| where TimeGenerated > ago(7d)
| where EventType in ("secret.read", "credential.store.read")
| project TimeGenerated, EventType, Actor, Asset, Action, Target, CorrelationId
| order by TimeGenerated desc
SPL
Draft SPLDownload SPL
sourcetype="openattacks:audit"
EventType IN ("secret.read", "credential.store.read")
| table _time EventType Actor Asset Action Target CorrelationId
| sort - _time
Investigation steps
  1. Identify the actor, process and exact store touched, then pivot to token use from new devices or infrastructure.
  2. Correlate reads with egress and rotate affected credentials after confirming exposure.
03Local AI CLIs inventory sensitive filesUnexpected agent tool useCustom schema · Draft

Claude, Gemini and Amazon Q are invoked with permissive flags.

What to look for

Untrusted content or a changed tool definition precedes a file read, command, or remote call outside the user's intended task.

Visibility: Defender-side logs where collected

Required logs

  • Agent tool-call audit records with session / tool / destination
  • Tool-definition and approval changes
  • Endpoint process, file-access and network evidence where available

Coverage limit. Process logs cannot recover model intent. Remote connectors and in-process interpreters may produce no local child process. Prompt content alone is not a reliable signature.

Custom-schema candidates, not out-of-box detectors. Map your application / cloud / platform logs to EventType, Actor, Asset, Action, Target and CorrelationId. KQL uses a custom OpenAttacksAudit_CL table; SPL uses openattacks:audit. EventType values are proposed normalization names, not native vendor event names. Correlation and environment-specific alert logic remain to be built.

Sigma
Draft SigmaDownload Sigma
title: Hunt - Unexpected agent tool use
id: c709e384-0e11-479e-ab4d-3a06e2431e4b
status: experimental
description: Untrusted content or a changed tool definition precedes a file
  read, command, or remote call outside the user's intended task.
author: MagicSword OpenAttacks catalog
date: 2026-10-23
falsepositives:
  - Authorized activity matching this broad hunt; baseline and investigate
    before alerting.
level: low
logsource:
  category: application
  product: openattacks_audit
  definition: Custom normalized audit schema; map EventType, Actor, Asset, Action,
    Target and CorrelationId from the required source logs first.
detection:
  selection:
    EventType:
      - agent.tool.call
      - agent.tool.definition.change
  condition: selection
KQL
Draft KQLDownload KQL
// SCHEMA TEMPLATE: create/map this custom table before use; not a built-in Sentinel table.
// OpenAttacksAudit_CL: TimeGenerated(datetime), EventType/Actor/Asset/Action/Target/CorrelationId(string).
// Selects candidates only. Apply the stage hypothesis and correlation steps before alerting.
OpenAttacksAudit_CL
| where TimeGenerated > ago(7d)
| where EventType in ("agent.tool.call", "agent.tool.definition.change")
| project TimeGenerated, EventType, Actor, Asset, Action, Target, CorrelationId
| order by TimeGenerated desc
SPL
Draft SPLDownload SPL
sourcetype="openattacks:audit"
EventType IN ("agent.tool.call", "agent.tool.definition.change")
| table _time EventType Actor Asset Action Target CorrelationId
| sort - _time
Investigation steps
  1. Join input provenance, tool descriptions and calls by session ID and compare the action to the approved task.
  2. Inspect child processes and destinations; record whether execution was in-process, local, or through a remote SaaS connector.
04Loot and private repositories become publicPrivate access → public repository artifactCustom schema · Draft

Collected data is pushed to public repositories; later token abuse exposes additional private repositories.

What to look for

A token or agent reads private material and creates a public issue, repository, commit or visibility change inconsistent with the approved task.

Visibility: Defender-side logs where collected

Required logs

  • Git-provider organization / enterprise audit
  • Repository and token permission inventory
  • Agent tool and secret-scanning / DLP records

Coverage limit. Git-provider audit completeness depends on product and plan. Not every file read or issue body is present in organization audit logs.

Custom-schema candidates, not out-of-box detectors. Map your application / cloud / platform logs to EventType, Actor, Asset, Action, Target and CorrelationId. KQL uses a custom OpenAttacksAudit_CL table; SPL uses openattacks:audit. EventType values are proposed normalization names, not native vendor event names. Correlation and environment-specific alert logic remain to be built.

Sigma
Draft SigmaDownload Sigma
title: Hunt - Private access → public repository artifact
id: b7b2d3f0-8170-4225-accb-c20633364ef4
status: experimental
description: A token or agent reads private material and creates a public issue,
  repository, commit or visibility change inconsistent with the approved task.
author: MagicSword OpenAttacks catalog
date: 2026-10-23
falsepositives:
  - Authorized activity matching this broad hunt; baseline and investigate
    before alerting.
level: low
logsource:
  category: application
  product: openattacks_audit
  definition: Custom normalized audit schema; map EventType, Actor, Asset, Action,
    Target and CorrelationId from the required source logs first.
detection:
  selection:
    EventType:
      - repository.public.write
      - repository.visibility.change
  condition: selection
KQL
Draft KQLDownload KQL
// SCHEMA TEMPLATE: create/map this custom table before use; not a built-in Sentinel table.
// OpenAttacksAudit_CL: TimeGenerated(datetime), EventType/Actor/Asset/Action/Target/CorrelationId(string).
// Selects candidates only. Apply the stage hypothesis and correlation steps before alerting.
OpenAttacksAudit_CL
| where TimeGenerated > ago(7d)
| where EventType in ("repository.public.write", "repository.visibility.change")
| project TimeGenerated, EventType, Actor, Asset, Action, Target, CorrelationId
| order by TimeGenerated desc
SPL
Draft SPLDownload SPL
sourcetype="openattacks:audit"
EventType IN ("repository.public.write", "repository.visibility.change")
| table _time EventType Actor Asset Action Target CorrelationId
| sort - _time
Investigation steps
  1. Join access and public-write actions by actor / token and time; inspect visibility changes and newly created repositories.
  2. Verify whether the artifact contains sensitive data using approved scanning, retaining original source qualifications.
Technical detailsTooling, impact & MITRE ATLAS

Attack context

AI's role
AI as operator
Initial access
Malicious npm postinstall on nx/@nx packages (versions around 20.9–21.8)

Tooling as reported

AI products, models and artifacts

Other tooling

Targets and reported impact

Targets / sectors
Nx ecosystem developers (~4M weekly downloads cited); 400+ users/orgs in phase 2
Reported scale / exposure
Malicious packages live ~4–5 hours; phase 2 >5500 private repos exposed; Wiz: AI path succeeded in <25% of cases; <100 unique valid secrets across 20k files

Reported attribution

s1ngularity / UNC6426 (industry)

Structured attribution

Actor
s1ngularity

Detection rules

  • Review attack-specific indicatorsGUIDANCE

    Monitor for the techniques described in s1ngularity Nx npm supply chain abusing AI CLIs. Refer to sources for specific IOCs and TTPs.

Source defensive notes

Pin npm provenance; gate AI CLIs; app control on unexpected gh/cli from node postinstall; rotate tokens

MITRE ATLAS

AI-specific catalog annotations based on the reported behavior; these are not MITRE case-study assignments.

AML.T0055Unsecured Credentials

Postinstall malware harvests tokens and uses AI CLIs to locate sensitive files. Source

Sources & research credit

5 sources

Research by Wiz; Nx; Snyk; JFrog · Wiz / Nx

  1. Wiz: s1ngularity Supply Chain Attack www.wiz.io
  2. Wiz: s1ngularity's Aftermath www.wiz.io
  3. Nx: s1ngularity Postmortem nx.dev
  4. Snyk: Weaponizing AI Coding Agents for Malware in Nx snyk.io
  5. Mandiant: Hijacked Coding-Assistant Session Spreads Shai-Hulud www.mandiant.com
Record & downloads
Source record name
s1ngularity Nx npm supply chain abusing AI CLIs
Entry ID
s1ngularity-nx-ai-cli-2025-08
Catalog review
October 20, 2026
Category
adversary-use-of-ai
AI involvement confidence
confirmed