← Lab /Security & privacy

Copilot can bypass path checks via trailing dot filenames to achieve RCE in VS and SSMS

Copilot can bypass Visual Studio and SSMS path validation and execute arbitrary commands

Security & privacy Embrace The Red 13 Oct 2026 Disclosure Real-world evidence

Published as “Visual Studio Copilot and SSMS Remote Code Execution (CVE-2026-103572)”

Why it matters

The bug shows that Windows filename canonicalization can be abused to achieve RCE in AI-assisted IDEs, prompting the need for stricter path handling in such products.

Summary

The author discovered that the shared Copilot DLL in Visual Studio 2026 and SSMS validates file paths without handling trailing dots, allowing a malicious .mcp.json. filename to be written to the real settings file after Windows canonicalization. By writing malicious configuration (e.g., a ripgrepPath pointing to calc.exe) the attacker can trigger arbitrary command execution when Copilot performs a search. The write-up includes proof-of-concept demos and shows that Microsoft’s patch adds a GetFullPath call to normalize paths, closing the bypass.

What they found 2

  1. Copilot can bypass a path validation check and write to its own settings files, leading to arbitrary command execution

    “allows Copilot in Visual Studio or SQL Server Management Studio to bypass a path validation check and write to its own settings and configuration files. This allows Copilot to escape containment restrictions and achieve arbitrary command execution.”

  2. A trailing dot allows the AI agent to bypass protections around sensitive configuration files

    “A trailing dot allowed the AI agent to bypass protections around sensitive configuration files and modify settings it was explicitly supposed to be prevented from changing.”

Caveats 2

  • The second MCP exploit is a bit more involved and required gathering a local VS install identifier as part of the path name to find the settings file
  • The fix adds a call to GetFullPath which removes the dot and normalizes the filename

What’s new here 4

  • Identifies a trailing-dot filename bypass that defeats Copilot's path validation
  • Shows additional path-traversal and installation-ID discovery issues
  • Demonstrates end-to-end remote code execution exploits for both VS and SSMS
  • Analyzes Microsoft’s fix that normalizes paths with GetFullPath

In the news