Detection queries Vulnerability reportAgents & MCP · Windows

Visual Studio / SSMS Copilot trailing-dot RCE (CVE-2026-103572)

Writing '.mcp.json.' slipped past Copilot's edit guard, and Windows strips the trailing dot, so attackers could rewrite the MCP config for code execution. Affects VS 2022/2026 and SSMS; patched.

What happened

Copilot edit guard blocked writes to .mcp.json via string compare. Writing '.mcp.json.' bypasses check; Win32 strips trailing dot so write lands on real MCP config → RCE via MCP server command or ripgrepPath pointing at arbitrary binary. Chainable via indirect prompt injection from a file or MCP server. Shared Microsoft.VisualStudio.Copilot.Core.dll affects VS 2022/2026 and SSMS. Patched with GetFullPath.

Read the original source

How it happened

Select a stage to explore its defenses MagicSword policy opportunity
Detect this stage
Detect this stage
Detect this stage
MagicSword Detect this stage
Select a stage · Drag to explore · + / − to zoom · Dashed edges are loopsSelect a stage · Arrows show reported connectionsReported sequence
Read the flow as text & sources

A catalog reconstruction of the supplied source account. Unknown steps remain explicit; an edge describes the reported relationship between steps.

  1. 01 · Untrusted instructions reach Copilot

    A file or MCP server supplies indirect instructions.

    Hunt: An agent ingests external content or an untrusted session identifier before a tool action or configuration change outside the approved task.

    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.

    Source for step 1
  2. 02 · Agent edits a protected configuration name

    Writing .mcp.json. bypasses a string-based edit check.

    Hunt: A repository, dependency or agent changes MCP commands, automatic-task settings, tool approval or model-routing configuration before new execution.

    A file-write event alone cannot establish what changed. Legitimate setup also changes these files; obtain a diff and authorization context.

    Source for step 2
  3. 03 · Windows normalizes the trailing dot

    The write reaches the real MCP configuration or executable-path setting.

    Hunt: A repository, dependency or agent changes MCP commands, automatic-task settings, tool approval or model-routing configuration before new execution.

    A file-write event alone cannot establish what changed. Legitimate setup also changes these files; obtain a diff and authorization context.

    Source for step 3
  4. 04 · Attacker-chosen command runs

    The changed MCP startup command or binary path enables code execution.

    Hunt: A newly downloaded or staged executable runs from a user-writable location and exhibits the reported follow-on behavior.

    Many approved installers run from user-writable folders. These events are hunt candidates, not proof of malware or an enforced block.

    MagicSword policy opportunity · The attacker-chosen Windows MCP server / ripgrepPath executable when denied by policy. This does not repair the configuration-name canonicalization bug.

    Source for step 4

Why it matters

Reported entry point: Indirect prompt injection (file content / MCP) into Copilot chat, or misaligned agent. Reported impact: The changed MCP startup command or binary path enables code execution; reported targets include Visual Studio and SSMS users.

Check these source-linked conditions against your setup.

GitHub CopilotWindows

This report concerns Copilot in Visual Studio / SSMS on Windows, rather than every Copilot integration.

Conditions to check
  • Confirm that the installed version is affected by the historical report; selecting a product does not establish its version or patch status.
  • Confirm use of the affected Visual Studio / SSMS integration; the trailing-dot path depends on Windows filename normalization.

Source-linked applicability guidance. Confirm current scope in the original report.

Read the original report

What you can do

Protection & prevention

Start here

Check the Visual Studio / SSMS advisory and review agent edits to MCP and executable-path settings.

Patch VS/SSMS; alert on Copilot writes to .mcp.json / settings.VisualStudio.json; watch devenv/Ssms spawning unexpected binaries

Catalog defensive guidance based on the reported behavior. Confirm scope and current mitigations in the original source.

Review the original guidance
Explore scoped MagicSword policy options

Requires an enforced Windows policy covering the actual executable. Audit mode records events without blocking.

Deny an unapproved executable

Use MagicSword to audit the actual executable's signer, publisher or hash, then enforce a policy that denies unapproved code on managed Windows hosts.

Applies to: The attacker-chosen Windows MCP server / ripgrepPath executable when denied by policy. This does not repair the configuration-name canonicalization bug.

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.

Explore the policy control View mapped attack stage
Investigate each phase

Detection queries

Draft query starters grouped by the attack stages where they apply.

Download stage pack

Start with the logs you collect. Each hunt identifies its required visibility, field mapping and limits. Queries are catalog-authored drafts using reusable behavior profiles; test with known activity and your normal baseline before alerting.

01Untrusted instructions reach CopilotUntrusted content enters an agent sessionCustom schema · Draft

A file or MCP server supplies indirect instructions.

What to look for

An agent ingests external content or an untrusted session identifier before a tool action or configuration change outside the approved task.

Record the originating file or MCP response and the consuming session, then correlate with configuration changes and execution.

Visibility: Application / agent audit records

Required logs

  • 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

Coverage limit. 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.

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.

Sigma
Draft SigmaDownload Sigma
title: Hunt - Untrusted content enters an agent session
id: 2d89d7ae-9d44-4dc6-a95b-f9c8de7b8352
status: experimental
description: An agent ingests external content or an untrusted session
  identifier before a tool action or configuration change outside the approved
  task.
author: MagicSword OpenAttacks catalog
date: 2026-11-04
falsepositives:
  - Authorized activity matching this broad hunt; baseline and investigate
    before alerting.
level: low
logsource:
  category: application
  product: openattacks_audit
  definition: Custom normalized audit schema; map EventType, Actor, Asset, Action,
    Target and CorrelationId from the required source logs first.
detection:
  selection:
    EventType:
      - agent.input.ingest
      - agent.session.resume
  condition: selection
KQL
Draft KQLDownload KQL
// SCHEMA TEMPLATE: create/map this custom table before use; not a built-in Sentinel table.
// OpenAttacksAudit_CL: TimeGenerated(datetime), EventType/Actor/Asset/Action/Target/CorrelationId(string).
// Selects candidates only. Apply the stage hypothesis and correlation steps before alerting.
OpenAttacksAudit_CL
| where TimeGenerated > ago(7d)
| where EventType in ("agent.input.ingest", "agent.session.resume")
| project TimeGenerated, EventType, Actor, Asset, Action, Target, CorrelationId
| order by TimeGenerated desc
SPL
Draft SPLDownload SPL
sourcetype="openattacks:audit"
EventType IN ("agent.input.ingest", "agent.session.resume")
| table _time EventType Actor Asset Action Target CorrelationId
| sort - _time
Investigation steps
  1. Join the ingested input to later actions by session or request ID; preserve the original content as evidence.
  2. Compare the resulting action with the approved task and baseline. Receiving suspicious text alone is not successful injection.
02Agent edits a protected configuration nameAgent trust / configuration changesCustom schema · Draft

Writing .mcp.json. bypasses a string-based edit check.

What to look for

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

Required logs

  • File changes and before/after content for MCP / IDE configuration
  • Repository audit / pull-request history
  • Agent startup and tool-invocation logs

Coverage limit. A file-write event alone cannot establish what changed. Legitimate setup also changes these files; obtain a diff and authorization context.

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.

Sigma
Draft SigmaDownload Sigma
title: Hunt - Agent trust / configuration changes
id: 2dfc8034-d66b-42a7-a699-a76b2ef872ac
status: experimental
description: A repository, dependency or agent changes MCP commands,
  automatic-task settings, tool approval or model-routing configuration before
  new execution.
author: MagicSword OpenAttacks catalog
date: 2026-10-23
falsepositives:
  - Authorized activity matching this broad hunt; baseline and investigate
    before alerting.
level: low
logsource:
  category: application
  product: openattacks_audit
  definition: Custom normalized audit schema; map EventType, Actor, Asset, Action,
    Target and CorrelationId from the required source logs first.
detection:
  selection:
    EventType:
      - agent.config.write
      - agent.approval.change
  condition: selection
KQL
Draft KQLDownload KQL
// SCHEMA TEMPLATE: create/map this custom table before use; not a built-in Sentinel table.
// OpenAttacksAudit_CL: TimeGenerated(datetime), EventType/Actor/Asset/Action/Target/CorrelationId(string).
// Selects candidates only. Apply the stage hypothesis and correlation steps before alerting.
OpenAttacksAudit_CL
| where TimeGenerated > ago(7d)
| where EventType in ("agent.config.write", "agent.approval.change")
| project TimeGenerated, EventType, Actor, Asset, Action, Target, CorrelationId
| order by TimeGenerated desc
SPL
Draft SPLDownload SPL
sourcetype="openattacks:audit"
EventType IN ("agent.config.write", "agent.approval.change")
| table _time EventType Actor Asset Action Target CorrelationId
| sort - _time
Investigation steps
  1. Diff command, args, environment, origin, autoApprove and task settings against the previously approved version.
  2. Correlate the author and change with the next agent launch; inspect path canonicalization and trailing-dot variants where relevant.
03Windows normalizes the trailing dotAgent trust / configuration changesCustom schema · Draft

The write reaches the real MCP configuration or executable-path setting.

What to look for

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

Required logs

  • File changes and before/after content for MCP / IDE configuration
  • Repository audit / pull-request history
  • Agent startup and tool-invocation logs

Coverage limit. A file-write event alone cannot establish what changed. Legitimate setup also changes these files; obtain a diff and authorization context.

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.

Sigma
Draft SigmaDownload Sigma
title: Hunt - Agent trust / configuration changes
id: 2dfc8034-d66b-42a7-a699-a76b2ef872ac
status: experimental
description: A repository, dependency or agent changes MCP commands,
  automatic-task settings, tool approval or model-routing configuration before
  new execution.
author: MagicSword OpenAttacks catalog
date: 2026-10-23
falsepositives:
  - Authorized activity matching this broad hunt; baseline and investigate
    before alerting.
level: low
logsource:
  category: application
  product: openattacks_audit
  definition: Custom normalized audit schema; map EventType, Actor, Asset, Action,
    Target and CorrelationId from the required source logs first.
detection:
  selection:
    EventType:
      - agent.config.write
      - agent.approval.change
  condition: selection
KQL
Draft KQLDownload KQL
// SCHEMA TEMPLATE: create/map this custom table before use; not a built-in Sentinel table.
// OpenAttacksAudit_CL: TimeGenerated(datetime), EventType/Actor/Asset/Action/Target/CorrelationId(string).
// Selects candidates only. Apply the stage hypothesis and correlation steps before alerting.
OpenAttacksAudit_CL
| where TimeGenerated > ago(7d)
| where EventType in ("agent.config.write", "agent.approval.change")
| project TimeGenerated, EventType, Actor, Asset, Action, Target, CorrelationId
| order by TimeGenerated desc
SPL
Draft SPLDownload SPL
sourcetype="openattacks:audit"
EventType IN ("agent.config.write", "agent.approval.change")
| table _time EventType Actor Asset Action Target CorrelationId
| sort - _time
Investigation steps
  1. Diff command, args, environment, origin, autoApprove and task settings against the previously approved version.
  2. Correlate the author and change with the next agent launch; inspect path canonicalization and trailing-dot variants where relevant.
04Attacker-chosen command runsUnapproved Windows program executionNative logs · Draft

The changed MCP startup command or binary path enables code execution.

What to look for

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

Required logs

  • Windows process creation
  • Download provenance and file hashes
  • File certificate information and application-control audit / block events

Coverage limit. Many approved installers run from user-writable folders. These events are hunt candidates, not proof of malware or an enforced block.

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.

Sigma
Draft SigmaDownload Sigma
title: Hunt - Unapproved Windows program execution
id: e217e948-e57c-48b8-a331-66006de42ae1
status: experimental
description: A newly downloaded or staged executable runs from a user-writable
  location and exhibits the reported follow-on behavior.
author: MagicSword OpenAttacks catalog
date: 2026-10-23
falsepositives:
  - Authorized activity matching this broad hunt; baseline and investigate
    before alerting.
level: low
logsource:
  category: process_creation
  product: windows
detection:
  selection:
    Image|contains:
      - \Downloads\
      - \AppData\Local\Temp\
      - \AppData\Roaming\
  condition: selection
KQL
Draft KQLDownload KQL
// Draft hunt; requires Defender for Endpoint process telemetry for this OS.
DeviceProcessEvents
| where Timestamp > ago(7d)
| where FolderPath contains "\\Downloads\\" or FolderPath contains "\\AppData\\Local\\Temp\\" or FolderPath contains "\\AppData\\Roaming\\"
| project Timestamp, DeviceName, AccountName, FileName, ProcessCommandLine, InitiatingProcessFileName, InitiatingProcessCommandLine, SHA1
| order by Timestamp desc
SPL
Draft SPLDownload SPL
sourcetype="XmlWinEventLog:Microsoft-Windows-Sysmon/Operational" EventCode=1
Image IN ("*\\Downloads\\*", "*\\AppData\\Local\\Temp\\*", "*\\AppData\\Roaming\\*")
| table _time host User Image CommandLine ParentImage ParentCommandLine
| sort - _time
Investigation steps
  1. Verify publisher, hash, origin, prevalence and local approval rather than trusting a product name or signature.
  2. Trace child processes and related credential, network or persistence events.
Technical detailsTooling, impact & MITRE ATLAS

Attack context

AI's role
Agent / MCP as target
Initial access
Indirect prompt injection (file content / MCP) into Copilot chat, or misaligned agent

Tooling as reported

AI products, models and artifacts

Other tooling

  • MCP config
  • ripgrepPath setting

Targets and reported impact

Targets / sectors
Visual Studio and SSMS users
Reported scale / exposure
Patched 2026-10-13 Patch Tuesday

Reported attribution

Vulnerability research; CVE-2026-103572 CVSS 8.8 Important

Structured attribution

Actor
Vulnerability research

Detection rules

  • Review attack-specific indicatorsGUIDANCE

    Monitor for the techniques described in Visual Studio / SSMS Copilot trailing-dot RCE (CVE-2026-103572). Refer to sources for specific IOCs and TTPs.

Source defensive notes

Patch VS/SSMS; alert on Copilot writes to .mcp.json / settings.VisualStudio.json; watch devenv/Ssms spawning unexpected binaries

MITRE ATLAS

AI-specific catalog annotations based on the reported behavior; these are not MITRE case-study assignments.

AML.T0051.001Indirect

Files or MCP responses can inject the editing instructions. Source

AML.T0081Modify AI Agent Configuration

The resulting edit modifies MCP startup or executable configuration. Source

Sources & research credit

1 source

Research by Johann Rehberger (wunderwuzzi23) · Embrace The Red

  1. embracethered.com
Record & downloads
Source record name
Visual Studio / SSMS Copilot trailing-dot RCE (CVE-2026-103572)
Entry ID
vs-copilot-trailing-dot-rce-2026-10
Catalog review
October 20, 2026
Category
attacks-on-ai
AI involvement confidence
confirmed