SANDWORM_MODE is a self-propagating npm supply-chain worm targeting software developers, CI/CD environments, source-code repositories, cloud-linked development workflows, and AI coding assistants. It has been associated with malicious npm packages used to compromise developer systems and automated build pipelines, then harvest credentials and other secrets including npm and GitHub tokens, cloud-access material, cryptocurrency-related secrets, and API keys for multiple LLM providers. The malware has also been observed targeting AI assistant ecosystems by injecting a rogue MCP server and using prompt-injection techniques to coerce supported coding assistants into collecting sensitive local context and credentials for attacker access.
The malware operates as a multi-stage campaign. An initial stage rapidly steals accessible secrets and exfiltrates them, while a later stage activates after a delay of roughly 48 to 96 hours on developer workstations, or immediately in CI environments. This delayed execution is designed to reduce correlation between package installation and subsequent malicious behavior. SANDWORM_MODE propagates by abusing stolen npm and GitHub credentials to publish additional malicious packages and infect repositories, and it has been reported to tamper with dependencies, workflows, and repository automation to extend compromise. Persistence has been observed through git-hook mechanisms, enabling continued execution within developer workflows.
A notable characteristic of SANDWORM_MODE is its effort to blend into legitimate development activity. Its command execution, file access, configuration changes, repository interaction, and API usage can resemble normal AI-assisted coding and CI/CD operations, complicating detection. Reported exfiltration methods include multiple channels, and the malware has been described as capable of poisoning CI pipelines and establishing a durable foothold for follow-on access. Attribution remains unresolved, and available reporting has characterized it as an emerging but significant example of malware designed to exploit trusted software supply chains and AI-augmented development environments.
46 distinct techniques documented for this family, organized by ATT&CK tactic.
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.
"The campaign, tracked as SANDWORMMODE, uses typosquatted npm packages and poisoned GitHub Actions to infect both developer machines and CI pipelines."
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."
...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.
...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.
...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"
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.
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.
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.
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
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
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"
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"
"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."
by automatically destroying compromised environments if it can’t spread or accomplish its objectives
10 indicators attributed across vendor reports, sandbox runs, and researcher write-ups. Values are masked here and available in full in Mallory.
5 sources tracked across advisories, community write-ups, and news. New activity surfaces here as Mallory finds it.