Socket Details SANDWORM_MODE npm Worm Targeting CI Secrets and AI Toolchains

Summary
Socket researchers describe SANDWORM_MODE, a Shai-Hulud-like worm found in at least 19 typosquatting npm packages and a GitHub Action. Its analyzed payload steals developer/CI secrets, propagates through repositories, and injects rogue MCP servers into AI coding tools.
Key points
- Socket attributes the campaign to at least 19 typosquatting npm packages and a public GitHub Action, associated with the publisher aliases official334 and javaorg.
- The packages run a staged JavaScript payload on import: crypto-key harvesting can occur before the main stage’s 48–96-hour delay, which the article says is bypassed in CI.
- The analyzed payload targets developer and CI credentials, wallets, password managers, local data stores, and LLM API keys; stolen npm and GitHub tokens enable package and repository propagation.
- Propagation includes dependency and workflow injection, an SSH fallback, and persistence through Git hooks configured via the global init.templateDir setting.
- The worm’s described exfiltration channels are HTTPS to a Cloudflare Worker, uploads to attacker-controlled GitHub repositories, and DNS tunneling with a DGA fallback.
- The payload injects rogue MCP servers into AI assistant configurations; their tool descriptions contain instructions to collect credentials. The destructive dead switch and polymorphic engine are reported as disabled.
- Socket says public execution of the GitHub Action outside operator testing is unconfirmed. The article gives conflicting npm package-removal updates; it reports Cloudflare workers were taken down and GitHub infrastructure removed, and advises removing affected packages, rotating credentials, and auditing workflows, hooks, and AI configurations.
Article Details
- Attack Vectors
- Typosquatting npm packages execute a staged worm when imported while retaining expected library functionality.
- Stolen npm and GitHub tokens enable attempted publication of infected packages and injection of dependencies and secret-harvesting workflows into repositories; an SSH-based fallback attempts repository changes using victim identities.
- A malicious GitHub Action harvests CI secrets and attempts to propagate through accessible repositories. Socket had not confirmed public propagation through the Action.
- A rogue MCP server injects instructions into AI coding assistants to collect credentials and pass them to the server for later exfiltration.
- Defensive Notes
- Remove identified malicious packages and node_modules, and rotate affected npm, GitHub and CI credentials.
- Review dependency manifests, lockfiles and GitHub workflows for unexpected changes; audit global git templates and hook directories.
- Inspect AI assistant configurations for unexpected mcpServers entries.
- Restrict CI access to secrets and publishing, prefer OIDC-based trusted publishing, and monitor anomalous publishing and repository changes.
- The destructive dead switch and polymorphic engine were disabled in the analyzed build.
Indicators of compromise
| Type | Indicator | Context |
|---|---|---|
| DOMAIN | fanfree[.]net | Secondary domain used for DNS-tunneled exfiltration. |
| DOMAIN | freefan[.]net | Primary domain used for DNS-tunneled exfiltration. |
javaorg@proton[.]me | Operator contact address associated with the malicious package campaign. | |
official334@proton[.]me | Operator contact address associated with the malicious package campaign. | |
| SHA256 | 5440e1a424631192dff1162eebc8af5dc2389e3d3b23bd26e9c012279ae116e4 | SHA-256 of the decrypted Stage 2 worm payload. |
| URL | hxxps[:]//pkg-metrics[.]official334[.]workers[.]dev/drain | Cloudflare Worker endpoint used to exfiltrate crypto keys before the Stage 2 delay. |
| URL | hxxps[:]//pkg-metrics[.]official334[.]workers[.]dev/exfil | Cloudflare Worker endpoint used for HTTPS exfiltration of harvested data. |
MITRE ATT&CK
T1005 · Data from Local SystemStage 2 scans local wallet files and SQLite stores, including notes and message databases, for sensitive data.T1027 · Obfuscated Files or InformationPackage loaders conceal payloads using base64, compression and XOR, including chunks disguised as configuration data.T1041 · Exfiltration Over C2 ChannelThe worm posts harvested secrets to its Cloudflare Worker exfiltration endpoints.T1048.003 · Exfiltration Over Unencrypted Non-C2 ProtocolThe worm sends encoded harvested data in DNS queries to its primary and secondary exfiltration domains.T1059.007 · JavaScriptThe npm loaders execute decoded JavaScript using indirect eval or Node's in-memory Module._compile API.T1071.001 · Web ProtocolsThe worm and malicious Action use HTTPS to send harvested secrets to exfiltration infrastructure.T1078 · Valid AccountsThe worm uses stolen npm and GitHub tokens to attempt package publication and repository modification.T1140 · Deobfuscate/Decode Files or InformationThe loader decodes and decrypts the staged payload at runtime, including AES-256-GCM decryption of Stage 2.T1195.002 · Compromise Software Supply ChainTyposquatting npm packages deliver the worm, which can also attempt to publish infected package updates using stolen tokens.T1497.003 · Time Based ChecksStage 2 is delayed by 48 to 96 hours outside CI environments, hindering short-lived sandbox analysis.T1552.001 · Credentials In FilesThe payload reads .npmrc, .env and other configuration files for tokens and cryptographic secrets.T1555 · Credentials from Password StoresStage 2 invokes Bitwarden, 1Password and LastPass CLIs to search for stored secrets.
Threat Actors
Vendors
Cloudflarenpm, GitHub, and Cloudflare removed related infrastructure, but defenders must treat the identified packages and injected workflows as active compromise risks and rotate/revoke affected tokens, audit global gitGitHubtracked as SANDWORM_MODE that spread through at least 19 typosquatting npm packages and a malicious GitHub Action, harvesting developer and CI secrets, exfiltrating via HTTPS/GitHub API/DNS, and persisting vianpmsupply chain worm campaign tracked as SANDWORM_MODE that spread through at least 19 typosquatting npm packages and a malicious GitHub Action, harvesting developer and CI secrets, exfiltrating via HTTPS/GitHub
Products
Claude Codeand, perhaps most notably, AI coding tools that are seeing rapid adoption: three packages impersonate Claude Code and one targets OpenClaw, the viral AI agent that recently passed 210k stars on GitHub.Claude Desktopserver into every AI coding assistant config it finds on disk: Claude Code (~/.claude/settings.json), Claude Desktop (Mac, Linux, and Windows paths), Cursor (~/.cursor/mcp.json), VS Code ContinueCursorand deployed rogue server path example ~/.dev-utils/server.js (MCP server entries written into Claude/Cursor/VS Code configs).VS Code ContinueClaude Desktop (Mac, Linux, and Windows paths), Cursor (~/.cursor/mcp.json), VS Code Continue (~/.continue/config.json), and Windsurf/Codeium (~/.windsurf/mcp.json).Windsurf/Codeiumand Windows paths), Cursor (~/.cursor/mcp.json), VS Code Continue (~/.continue/config.json), and Windsurf/Codeium (~/.windsurf/mcp.json).
