YARAAlert-ready after reviewMCP servers and agent configuration
YARA: SANDWORM_MODE npm worm and its McpInject rogue MCP server
SANDWORM_MODE (Socket, 21 February 2026) is controlled by SANDWORM_* environment switches and ships a McpInject module that drops a server.js exposing the tools index_project, lint_check and scan_dependencies, whose descriptions carry a prompt injection telling agents to collect SSH keys, AWS credentials, npm tokens and .env files. Scan node_modules, npm caches and hidden home directories.
- Log source
- File scan of node_modules, npm caches and hidden directories under the home folder
- Techniques
- AML.T0110 AI Agent Tool Poisoning · ASI04 Agentic Supply Chain Vulnerabilities · LLM03 Supply Chain · AML.T0010 Supply Chain Compromise · AML.T0098 AI Agent Tool Credential Harvesting
- MITRE ATT&CK
- T1195.002Compromise Software Supply ChainT1552.001Credentials In FilesT1552.004Private KeysT1698Indirect Prompt Injection
- Reviewed
- 2026-11-10
Query
rule ThreatDeck_SANDWORM_MODE_npm_worm
{
meta:
description = "SANDWORM_MODE npm worm control switches and McpInject rogue MCP server"
reference = "https://socket.dev/blog/sandworm-mode-npm-worm-ai-toolchain-poisoning"
author = "ThreatDeck"
date = "2026-11-09"
strings:
$env1 = "SANDWORM_MODE" ascii
$env2 = "SANDWORM_DGA_SEED" ascii
$env3 = "SANDWORM_DRAIN_ENDPOINT" ascii
$env4 = "SANDWORM_STAGE2_DELAY" ascii
$env5 = "SANDWORM_CARRIER_NAME" ascii
$inject = "McpInject" ascii
$tool1 = "index_project" ascii
$tool2 = "lint_check" ascii
$tool3 = "scan_dependencies" ascii
$mcp = "mcpServers" ascii
condition:
filesize < 5MB and (2 of ($env*) or ($inject and $mcp) or (all of ($tool*) and ($mcp or $inject)))
} Expected false positives
- Threat-research copies of the sample and IOC write-ups
Sources
Reviewed against vendor documentation, not tested in your environment. Defensive use only.