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

- ID: vs-copilot-trailing-dot-rce-2026-10
- Reported: 2026-10-13
- Researcher: Johann Rehberger (wunderwuzzi23)
- Organization: Embrace The Red
- AI role: ai_agent_or_mcp_as_target (Agent / MCP as target)
- Confidence in AI involvement: not assessed
- Research / borderline: false
- Last reviewed: 2026-10-20
- Entry page: https://openattacks.ai/attacks/vs-copilot-trailing-dot-rce-2026-10/
- Entry JSON: https://openattacks.ai/api/attacks/vs-copilot-trailing-dot-rce-2026-10.json
- Browse title: Visual Studio / SSMS Copilot trailing-dot RCE (CVE-2026-103572)
- Editorial summary: 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.
- Evidence class (catalog annotation): Vulnerability report
- Source-stated target environments: Agents & MCP; Windows
- Stage hunts and conditional defenses: https://openattacks.ai/api/defenses/vs-copilot-trailing-dot-rce-2026-10.json

## Technique
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.

## Stack relevance (editorial)
Assessment: mapped. Editorial applicability reviewed against the catalog source account; not a scan or independent incident verification.
First action: Check the Visual Studio / SSMS advisory and review agent edits to MCP and executable-path settings.
- Relationship: target; tools: github-copilot; OS scope: windows; requires existing MCP connections: false.
  Relevance: This report concerns Copilot in Visual Studio / SSMS on Windows, rather than every Copilot integration.
  Condition to check: Confirm that the installed version is affected by the historical report; selecting a product does not establish its version or patch status.
  Condition to check: Confirm use of the affected Visual Studio / SSMS integration; the trailing-dot path depends on Windows filename normalization.
  Evidence: https://embracethered.com/blog/posts/2026/visual-studio-copilot-remote-code-execution/
A product mention alone is not a victim-side applicability mapping. Selection does not verify affected versions, permissions or compromise.

## Initial access
Indirect prompt injection (file content / MCP) into Copilot chat, or misaligned agent

## AI tooling and models
- [GitHub Copilot](https://github.com/features/copilot) in Visual Studio / SSMS
- MAI-Code-1-Flash (PoC model)

## Other tooling
- MCP config
- ripgrepPath setting

## Victims and sectors
Visual Studio and SSMS users

## Target geography
- unknown

## Attribution
Vulnerability research; CVE-2026-103572 CVSS 8.8 Important

## Scale and metrics
Patched 2026-10-13 Patch Tuesday

## Attack flow
Catalog reconstruction of the supplied source account. Unknowns and research caveats are preserved.
### step-1: Untrusted instructions reach Copilot [access]
A file or MCP server supplies indirect instructions.
Evidence: https://embracethered.com/blog/posts/2026/visual-studio-copilot-remote-code-execution/

### step-2: Agent edits a protected configuration name [ai]
Writing .mcp.json. bypasses a string-based edit check.
Evidence: https://embracethered.com/blog/posts/2026/visual-studio-copilot-remote-code-execution/

### step-3: Windows normalizes the trailing dot [execution]
The write reaches the real MCP configuration or executable-path setting.
Evidence: https://embracethered.com/blog/posts/2026/visual-studio-copilot-remote-code-execution/

### step-4: Attacker-chosen command runs [impact]
The changed MCP startup command or binary path enables code execution.
Evidence: https://embracethered.com/blog/posts/2026/visual-studio-copilot-remote-code-execution/

Connections:
- step-1 -> step-2
- step-2 -> step-3
- step-3 -> step-4

## Stage defense and hunting recommendations
Editorial recommendations, not validated coverage. Source-controlled query starters are drafts. Custom-schema examples require telemetry collection and field mapping; absence of a mapping means not assessed. MagicSword policy opportunities require managed Windows scope and enforcement.
### step-1: Untrusted content enters an agent session
- Visibility: Application / agent audit records
- Query origin: catalog_authored; status: draft; log scope: custom_schema
- SIGMA query download: /api/detections/agent-input.sigma.yml
- KQL query download: /api/detections/agent-input.kql
- SPL query download: /api/detections/agent-input.spl
- Hunt hypothesis: An agent ingests external content or an untrusted session identifier before a tool action or configuration change outside the approved task.
- Required 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.
- Investigate: 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.
- Qualification: Record the originating file or MCP response and the consuming session, then correlate with configuration changes and execution.
- No direct MagicSword prevention claim is recorded for this stage.

### step-2: Agent trust / configuration changes
- Visibility: Defender-side logs where collected
- Query origin: catalog_authored; status: draft; log scope: custom_schema
- SIGMA query download: /api/detections/mcp-config.sigma.yml
- KQL query download: /api/detections/mcp-config.kql
- SPL query download: /api/detections/mcp-config.spl
- Hunt hypothesis: A repository, dependency or agent changes MCP commands, automatic-task settings, tool approval or model-routing configuration before new execution.
- Required 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.
- Investigate: 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.
- No direct MagicSword prevention claim is recorded for this stage.

### step-3: Agent trust / configuration changes
- Visibility: Defender-side logs where collected
- Query origin: catalog_authored; status: draft; log scope: custom_schema
- SIGMA query download: /api/detections/mcp-config.sigma.yml
- KQL query download: /api/detections/mcp-config.kql
- SPL query download: /api/detections/mcp-config.spl
- Hunt hypothesis: A repository, dependency or agent changes MCP commands, automatic-task settings, tool approval or model-routing configuration before new execution.
- Required 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.
- Investigate: 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.
- No direct MagicSword prevention claim is recorded for this stage.

### step-4: Unapproved Windows program execution
- Visibility: Defender-side logs where collected
- Query origin: catalog_authored; status: draft; log scope: native
- SIGMA query download: /api/detections/windows-install.sigma.yml
- KQL query download: /api/detections/windows-install.kql
- SPL query download: /api/detections/windows-install.spl
- Hunt hypothesis: A newly downloaded or staged executable runs from a user-writable location and exhibits the reported follow-on behavior.
- Required 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.
- Investigate: 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.
- Conditional MagicSword policy: Use MagicSword to audit the actual executable's signer, publisher or hash, then enforce a policy that denies unapproved code on managed Windows hosts.
- Policy scope: The attacker-chosen Windows MCP server / ripgrepPath executable when denied by policy. This does not repair the configuration-name canonicalization bug.
- Policy 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.
- Policy reference: https://www.magicsword.io/use-cases/application-control?utm_source=openattacks&utm_medium=referral&utm_content=stage-control


## MITRE ATLAS
Mappings are catalog annotations based on described behavior, not assignments or endorsements by MITRE.
- AML.T0051.001: Indirect — Files or MCP responses can inject the editing instructions.
  Technique: https://atlas.mitre.org/techniques/AML.T0051.001
  Evidence: https://embracethered.com/blog/posts/2026/visual-studio-copilot-remote-code-execution/
- AML.T0081: Modify AI Agent Configuration — The resulting edit modifies MCP startup or executable configuration.
  Technique: https://atlas.mitre.org/techniques/AML.T0081
  Evidence: https://embracethered.com/blog/posts/2026/visual-studio-copilot-remote-code-execution/

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

## Sources
- https://embracethered.com/blog/posts/2026/visual-studio-copilot-remote-code-execution/
