STUPID-2026-0178

GitHub Copilot in Visual Studio and SSMS let indirect prompt injection bypass its own config path validation via a trailing dot, enabling remote code execution (CVE-2026-103572, CVSS 8.8)

9.0critical
October 13, 2026Source checkedRepro reported

Why 9/10

Affects Visual Studio 2022/2026 and SSMS, both widely used products. A trailing dot bypassed the path check entirely, letting prompt-injected content make Copilot overwrite its own MCP/settings config and reach arbitrary code execution (CVSS 8.8) — an irreversible class of harm if triggered. Demonstrated by the researcher as proof of concept; Microsoft patched it and reports no confirmed in-the-wild exploitation.

Scope
4/4
Many organisations or the public: a flaw in a widely used product, mass exposure, a large outage
Recoverability
3/3
Permanently lost or irreversible, including data that was exposed
Did it happen
1/2
Demonstrated (proof of concept, reproduction, controlled test or near-miss) with no real victim reported
Beyond the user
1/1
Production systems, customers or third parties, or credentials and sensitive personal data

The score is the sum of these four factors. How each factor is scored · scored 2026-11-27

Status and what to do

Affected
GitHub Copilot in Visual Studio 2022 (17.14.x before 17.14.42) and Visual Studio 2026 (18.10.x before 18.10.4), and SQL Server Management Studio (SSMS), which shares the vulnerable Microsoft.VisualStudio.Copilot.Core.dll.
Fix status
Fixed · Fixed in Visual Studio 17.14.42 and 18.10.4, shipped in Microsoft's October 2026 Patch Tuesday release. The researcher's own review of the patch found a GetFullPath normalization call added before the filename check.
Mitigation
Update to the patched Visual Studio/SSMS builds. Treat any content an agent reads from outside your direct control (files from a repo, MCP server responses) as untrusted input capable of steering the agent's own configuration writes, not just its chat output. Source
Last reviewed
2026-11-27 · Report a correction to this record
  1. Instruction given

    No deliberate user instruction was required. The researcher demonstrated that content Copilot processes in the normal course of use — a file the user opens, or data returned by an MCP server — can carry hidden instructions that steer the agent into writing its own protected configuration files.

  2. Expected behavior

    Copilot's path-validation check (in EditsFunctionHandler.GetEditConfirmationTypeAsync, inside the shared Microsoft.VisualStudio.Copilot.Core.dll) should block writes to protected names such as .mcp.json and settings.VisualStudio.json regardless of how the filename is spelled, and indirect prompt injection should never be able to make the agent modify its own configuration or trusted paths without the user's explicit, informed approval.

  3. Actual behavior

    The validation check compared the raw filename string against the protected name. On Windows, a trailing period is silently dropped by the Win32 file APIs, so ".mcp.json." and "settings.VisualStudio.json." refer to the same files as the unmodified names but did not match the check. Indirect prompt injection — hidden instructions in a file Copilot was asked to read, or in data returned by an MCP server — could direct Copilot to write through this trailing-dot alias, letting it add and enable a malicious MCP server via .mcp.json, or repoint Visual Studio's configured ripgrep binary via settings.VisualStudio.json so that an attacker-chosen executable (demonstrated with calc.exe) ran the next time Copilot searched the workspace. The same shared DLL and bypass pattern affected SSMS, which the researcher also showed was reachable via a path-traversal flaw in SSMS.isolation.ini that disclosed the installation ID needed to locate the user's settings file without confirmation.

  4. Damage

    Rated Important severity / CVSS 8.8 by Microsoft. The researcher reported the initial bypass to Microsoft on August 4, 2026, Microsoft confirmed it September 16, 2026, and shipped a fix (adding path normalization via GetFullPath before validation) on October 13, 2026 in Visual Studio 17.14.42 and 18.10.4, the same day the write-up was published. The researcher received no bounty, the finding being ruled out of scope. Microsoft reports no confirmed exploitation in the wild; the demonstrated attacks were the researcher's own proof-of-concept tests, not a real victim.

Full write-up

Security researcher Johann Rehberger disclosed CVE-2026-103572, a remote code execution vulnerability in GitHub Copilot as integrated into Visual Studio and SQL Server Management Studio (SSMS). Both products share the same Microsoft.VisualStudio.Copilot.Core.dll, and both carried the same flaw: a path-validation check meant to stop Copilot from writing to its own protected configuration files compared filenames as raw strings, without accounting for how Windows handles them. A trailing period is dropped by the Win32 file APIs, so .mcp.json. resolves to the same file as .mcp.json on disk, but the string comparison treated them as different names and let the write through.

That gap mattered because Copilot can be steered by indirect prompt injection — hidden instructions in a file it is asked to read, or in content an MCP server returns — into making writes on its own, with no deliberate instruction from the user. Using the trailing-dot bypass, injected content could make Copilot add and enable a malicious MCP server by rewriting .mcp.json, or change the path Visual Studio uses for ripgrep via settings.VisualStudio.json, so that an attacker-chosen binary ran the next time Copilot searched the workspace. Rehberger demonstrated the ripgrep hijack by having it launch calc.exe. SSMS was reachable the same way, with an added path-traversal bug in SSMS.isolation.ini that leaked the installation ID needed to locate the user's settings file without any confirmation prompt.

Rehberger reported the initial bypass to Microsoft on August 4, 2026; Microsoft confirmed it on September 16, 2026, and shipped a fix — adding path normalization before the filename check — on October 13, 2026, in Visual Studio 17.14.42 and 18.10.4, rated Important severity with a CVSS score of 8.8. The report was ruled out of bounty scope. Microsoft has not confirmed any in-the-wild exploitation; the demonstrated attacks were the researcher's own proof-of-concept tests against his own installation, not damage to a real victim.

Classification

Root cause
Logic Error
Domain
Security
OWASP Agentic Top 10 (our mapping)
ASI05 Unexpected Code Execution (RCE) list
MIT AI Risk Repository (our mapping)
2.2 AI system security vulnerabilities and attacks taxonomy

Related incidents

Cite this record
StupidLLM. "STUPID-2026-0178: GitHub Copilot in Visual Studio and SSMS let indirect prompt injection bypass its own config path validation via a trailing dot, enabling remote code execution (CVE-2026-103572, CVSS 8.8)." AI Agent Incident Database, 2026. https://www.stupidllm.com/incident/STUPID-2026-0178/ (accessed 2026-11-27). CC BY 4.0.

← STUPID-2026-0177By ID

Get told when an agent breaks something

We document AI agent failures daily, severity-scored against a published scale. Each Monday, if any scored 7 or above that week — deleted data, leaked secrets, broken production — you get one email with the sources. When nothing did, you get nothing.

This database is callable over MCP — query it from inside your agent.