// ThreatDeck detection pack (yara) version 2026.11.22-674162d9 // Generated 2026-11-22. 4 queries. // Source: https://threatdeck.net/detections/ . Hunting queries are starting points: tune before alerting. Defensive use only. // ATT&CK ids are MITRE ATT&CK Enterprise v20.1. Adapted rules keep their original licence (see attribution lines). // YARA: s1ngularity (Nx) telemetry.js payload and shell-profile shutdown line // id: s1ngularity-telemetry-js-yara | maturity: alert | techniques: LLM03, AML.T0010, ASI04 // MITRE ATT&CK: T1195.002, T1552.001, T1546.004, T1529 // log source: File scan of node_modules, npm/yarn/pnpm caches and shell profile files // page: https://threatdeck.net/detections/s1ngularity-telemetry-js-yara/ // source: https://www.wiz.io/blog/s1ngularity-supply-chain-attack // source: https://www.stepsecurity.io/blog/supply-chain-security-alert-popular-nx-build-system-package-compromised-with-data-stealing-malware // source: https://github.com/nrwl/nx/security/advisories/GHSA-cxm3-wv7p-598c rule ThreatDeck_Nx_s1ngularity_telemetry_js { meta: description = "Nx s1ngularity postinstall stealer that drives AI CLIs with approval-bypass flags" reference = "https://www.wiz.io/blog/s1ngularity-supply-chain-attack" author = "ThreatDeck" date = "2026-11-09" strings: $inventory = "/tmp/inventory.txt" ascii $repo = "s1ngularity-repository" ascii $results = "results.b64" ascii $flag_claude = "--dangerously-skip-permissions" ascii $flag_gemini = "--yolo" ascii $flag_q = "--trust-all-tools" ascii condition: filesize < 2MB and $inventory and ($repo or $results) and 2 of ($flag_*) } rule ThreatDeck_Nx_s1ngularity_shell_profile_shutdown { meta: description = "Shell profile line appended by the Nx s1ngularity payload" reference = "https://www.stepsecurity.io/blog/supply-chain-security-alert-popular-nx-build-system-package-compromised-with-data-stealing-malware" author = "ThreatDeck" date = "2026-11-09" strings: $shutdown = "sudo shutdown -h 0" ascii condition: filesize < 256KB and $shutdown } // YARA: MCP or hook config that launches a script from a hidden home directory or pipes curl into a shell // id: agent-config-launches-hidden-home-script-yara | maturity: hunt | techniques: AML.T0081, AML.T0110, ASI04, AML.T0142 // MITRE ATT&CK: T1546, T1564.001 // log source: File scan of AI tool config files (~/.claude.json, ~/.claude/settings.json, ~/.cursor/mcp.json, claude_desktop_config.json, .mcp.json, ~/.gemini/settings.json) // page: https://threatdeck.net/detections/agent-config-launches-hidden-home-script-yara/ // source: https://socket.dev/blog/sandworm-mode-npm-worm-ai-toolchain-poisoning // source: https://code.claude.com/docs/en/hooks // source: https://code.claude.com/docs/en/mcp // source: https://modelcontextprotocol.io/docs/develop/connect-local-servers rule ThreatDeck_AI_Agent_Config_Runs_Hidden_Home_Script { meta: description = "MCP server or hook config launching a script from a hidden home directory, or curl/wget piped to a shell" reference = "https://socket.dev/blog/sandworm-mode-npm-worm-ai-toolchain-poisoning" author = "ThreatDeck" date = "2026-11-09" strings: $mcp = "\"mcpServers\"" ascii $hooks = "\"hooks\"" ascii $runtime = /"command"\s*:\s*"(node|bun|deno|python3?|bash|sh)"/ ascii $hidden_abs = /\/(Users|home)\/[^\/"]{1,64}\/\.[a-z0-9_-]{3,32}\/[a-z0-9_.-]{1,64}\.(js|mjs|cjs|py|sh)"/ ascii nocase $hidden_tilde = /~\/\.[a-z0-9_-]{3,32}\/[a-z0-9_.-]{1,64}\.(js|mjs|cjs|py|sh)"/ ascii nocase $pipe_shell = /(curl|wget)[^"\n]{0,300}\|\s*(sh|bash|zsh)\b/ ascii $tool_dir1 = "/.nvm/" ascii $tool_dir2 = "/.npm/_npx/" ascii $tool_dir3 = "/.local/share/" ascii condition: filesize < 2MB and ($mcp or $hooks) and (($runtime and ($hidden_abs or $hidden_tilde) and not any of ($tool_dir*)) or $pipe_shell) } // YARA: SANDWORM_MODE npm worm and its McpInject rogue MCP server // id: sandworm-mode-mcpinject-yara | maturity: alert | techniques: AML.T0110, ASI04, LLM03, AML.T0010, AML.T0098 // MITRE ATT&CK: T1195.002, T1552.001, T1552.004, T1698 // log source: File scan of node_modules, npm caches and hidden directories under the home folder // page: https://threatdeck.net/detections/sandworm-mode-mcpinject-yara/ // source: https://socket.dev/blog/sandworm-mode-npm-worm-ai-toolchain-poisoning 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))) } // YARA: invisible Unicode tag characters (U+E0000–U+E007F) in prompts, tool output or agent files // id: unicode-tag-characters-hidden-instructions-yara | maturity: alert | techniques: AML.T0068, LLM01, AML.T0051, AML.T0110 // MITRE ATT&CK: T1027.018, T1698 // log source: File scan of repositories, agent instruction files, MCP tool manifests, RAG corpora and exported LLM logs // page: https://threatdeck.net/detections/unicode-tag-characters-hidden-instructions-yara/ // source: https://aws.amazon.com/blogs/security/defending-llm-applications-against-unicode-character-smuggling/ // source: https://embracethered.com/blog/posts/2024/hiding-and-finding-text-with-unicode-tags/ rule ThreatDeck_Unicode_Tag_Characters_Hidden_Text { meta: description = "Runs of invisible Unicode tag characters (U+E0000-U+E007F) used to hide instructions from humans" reference = "https://aws.amazon.com/blogs/security/defending-llm-applications-against-unicode-character-smuggling/" author = "ThreatDeck" date = "2026-11-09" strings: $utf8_tag = { F3 A0 ( 80 | 81 ) } $utf16le_tag = { 40 DB ?? DC } $json_escaped_tag = /\\u[dD][bB]40\\u[dD][cC][0-7][0-9a-fA-F]/ condition: #utf8_tag > 10 or #utf16le_tag > 10 or #json_escaped_tag > 10 }