SANDWORM_MODE
- Type
- Worm
- Capabilities
- Credential theftExfiltrationPersistenceDefense evasionCrypto theft
- Delivery
- Cracked software
- Platforms
- CloudLinuxmacOSWindows
SANDWORM_MODE is a credential-stealing, self-propagating software supply-chain worm discovered by Socket in February 2026. Distributed through at least 19 malicious, typosquatted npm packages, it targets software developers, CI/CD environments, and AI-assisted development workflows. It harvests npm and GitHub tokens, cloud credentials, cryptocurrency keys, and API keys for LLM providers. Stolen npm and GitHub credentials enable further propagation through malicious package publication and repository infection. It resembles Shai-Hulud, but no common authorship or specific threat-actor attribution has been established.
The malware uses staged execution: an initial stage rapidly collects and exfiltrates secrets, while a broader second stage activates after 48–96 hours on developer systems or immediately in CI environments. Additional collection targets include password managers, local databases, and files. Exfiltration mechanisms include HTTP-based transfers, GitHub repositories, and DNS tunneling. It establishes persistence through Git hooks and compromises CI workflows and release automation to support continued credential theft and propagation.
A distinctive component installs rogue Model Context Protocol servers into AI tools including Claude Code, Claude Desktop, Cursor, Continue, and Windsurf. Embedded prompt injections manipulate assistants into reading sensitive local information and passing credentials through tool calls for subsequent exfiltration. Delayed activation, obfuscation, and abuse of legitimate development operations make its activity difficult to distinguish from routine automation.
Techniques & procedures
46 distinct techniques documented for this family, organized by ATT&CK tactic.
Reconnaissance
1 technique
Reconnaissance
An active Shai-Hulud-like supply chain worm campaign spreads via typosquatting and AI toolchain poisoning, across at least 19 malicious npm packages... One representative example, suport-color@1.0.1, impersonates supports-color... Other packages in the set follow the same look-alike branding strategy to increase the likelihood of accidental installation.
Resource Development
1 technique
Resource Development
"The campaign, tracked as SANDWORMMODE, uses typosquatted npm packages and poisoned GitHub Actions to infect both developer machines and CI pipelines."
Initial Access
6 techniques
Initial Access
Sandworm_Mode also compromises AI assistants such as Cursor and Claude Code via a rogue MCP server that uses prompt injection to trick them into silently reading and passing credentials to the attacker.
Through GitHub API tokens, it enumerates accessible repositories, injects a carrier dependency, commits or opens a pull request...
One early manifestation of the emerging threat is Sandworm_Mode, a self-propagating worm that spreads through malicious npm packages.
The Sandworm_Mode campaign spread through 19 malicious npm packages and exploited the normal runtime behaviors of AI coding assistants, CI automation, and LLM toolchains that organizations are increasingly deploying in their development pipelines.
"weaponized GitHub Action that harvests CI secrets"; "plants CI backdoors by injecting pull_request_target workflows that serialize secrets"; "injects workflows referencing this Action"
"...poisoned GitHub Actions to infect both developer machines and CI pipelines." / "weaponized GitHub Action called ci-quality/code-quality-check... actually steals CI secrets and continues the propagation process."
Execution
3 techniques
Execution
...persists via git hooks that survive into future repositories through a global init.templateDir setting... It hardens persistence by setting git config --global init.templateDir so new repositories inherit malicious hooks automatically.
Sandworm_Mode executed commands, accessed files, modified configurations, interacted with repositories, and called APIs in ways that closely resembled the normal behavior of AI assistants, CI/CD systems, and other development tools.
injects a pull_request_target workflow that executes in the context of the base repository, bypassing fork-based isolation.
Persistence
8 techniques
Persistence
...persists via git hooks that survive into future repositories through a global init.templateDir setting... It hardens persistence by setting git config --global init.templateDir so new repositories inherit malicious hooks automatically.
Sandworm_Mode also compromises AI assistants such as Cursor and Claude Code via a rogue MCP server that uses prompt injection to trick them into silently reading and passing credentials to the attacker.
"...self-propagates by leveraging harvested npm and GitHub tokens to publish the malicious package through victims’ npm accounts or inject itself into the victim’s GitHub repos."
Through GitHub API tokens, it enumerates accessible repositories, injects a carrier dependency, commits or opens a pull request...
The worm establishes persistence by writing malicious pre-commit and pre-push hooks to ~/.git-templates/hooks/ , then sets git config --global init.templateDir to point at this directory.
"persists via git hooks that survive into future repositories through a global init.templateDir setting"; "git config --global init.templateDir so new repositories inherit malicious hooks automatically"
"Persistence... Uses git hooks so new repos inherit infection"
It then injects configuration entries into Claude Desktop, Cursor, VSCode, and Windsurf configuration files, registering the freshly deployed rogue server as a trusted tool provider.
Privilege Escalation
6 techniques
Privilege Escalation
...persists via git hooks that survive into future repositories through a global init.templateDir setting... It hardens persistence by setting git config --global init.templateDir so new repositories inherit malicious hooks automatically.
Sandworm_Mode also compromises AI assistants such as Cursor and Claude Code via a rogue MCP server that uses prompt injection to trick them into silently reading and passing credentials to the attacker.
"...self-propagates by leveraging harvested npm and GitHub tokens to publish the malicious package through victims’ npm accounts or inject itself into the victim’s GitHub repos."
The worm establishes persistence by writing malicious pre-commit and pre-push hooks to ~/.git-templates/hooks/ , then sets git config --global init.templateDir to point at this directory.
"persists via git hooks that survive into future repositories through a global init.templateDir setting"; "git config --global init.templateDir so new repositories inherit malicious hooks automatically"
"Persistence... Uses git hooks so new repos inherit infection"
Stealth
8 techniques
Stealth
The initial payload employs multi-layer encoding via Base64 decode, zlib inflate, XOR decryption, and indirect eval() or Module._compile() calls, which are triggered on package import.
Another significant component of the malware is an "McpInject" module that specifically targets AI coding assistants by deploying a malicious model context protocol (MCP) server and injecting it into their tool configurations. The MCP server masquerades as a legitimate tool provider...
The malware covers its tracks further ... by automatically destroying compromised environments if it can’t spread or accomplish its objectives.
After the gate clears, AES-256-GCM decryption unpacks the full payload into /dev/shm, executes it via require(), then immediately unlinks the file.
Sandworm_Mode also compromises AI assistants such as Cursor and Claude Code via a rogue MCP server that uses prompt injection to trick them into silently reading and passing credentials to the attacker.
Sandworm_Mode features a 48- to 96-hour delay between when a malicious package is installed and when its full payload activates.
Other variants... write the decoded script to a random hidden temp file, require() it, then immediately unlink() it... Stage 1 writes decrypted Stage 2 to a transient .node_<hex>.js file under /dev/shm... require()s it, and deletes it.
injects a pull_request_target workflow that executes in the context of the base repository, bypassing fork-based isolation.
Defense Impairment
1 technique
Defense Impairment
It then injects configuration entries into Claude Desktop, Cursor, VSCode, and Windsurf configuration files, registering the freshly deployed rogue server as a trusted tool provider.
Credential Access
8 techniques
Credential Access
This includes AI assistants, cloud providers, API keys for nine major LLM providers, CI/CD pipelines and automated systems that build, test and publish code.
Independent of this action, the worm harvests API keys for nine LLM providers ... from environment variables and .env files.
"Scans .npmrc files, environment variables, configuration files..."
"It immediately steals sensitive data, including npm and GitHub tokens, environment variables..."
"It abuses the victim’s SSH agent to clone repositories... and push changes under the victim’s identity."
Extraction of .npmrc tokens, environment variables matching distinct patterns (KEY, SECRET, TOKEN, or PASSWORD), and cryptocurrency wallet keys... the worm targets password manager CLIs (bw, op, lpass).
It then injects configuration entries into Claude Desktop, Cursor, VSCode, and Windsurf configuration files, registering the freshly deployed rogue server as a trusted tool provider.
The MCP server masquerades as a legitimate tool provider and registers three seemingly-harmless tools, each of which embeds a prompt injection to read the contents of ~/.ssh/id_rsa, ~/.ssh/id_ed25519, ~/.aws/credentials, ~/.npmrc, and .env files.
Discovery
4 techniques
Discovery
Fingerprinting the runtime environment to determine if execution is on a developer workstation or CI runner.
Sandworm_Mode executed commands, accessed files, modified configurations, interacted with repositories, and called APIs in ways that closely resembled the normal behavior of AI assistants, CI/CD systems, and other development tools.
Sandworm_Mode features a 48- to 96-hour delay between when a malicious package is installed and when its full payload activates.
it enumerates all packages published under that account... it enumerates accessible repositories
Lateral Movement
2 techniques
Lateral Movement
Additional propagation fallback... SSH-assisted fallback when API propagation fails (SSH_AUTH_SOCK, GitHub SSH validation, clone/push)... Vector 3 → SSH agent (fallback)... ssh -T git@github.com...
the self-propagating worm can spread through code repositories with minimal detection
Collection
2 techniques
Collection
the worm targets password manager CLIs ( bw , op , lpass ) and local SQLite stores such as Apple Notes, Messages, Joplin, and clipboard history for sensitive content.
"programmatically injects dependencies and workflows into accessible repositories using GITHUB_TOKEN"; "Enumerate ... repos ... Add carrier package as dependency ... Inject CI workflow ... open PR ... auto-merge"
Command and Control
3 techniques
Command and Control
The worm is designed to steal npm, GitHub, cloud, cryptocurrency, and LLM-provider credentials, and exfiltrate them across three channels, including DNS tunneling.
with DNS tunneling using Base32 encoding and domain generation algorithm fallback as a last-resort channel if both primary paths are blocked.
"with a DGA fallback seeded by \"sw2025\" that generates domains across ten TLDs"; "The DGA uses the same sw2025 seed"
Exfiltration
6 techniques
Exfiltration
"Transfers stolen data over HTTPS, with DNS tunneling as a fallback method."
The worm is designed to steal npm, GitHub, cloud, cryptocurrency, and LLM-provider credentials, and exfiltrate them across three channels, including DNS tunneling.
"...with DNS tunneling as a fallback method."
Harvested cryptocurrency keys are immediately sent in an HTTP POST request to an attacker-controlled Cloudflare Worker endpoint... data is first POST'd over HTTPS to attacker infrastructure, then mirrored to attacker-controlled GitHub private repositories for redundancy
"adds GitHub API exfiltration with DNS fallback"; "authenticated GitHub API uploads to threat actor-created private repositories"
"...exfiltrates them via HTTP POST request to a Cloudflare Worker."
Impact
1 technique
Impact
by automatically destroying compromised environments if it can’t spread or accomplish its objectives
Observables
10 indicators attributed across vendor reports, sandbox runs, and researcher write-ups. Values are masked here and available in full in Mallory.
Recent activity
6 sources tracked across advisories, community write-ups, and news. New activity surfaces here as Mallory finds it.