{
  "attack_id": "vs-copilot-trailing-dot-rce-2026-10",
  "status": "catalog_recommendations_not_validated_coverage",
  "stages": [
    {
      "node_id": "step-1",
      "profile": "agent-input",
      "title": "Untrusted content enters an agent session",
      "hypothesis": "An agent ingests external content or an untrusted session identifier before a tool action or configuration change outside the approved task.",
      "visibility": "Application / agent audit records",
      "telemetry": [
        "Input provenance, source type and request/session identifier",
        "Captured tool responses or retrieved content where collection is approved",
        "Subsequent tool calls, configuration changes and approval decisions"
      ],
      "investigate": [
        "Join the ingested input to later actions by session or request ID; preserve the original content as evidence.",
        "Compare the resulting action with the approved task and baseline. Receiving suspicious text alone is not successful injection."
      ],
      "limitation": "Requires application instrumentation and a custom field mapping. Input exposure does not prove that the model followed instructions, executed a tool or bypassed approval. Avoid collecting sensitive prompt bodies unless authorized.",
      "note": "Record the originating file or MCP response and the consuming session, then correlate with configuration changes and execution.",
      "queries": {
        "sigma": "title: Hunt - Untrusted content enters an agent session\nid: 2d89d7ae-9d44-4dc6-a95b-f9c8de7b8352\nstatus: experimental\ndescription: An agent ingests external content or an untrusted session\n  identifier before a tool action or configuration change outside the approved\n  task.\nauthor: MagicSword OpenAttacks catalog\ndate: 2026-11-04\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      - agent.input.ingest\n      - agent.session.resume\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 (\"agent.input.ingest\", \"agent.session.resume\")\n| project TimeGenerated, EventType, Actor, Asset, Action, Target, CorrelationId\n| order by TimeGenerated desc",
        "spl": "sourcetype=\"openattacks:audit\"\nEventType IN (\"agent.input.ingest\", \"agent.session.resume\")\n| table _time EventType Actor Asset Action Target CorrelationId\n| sort - _time"
      },
      "query_scope": "Custom-schema candidate for input exposure only. Map agent.input.ingest and agent.session.resume to your application request and session logs. CorrelationId must link subsequent actions. EventType values are proposed normalization names, not native vendor events.",
      "query_kind": "custom_schema",
      "origin": "catalog_authored",
      "definition_url": "https://github.com/magicsword-io/openattacks/blob/main/detections/agent-input.yaml",
      "query_downloads": {
        "sigma": "/api/detections/agent-input.sigma.yml",
        "kql": "/api/detections/agent-input.kql",
        "spl": "/api/detections/agent-input.spl"
      },
      "validation": "draft",
      "evidence": [
        "https://embracethered.com/blog/posts/2026/visual-studio-copilot-remote-code-execution/"
      ],
      "reviewed": "2026-11-04",
      "upstream_matches": []
    },
    {
      "node_id": "step-2",
      "profile": "mcp-config",
      "title": "Agent trust / configuration changes",
      "hypothesis": "A repository, dependency or agent changes MCP commands, automatic-task settings, tool approval or model-routing configuration before new execution.",
      "visibility": "Defender-side logs where collected",
      "telemetry": [
        "File changes and before/after content for MCP / IDE configuration",
        "Repository audit / pull-request history",
        "Agent startup and tool-invocation logs"
      ],
      "investigate": [
        "Diff command, args, environment, origin, autoApprove and task settings against the previously approved version.",
        "Correlate the author and change with the next agent launch; inspect path canonicalization and trailing-dot variants where relevant."
      ],
      "limitation": "A file-write event alone cannot establish what changed. Legitimate setup also changes these files; obtain a diff and authorization context.",
      "queries": {
        "sigma": "title: Hunt - Agent trust / configuration changes\nid: 2dfc8034-d66b-42a7-a699-a76b2ef872ac\nstatus: experimental\ndescription: A repository, dependency or agent changes MCP commands,\n  automatic-task settings, tool approval or model-routing configuration before\n  new execution.\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      - agent.config.write\n      - agent.approval.change\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 (\"agent.config.write\", \"agent.approval.change\")\n| project TimeGenerated, EventType, Actor, Asset, Action, Target, CorrelationId\n| order by TimeGenerated desc",
        "spl": "sourcetype=\"openattacks:audit\"\nEventType IN (\"agent.config.write\", \"agent.approval.change\")\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/mcp-config.yaml",
      "query_downloads": {
        "sigma": "/api/detections/mcp-config.sigma.yml",
        "kql": "/api/detections/mcp-config.kql",
        "spl": "/api/detections/mcp-config.spl"
      },
      "validation": "draft",
      "evidence": [
        "https://embracethered.com/blog/posts/2026/visual-studio-copilot-remote-code-execution/"
      ],
      "reviewed": "2026-10-23",
      "upstream_matches": []
    },
    {
      "node_id": "step-3",
      "profile": "mcp-config",
      "title": "Agent trust / configuration changes",
      "hypothesis": "A repository, dependency or agent changes MCP commands, automatic-task settings, tool approval or model-routing configuration before new execution.",
      "visibility": "Defender-side logs where collected",
      "telemetry": [
        "File changes and before/after content for MCP / IDE configuration",
        "Repository audit / pull-request history",
        "Agent startup and tool-invocation logs"
      ],
      "investigate": [
        "Diff command, args, environment, origin, autoApprove and task settings against the previously approved version.",
        "Correlate the author and change with the next agent launch; inspect path canonicalization and trailing-dot variants where relevant."
      ],
      "limitation": "A file-write event alone cannot establish what changed. Legitimate setup also changes these files; obtain a diff and authorization context.",
      "queries": {
        "sigma": "title: Hunt - Agent trust / configuration changes\nid: 2dfc8034-d66b-42a7-a699-a76b2ef872ac\nstatus: experimental\ndescription: A repository, dependency or agent changes MCP commands,\n  automatic-task settings, tool approval or model-routing configuration before\n  new execution.\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      - agent.config.write\n      - agent.approval.change\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 (\"agent.config.write\", \"agent.approval.change\")\n| project TimeGenerated, EventType, Actor, Asset, Action, Target, CorrelationId\n| order by TimeGenerated desc",
        "spl": "sourcetype=\"openattacks:audit\"\nEventType IN (\"agent.config.write\", \"agent.approval.change\")\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/mcp-config.yaml",
      "query_downloads": {
        "sigma": "/api/detections/mcp-config.sigma.yml",
        "kql": "/api/detections/mcp-config.kql",
        "spl": "/api/detections/mcp-config.spl"
      },
      "validation": "draft",
      "evidence": [
        "https://embracethered.com/blog/posts/2026/visual-studio-copilot-remote-code-execution/"
      ],
      "reviewed": "2026-10-23",
      "upstream_matches": []
    },
    {
      "node_id": "step-4",
      "profile": "windows-install",
      "title": "Unapproved Windows program execution",
      "hypothesis": "A newly downloaded or staged executable runs from a user-writable location and exhibits the reported follow-on behavior.",
      "visibility": "Defender-side logs where collected",
      "telemetry": [
        "Windows process creation",
        "Download provenance and file hashes",
        "File certificate information and application-control audit / block events"
      ],
      "investigate": [
        "Verify publisher, hash, origin, prevalence and local approval rather than trusting a product name or signature.",
        "Trace child processes and related credential, network or persistence events."
      ],
      "limitation": "Many approved installers run from user-writable folders. These events are hunt candidates, not proof of malware or an enforced block.",
      "queries": {
        "sigma": "title: Hunt - Unapproved Windows program execution\nid: e217e948-e57c-48b8-a331-66006de42ae1\nstatus: experimental\ndescription: A newly downloaded or staged executable runs from a user-writable\n  location and exhibits the reported follow-on behavior.\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: process_creation\n  product: windows\ndetection:\n  selection:\n    Image|contains:\n      - \\Downloads\\\n      - \\AppData\\Local\\Temp\\\n      - \\AppData\\Roaming\\\n  condition: selection\n",
        "kql": "// Draft hunt; requires Defender for Endpoint process telemetry for this OS.\nDeviceProcessEvents\n| where Timestamp > ago(7d)\n| where FolderPath contains \"\\\\Downloads\\\\\" or FolderPath contains \"\\\\AppData\\\\Local\\\\Temp\\\\\" or FolderPath contains \"\\\\AppData\\\\Roaming\\\\\"\n| project Timestamp, DeviceName, AccountName, FileName, ProcessCommandLine, InitiatingProcessFileName, InitiatingProcessCommandLine, SHA1\n| order by Timestamp desc",
        "spl": "sourcetype=\"XmlWinEventLog:Microsoft-Windows-Sysmon/Operational\" EventCode=1\nImage IN (\"*\\\\Downloads\\\\*\", \"*\\\\AppData\\\\Local\\\\Temp\\\\*\", \"*\\\\AppData\\\\Roaming\\\\*\")\n| table _time host User Image CommandLine ParentImage ParentCommandLine\n| sort - _time"
      },
      "query_scope": "Windows process candidates. Sigma uses normalized process_creation fields; KQL requires Defender for Endpoint; SPL requires the Sysmon XML sourcetype. Tune collectors, fields and baselines before use.",
      "query_kind": "native",
      "origin": "catalog_authored",
      "definition_url": "https://github.com/magicsword-io/openattacks/blob/main/detections/windows-install.yaml",
      "query_downloads": {
        "sigma": "/api/detections/windows-install.sigma.yml",
        "kql": "/api/detections/windows-install.kql",
        "spl": "/api/detections/windows-install.spl"
      },
      "validation": "draft",
      "evidence": [
        "https://embracethered.com/blog/posts/2026/visual-studio-copilot-remote-code-execution/"
      ],
      "reviewed": "2026-10-23",
      "upstream_matches": [],
      "control": {
        "title": "Deny an unapproved executable",
        "action": "Use MagicSword to audit the actual executable's signer, publisher or hash, then enforce a policy that denies unapproved code on managed Windows hosts.",
        "scope": "The attacker-chosen Windows MCP server / ripgrepPath executable when denied by policy. This does not repair the configuration-name canonicalization bug.",
        "limitation": "Policy opportunity, not tested incident coverage. Requires enrolled Windows devices, a policy covering the actual executable, and enforcement. Audit mode records decisions without blocking; allowed tools and in-process / cloud actions can remain reachable.",
        "url": "https://www.magicsword.io/use-cases/application-control?utm_source=openattacks&utm_medium=referral&utm_content=stage-control"
      }
    }
  ],
  "attack_flow": {
    "nodes": [
      {
        "id": "step-1",
        "title": "Untrusted instructions reach Copilot",
        "description": "A file or MCP server supplies indirect instructions.",
        "kind": "access",
        "source_urls": [
          "https://embracethered.com/blog/posts/2026/visual-studio-copilot-remote-code-execution/"
        ]
      },
      {
        "id": "step-2",
        "title": "Agent edits a protected configuration name",
        "description": "Writing .mcp.json. bypasses a string-based edit check.",
        "kind": "ai",
        "source_urls": [
          "https://embracethered.com/blog/posts/2026/visual-studio-copilot-remote-code-execution/"
        ]
      },
      {
        "id": "step-3",
        "title": "Windows normalizes the trailing dot",
        "description": "The write reaches the real MCP configuration or executable-path setting.",
        "kind": "execution",
        "source_urls": [
          "https://embracethered.com/blog/posts/2026/visual-studio-copilot-remote-code-execution/"
        ]
      },
      {
        "id": "step-4",
        "title": "Attacker-chosen command runs",
        "description": "The changed MCP startup command or binary path enables code execution.",
        "kind": "impact",
        "source_urls": [
          "https://embracethered.com/blog/posts/2026/visual-studio-copilot-remote-code-execution/"
        ]
      }
    ],
    "edges": [
      {
        "source": "step-1",
        "target": "step-2"
      },
      {
        "source": "step-2",
        "target": "step-3"
      },
      {
        "source": "step-3",
        "target": "step-4"
      }
    ]
  }
}