{
  "attack_id": "malicious-mcp-servers-npm-2026-11",
  "status": "catalog_recommendations_not_validated_coverage",
  "stages": [
    {
      "node_id": "publish",
      "profile": "package",
      "title": "Dependency / CI trust boundary",
      "hypothesis": "A package or workflow change introduces a lifecycle hook, remote dependency or new command that accesses secrets or external services.",
      "visibility": "Defender-side logs where collected",
      "telemetry": [
        "Package-manager and CI job logs",
        "Lockfile / manifest / workflow diffs",
        "Runner process trees, secret access and egress"
      ],
      "investigate": [
        "Compare package provenance, publish identity, lifecycle scripts and resolved dependency URLs with the approved version.",
        "Correlate the install or workflow to secret reads and subsequent token use; distinguish exposure from confirmed compromise."
      ],
      "limitation": "Package installation and unfamiliar names are not malicious by themselves. Dependency resolution and CI audit records are required.",
      "queries": {
        "sigma": "title: Hunt - Dependency / CI trust boundary\nid: 5fa9c45a-ac1c-4666-a598-e80626320997\nstatus: experimental\ndescription: A package or workflow change introduces a lifecycle hook, remote\n  dependency or new command that accesses secrets or external services.\nauthor: MagicSword OpenAttacks catalog\ndate: 2026-10-23\nfalsepositives:\n  - Authorized activity matching this broad hunt; baseline and investigate\n    before alerting.\nlevel: low\nlogsource:\n  category: application\n  product: openattacks_audit\n  definition: Custom normalized audit schema; map EventType, Actor, Asset, Action,\n    Target and CorrelationId from the required source logs first.\ndetection:\n  selection:\n    EventType:\n      - package.install\n      - ci.workflow.change\n      - package.lifecycle.exec\n  condition: selection\n",
        "kql": "// SCHEMA TEMPLATE: create/map this custom table before use; not a built-in Sentinel table.\n// OpenAttacksAudit_CL: TimeGenerated(datetime), EventType/Actor/Asset/Action/Target/CorrelationId(string).\n// Selects candidates only. Apply the stage hypothesis and correlation steps before alerting.\nOpenAttacksAudit_CL\n| where TimeGenerated > ago(7d)\n| where EventType in (\"package.install\", \"ci.workflow.change\", \"package.lifecycle.exec\")\n| project TimeGenerated, EventType, Actor, Asset, Action, Target, CorrelationId\n| order by TimeGenerated desc",
        "spl": "sourcetype=\"openattacks:audit\"\nEventType IN (\"package.install\", \"ci.workflow.change\", \"package.lifecycle.exec\")\n| table _time EventType Actor Asset Action Target CorrelationId\n| sort - _time"
      },
      "query_scope": "Custom-schema candidates, not out-of-box detectors. Map your application / cloud / platform logs to EventType, Actor, Asset, Action, Target and CorrelationId. KQL uses a custom OpenAttacksAudit_CL table; SPL uses openattacks:audit. EventType values are proposed normalization names, not native vendor event names. Correlation and environment-specific alert logic remain to be built.",
      "query_kind": "custom_schema",
      "origin": "catalog_authored",
      "definition_url": "https://github.com/magicsword-io/openattacks/blob/main/detections/package.yaml",
      "query_downloads": {
        "sigma": "/api/detections/package.sigma.yml",
        "kql": "/api/detections/package.kql",
        "spl": "/api/detections/package.spl"
      },
      "validation": "draft",
      "evidence": [
        "https://github.com/ossf/malicious-packages"
      ],
      "reviewed": "2026-10-23",
      "upstream_matches": []
    },
    {
      "node_id": "install",
      "profile": "package-install-execution",
      "title": "Package installation spawns a shell or downloader",
      "hypothesis": "A package-manager install or lifecycle script launches a shell, downloader, or script interpreter that retrieves or executes an unexpected second stage.",
      "visibility": "Endpoint process telemetry where collected",
      "telemetry": [
        "Process creation with ancestry and complete command lines",
        "Package-manager, CI, and installation logs",
        "Download, file creation, signature, and network telemetry"
      ],
      "investigate": [
        "Identify the package, version, publisher, lifecycle hook, resolved source, and parent process.",
        "Recover downloaded content and correlate credential access, persistence, or outbound traffic."
      ],
      "limitation": "Build and install scripts commonly invoke shells and download dependencies. Require package provenance and destination context; this hunt does not by itself prove supply-chain compromise.",
      "queries": {
        "sigma": "title: Hunt - Shell or Downloader Spawned by Package Installation\nid: c83f22aa-d07c-4f3c-a67f-6d5512818133\nstatus: experimental\ndescription: Detects package-manager processes spawning common shells, interpreters, or downloaders.\nauthor: MagicSword OpenAttacks catalog\ndate: 2026-11-06\nreferences:\n  - https://github.com/elastic/detection-rules/blob/main/rules/cross-platform/command_and_control_curl_download_from_npm_install.toml\nfalsepositives:\n  - Legitimate package build and installation scripts\nlevel: medium\nlogsource:\n  category: process_creation\ndetection:\n  selection_parent:\n    ParentCommandLine|contains:\n      - npm-cli.js\n      - npx-cli.js\n      - yarn\n      - pnpm\n      - pip install\n      - python -m pip\n      - gem install\n  selection_child:\n    Image|endswith:\n      - \\powershell.exe\n      - \\pwsh.exe\n      - /sh\n      - /bash\n      - /zsh\n      - /curl\n      - /wget\n      - /python\n      - /node\n  condition: all of selection_*\n",
        "kql": "DeviceProcessEvents\n| where Timestamp > ago(7d)\n| where InitiatingProcessCommandLine has_any (\"npm-cli.js\", \"npx-cli.js\", \"yarn\", \"pnpm\",\n    \"pip install\", \"python -m pip\", \"gem install\")\n| where FileName in~ (\"powershell.exe\", \"pwsh.exe\", \"sh\", \"bash\", \"zsh\", \"curl\", \"wget\", \"python\", \"node\")\n| project Timestamp, DeviceName, AccountName, FileName, ProcessCommandLine,\n    InitiatingProcessFileName, InitiatingProcessCommandLine, SHA1\n| order by Timestamp desc",
        "spl": "| tstats count min(_time) as firstTime max(_time) as lastTime\n  from datamodel=Endpoint.Processes\n  where Processes.parent_process IN (\"*npm-cli.js*\", \"*npx-cli.js*\", \"*yarn*\", \"*pnpm*\",\n    \"*pip install*\", \"*python -m pip*\", \"*gem install*\")\n  Processes.process_name IN (\"powershell.exe\", \"pwsh.exe\", \"sh\", \"bash\", \"zsh\", \"curl\", \"wget\", \"python\", \"node\")\n  by Processes.dest Processes.user Processes.process_name Processes.process\n     Processes.parent_process_name Processes.parent_process\n| `drop_dm_object_name(Processes)`\n| sort - lastTime"
      },
      "query_scope": "Process candidates with package-manager ancestry that launch shells or downloaders. Tune known build tooling and correlate with network/file telemetry.",
      "query_kind": "native",
      "origin": "catalog_authored",
      "definition_url": "https://github.com/magicsword-io/openattacks/blob/main/detections/package-install-execution.yaml",
      "query_downloads": {
        "sigma": "/api/detections/package-install-execution.sigma.yml",
        "kql": "/api/detections/package-install-execution.kql",
        "spl": "/api/detections/package-install-execution.spl"
      },
      "validation": "draft",
      "evidence": [
        "https://github.com/ossf/malicious-packages"
      ],
      "reviewed": "2026-11-06",
      "upstream_matches": [
        {
          "name": "Curl Download Activity from npm Package Install",
          "id": "7a3c9e21-5d84-4b16-9f02-1e8c6a4d0b73",
          "source": "Elastic detection-rules",
          "url": "https://github.com/elastic/detection-rules/blob/main/rules/cross-platform/command_and_control_curl_download_from_npm_install.toml"
        },
        {
          "name": "Suspicious PowerShell from npm Package Install",
          "id": "c4e8a1d7-2b6f-4e93-8a15-7d0c3f9b6e42",
          "source": "Elastic detection-rules",
          "url": "https://github.com/elastic/detection-rules/blob/main/rules/windows/execution_suspicious_powershell_from_npm_install.toml"
        }
      ]
    },
    {
      "node_id": "probe",
      "profile": "credentials",
      "title": "Sensitive store access → credential use",
      "hypothesis": "An unexpected process or tool accesses credential stores and is followed by token use or outbound transfer inconsistent with the owner.",
      "visibility": "Defender-side logs where collected",
      "telemetry": [
        "File-read / API access telemetry for relevant secret stores",
        "Process identity and command lines",
        "Identity, token and outbound-network audit logs"
      ],
      "investigate": [
        "Identify the actor, process and exact store touched, then pivot to token use from new devices or infrastructure.",
        "Correlate reads with egress and rotate affected credentials after confirming exposure."
      ],
      "limitation": "Defender DeviceFileEvents is not a general file-read audit trail. Collect suitable object-access, EDR or application logs; legitimate developer tools also read secrets.",
      "queries": {
        "sigma": "title: Hunt - Sensitive store access → credential use\nid: 46c46c62-2d83-4198-a8bf-d6637094527b\nstatus: experimental\ndescription: An unexpected process or tool accesses credential stores and is\n  followed by token use or outbound transfer inconsistent with the owner.\nauthor: MagicSword OpenAttacks catalog\ndate: 2026-10-23\nfalsepositives:\n  - Authorized activity matching this broad hunt; baseline and investigate\n    before alerting.\nlevel: low\nlogsource:\n  category: application\n  product: openattacks_audit\n  definition: Custom normalized audit schema; map EventType, Actor, Asset, Action,\n    Target and CorrelationId from the required source logs first.\ndetection:\n  selection:\n    EventType:\n      - secret.read\n      - credential.store.read\n  condition: selection\n",
        "kql": "// SCHEMA TEMPLATE: create/map this custom table before use; not a built-in Sentinel table.\n// OpenAttacksAudit_CL: TimeGenerated(datetime), EventType/Actor/Asset/Action/Target/CorrelationId(string).\n// Selects candidates only. Apply the stage hypothesis and correlation steps before alerting.\nOpenAttacksAudit_CL\n| where TimeGenerated > ago(7d)\n| where EventType in (\"secret.read\", \"credential.store.read\")\n| project TimeGenerated, EventType, Actor, Asset, Action, Target, CorrelationId\n| order by TimeGenerated desc",
        "spl": "sourcetype=\"openattacks:audit\"\nEventType IN (\"secret.read\", \"credential.store.read\")\n| table _time EventType Actor Asset Action Target CorrelationId\n| sort - _time"
      },
      "query_scope": "Custom-schema candidates, not out-of-box detectors. Map your application / cloud / platform logs to EventType, Actor, Asset, Action, Target and CorrelationId. KQL uses a custom OpenAttacksAudit_CL table; SPL uses openattacks:audit. EventType values are proposed normalization names, not native vendor event names. Correlation and environment-specific alert logic remain to be built.",
      "query_kind": "custom_schema",
      "origin": "catalog_authored",
      "definition_url": "https://github.com/magicsword-io/openattacks/blob/main/detections/credentials.yaml",
      "query_downloads": {
        "sigma": "/api/detections/credentials.sigma.yml",
        "kql": "/api/detections/credentials.kql",
        "spl": "/api/detections/credentials.spl"
      },
      "validation": "draft",
      "evidence": [
        "https://github.com/ossf/malicious-packages"
      ],
      "reviewed": "2026-10-23",
      "upstream_matches": []
    },
    {
      "node_id": "exfil-files",
      "profile": "exfil",
      "title": "Sensitive data → unusual destination",
      "hypothesis": "Sensitive reads are followed by outbound transfer, a public artifact, or a tool call to a destination outside the approved workflow.",
      "visibility": "Defender-side logs where collected",
      "telemetry": [
        "Sensitive resource access / DLP records",
        "Proxy, egress and cloud upload events",
        "Agent / SaaS audit with correlation IDs"
      ],
      "investigate": [
        "Join the resource read and outbound action by session, identity or process, preserving a bounded time window.",
        "Inspect destination ownership, payload classification and the user's intended action; baseline sanctioned sharing."
      ],
      "limitation": "An outbound connection or high byte count alone is not exfiltration. Encrypted traffic may hide content, and bulk legitimate exports are common.",
      "queries": {
        "sigma": "title: Hunt - Sensitive data → unusual destination\nid: 04b60968-3179-4b1f-ae13-6f57c2446077\nstatus: experimental\ndescription: Sensitive reads are followed by outbound transfer, a public\n  artifact, or a tool call to a destination outside the approved workflow.\nauthor: MagicSword OpenAttacks catalog\ndate: 2026-10-23\nfalsepositives:\n  - Authorized activity matching this broad hunt; baseline and investigate\n    before alerting.\nlevel: low\nlogsource:\n  category: application\n  product: openattacks_audit\n  definition: Custom normalized audit schema; map EventType, Actor, Asset, Action,\n    Target and CorrelationId from the required source logs first.\ndetection:\n  selection:\n    EventType:\n      - data.export\n      - agent.external.send\n  condition: selection\n",
        "kql": "// SCHEMA TEMPLATE: create/map this custom table before use; not a built-in Sentinel table.\n// OpenAttacksAudit_CL: TimeGenerated(datetime), EventType/Actor/Asset/Action/Target/CorrelationId(string).\n// Selects candidates only. Apply the stage hypothesis and correlation steps before alerting.\nOpenAttacksAudit_CL\n| where TimeGenerated > ago(7d)\n| where EventType in (\"data.export\", \"agent.external.send\")\n| project TimeGenerated, EventType, Actor, Asset, Action, Target, CorrelationId\n| order by TimeGenerated desc",
        "spl": "sourcetype=\"openattacks:audit\"\nEventType IN (\"data.export\", \"agent.external.send\")\n| table _time EventType Actor Asset Action Target CorrelationId\n| sort - _time"
      },
      "query_scope": "Custom-schema candidates, not out-of-box detectors. Map your application / cloud / platform logs to EventType, Actor, Asset, Action, Target and CorrelationId. KQL uses a custom OpenAttacksAudit_CL table; SPL uses openattacks:audit. EventType values are proposed normalization names, not native vendor event names. Correlation and environment-specific alert logic remain to be built.",
      "query_kind": "custom_schema",
      "origin": "catalog_authored",
      "definition_url": "https://github.com/magicsword-io/openattacks/blob/main/detections/exfil.yaml",
      "query_downloads": {
        "sigma": "/api/detections/exfil.sigma.yml",
        "kql": "/api/detections/exfil.kql",
        "spl": "/api/detections/exfil.spl"
      },
      "validation": "draft",
      "evidence": [
        "https://github.com/ossf/malicious-packages"
      ],
      "reviewed": "2026-10-23",
      "upstream_matches": []
    },
    {
      "node_id": "exfil-header",
      "profile": "exfil",
      "title": "Sensitive data → unusual destination",
      "hypothesis": "Sensitive reads are followed by outbound transfer, a public artifact, or a tool call to a destination outside the approved workflow.",
      "visibility": "Defender-side logs where collected",
      "telemetry": [
        "Sensitive resource access / DLP records",
        "Proxy, egress and cloud upload events",
        "Agent / SaaS audit with correlation IDs"
      ],
      "investigate": [
        "Join the resource read and outbound action by session, identity or process, preserving a bounded time window.",
        "Inspect destination ownership, payload classification and the user's intended action; baseline sanctioned sharing."
      ],
      "limitation": "An outbound connection or high byte count alone is not exfiltration. Encrypted traffic may hide content, and bulk legitimate exports are common.",
      "queries": {
        "sigma": "title: Hunt - Sensitive data → unusual destination\nid: 04b60968-3179-4b1f-ae13-6f57c2446077\nstatus: experimental\ndescription: Sensitive reads are followed by outbound transfer, a public\n  artifact, or a tool call to a destination outside the approved workflow.\nauthor: MagicSword OpenAttacks catalog\ndate: 2026-10-23\nfalsepositives:\n  - Authorized activity matching this broad hunt; baseline and investigate\n    before alerting.\nlevel: low\nlogsource:\n  category: application\n  product: openattacks_audit\n  definition: Custom normalized audit schema; map EventType, Actor, Asset, Action,\n    Target and CorrelationId from the required source logs first.\ndetection:\n  selection:\n    EventType:\n      - data.export\n      - agent.external.send\n  condition: selection\n",
        "kql": "// SCHEMA TEMPLATE: create/map this custom table before use; not a built-in Sentinel table.\n// OpenAttacksAudit_CL: TimeGenerated(datetime), EventType/Actor/Asset/Action/Target/CorrelationId(string).\n// Selects candidates only. Apply the stage hypothesis and correlation steps before alerting.\nOpenAttacksAudit_CL\n| where TimeGenerated > ago(7d)\n| where EventType in (\"data.export\", \"agent.external.send\")\n| project TimeGenerated, EventType, Actor, Asset, Action, Target, CorrelationId\n| order by TimeGenerated desc",
        "spl": "sourcetype=\"openattacks:audit\"\nEventType IN (\"data.export\", \"agent.external.send\")\n| table _time EventType Actor Asset Action Target CorrelationId\n| sort - _time"
      },
      "query_scope": "Custom-schema candidates, not out-of-box detectors. Map your application / cloud / platform logs to EventType, Actor, Asset, Action, Target and CorrelationId. KQL uses a custom OpenAttacksAudit_CL table; SPL uses openattacks:audit. EventType values are proposed normalization names, not native vendor event names. Correlation and environment-specific alert logic remain to be built.",
      "query_kind": "custom_schema",
      "origin": "catalog_authored",
      "definition_url": "https://github.com/magicsword-io/openattacks/blob/main/detections/exfil.yaml",
      "query_downloads": {
        "sigma": "/api/detections/exfil.sigma.yml",
        "kql": "/api/detections/exfil.kql",
        "spl": "/api/detections/exfil.spl"
      },
      "validation": "draft",
      "evidence": [
        "https://github.com/ossf/malicious-packages"
      ],
      "reviewed": "2026-10-23",
      "upstream_matches": []
    }
  ],
  "attack_flow": {
    "nodes": [
      {
        "id": "publish",
        "title": "Malicious MCP servers published to npm",
        "description": "Three packages published including @ifasn/md-doc-mcp, @ifasn/mmdd-doc-mcp, and gadgethumans-mcp 1.0.10-1.0.15",
        "kind": "access",
        "source_urls": [
          "https://github.com/ossf/malicious-packages"
        ]
      },
      {
        "id": "install",
        "title": "User installs malicious MCP server",
        "description": "Developer or organization adds malicious package to MCP configuration",
        "kind": "ai",
        "source_urls": [
          "https://github.com/ossf/malicious-packages"
        ]
      },
      {
        "id": "probe",
        "title": "Server probes for sensitive information",
        "description": "ifasn packages probe cloud metadata endpoints and read /etc/shadow, SSH keys, .env, k8s tokens",
        "kind": "execution",
        "source_urls": [
          "https://github.com/ossf/malicious-packages"
        ]
      },
      {
        "id": "exfil-files",
        "title": "File-based credentials exfiltrated",
        "description": "ifasn packages send stolen credentials to 121.199.24.94",
        "kind": "impact",
        "source_urls": [
          "https://github.com/ossf/malicious-packages"
        ]
      },
      {
        "id": "exfil-header",
        "title": "Wallet keys leaked in headers",
        "description": "gadgethumans-mcp sends WALLET_PRIVATE_KEY in HTTP header on every tool call",
        "kind": "impact",
        "source_urls": [
          "https://github.com/ossf/malicious-packages"
        ]
      }
    ],
    "edges": [
      {
        "source": "publish",
        "target": "install"
      },
      {
        "source": "install",
        "target": "probe"
      },
      {
        "source": "probe",
        "target": "exfil-files"
      },
      {
        "source": "probe",
        "target": "exfil-header"
      }
    ]
  }
}