Denying the Worm: Detecting SANDWORM_MODE and AI Toolchain Supply Chain Attacks
The SANDWORM_MODE campaign is a multi-stage npm supply chain worm that targets AI-augmented development workflows by exploiting runtime behaviors of AI coding assistants and CI/CD pipelines, leading to credential theft, supply chain poisoning, and persistence through obfuscated loaders, credential harvesting, and malicious Git hooks.
What's new
- l2 poc_available Jul 21, 19:15 via crowdstrike
- l1 new IOCs Jul 21, 18:13 via crowdstrike
- l1 new vendor Jul 21, 18:08 via crowdstrike
- l1 new product Jul 21, 17:59 via crowdstrike
- l2 poc_available; OS windows Jul 21, 17:52 via crowdstrike
CrowdStrike has identified a sophisticated multi-stage npm supply chain worm, internally tracked as SANDWORM_MODE, which has affected 19 malicious packages distributed across two unique publisher aliases. This campaign, active since at least February 2026, represents a new class of attacks targeting AI-augmented development workflows. Unlike typical supply chain attacks that focus on build outputs or static backdoors, SANDWORM_MODE is designed to exploit the runtime behaviors of AI coding assistants, CI automation, and large language model (LLM) toolchains. Its primary evasion technique involves multi-layer obfuscation and delayed payload unpacking, bypassing static analysis. The worm conducts reconnaissance to steal sensitive credentials, including npm tokens, environment variables (KEY, SECRET, TOKEN, PASSWORD), and cryptocurrency wallet keys, exfiltrating them to attacker-controlled Cloudflare Workers. It achieves persistence and propagates by injecting malicious code into new npm packages, modifying GitHub repositories via API or SSH, and establishing malicious Git hooks in developer environments, posing a significant threat to software development integrity.
Attack Chain
- The initial payload is delivered via a malicious npm package and employs multi-layer obfuscation (Base64, zlib, XOR) and indirect JavaScript execution methods like
eval()orModule._compile()to unpack the payload at runtime, evading static analysis. - Upon activation, the loader fingerprints the runtime environment to determine if it's a developer workstation or a CI runner; CI environments trigger the next stage immediately, bypassing a time-delay gate.
- The worm performs initial reconnaissance, extracting sensitive credentials such as
.npmrctokens, environment variables matching patterns like KEY, SECRET, TOKEN, or PASSWORD, and cryptocurrency wallet keys. - Harvested cryptocurrency keys are immediately exfiltrated via an HTTP POST request to an attacker-controlled Cloudflare Worker endpoint.
- A time-delay gate (48-96 hours) is initiated for developer workstations before the main payload decrypts; in CI environments, decryption occurs instantly.
- The full Stage 2 payload is decrypted using AES-256-GCM, unpacked into
/dev/shm, executed viarequire(), and then immediately unlinked to remove on-disk forensic artifacts. - The worm propagates by injecting the Stage 0 loader into new npm packages published under compromised accounts, by using stolen GitHub API tokens to inject carrier dependencies and
pull_request_targetworkflows, or via SSH to clone and push code changes. - Persistence is established on developer systems by writing malicious
pre-commitandpre-pushhooks to~/.git-templates/hooks/and configuringgit config --global init.templateDirto point to this directory, ensuring new repositories inherit the hooks.
Impact
The SANDWORM_MODE campaign critically compromises AI-augmented software development lifecycles by infecting widely used package registries and source control platforms. Successful attacks lead to the theft of sensitive credentials such as npm tokens, GitHub API keys, and cryptocurrency wallets, which can be used for further supply chain attacks or financial gain. Organizations face significant risks including the distribution of poisoned software dependencies to downstream consumers, unauthorized code modifications in source repositories, and persistent compromise of developer workstations and CI/CD pipelines. The stealthy nature of the attack, particularly its evasion of static analysis and ephemeral execution, makes detection challenging and increases the potential for widespread and long-lasting damage across the software supply chain.
Recommendation
- Deploy the provided Sigma rules to your SIEM and tune for your environment to detect suspicious
gitandnpmactivities. - Monitor
process_creationlogs for suspicious modifications togit config --global init.templateDiras described inDetect Git Global Template Directory Modification for Persistence. - Enable
file_eventlogging for creation/modification events in~/.git-templates/hooks/directories to activate theDetect Suspicious Git Hook Creationrule. - Monitor
process_creationlogs fornpm publishcommands originating from unexpected users or processes, as targeted byDetect Suspicious npm Publish Activity. - Implement strong credential management and regularly rotate API tokens and
.npmrccredentials, especially in CI/CD environments. - Utilize security scanning tools capable of dynamic analysis and runtime monitoring to detect highly obfuscated and time-delayed payloads that evade static analysis.
Detection coverage 3
Detect Git Global Template Directory Modification for Persistence
highDetects SANDWORM_MODE setting git config --global init.templateDir to an arbitrary path to establish persistence by ensuring future git operations inherit malicious hooks.
Detect Suspicious Git Hook Creation in Global Template Directory
highDetects SANDWORM_MODE creating or modifying executable files in the global git templates hooks directory, indicating an attempt to establish persistence via event-triggered execution.
Detect Suspicious npm Publish Activity from Non-CI Environments
mediumDetects SANDWORM_MODE performing npm publish commands from contexts outside of typical CI/CD pipelines, indicating a potential compromise of developer workstations or supply chain attack.
Detection queries are available on the platform. Get full rules →
Indicators of compromise
1
domain
| Type | Value |
|---|---|
| domain | github.com |