A trailing dot let prompt injection trigger RCE in Copilot for Visual Studio
Security researcher Johann Rehberger found a way to turn GitHub Copilot's own config-file protections against it, in both Visual Studio and SQL Server Management Studio โ using nothing more exotic than a trailing period.
Security researcher Johann Rehberger found a way to turn GitHub Copilot's own config-file protections against it, in both Visual Studio and SQL Server Management Studio โ using nothing more exotic than a trailing period.
What the source says
Per Rehberger's write-up, Copilot in Visual Studio (and SSMS, which shares the same Microsoft.VisualStudio.Copilot.Core.dll) has a path-validation check meant to stop it from writing to its own protected config files โ .mcp.json, settings.VisualStudio.json. The check compared filenames as raw strings. On Windows, the Win32 file APIs silently drop a trailing period, so .mcp.json. resolves to the exact same file on disk as .mcp.json โ but the string comparison treated them as different names and let the write through.
That mattered because Copilot can be steered by indirect prompt injection: hidden instructions in a file it's asked to read, or in content an MCP server returns, with no deliberate instruction from the user at all. Using the trailing-dot alias, injected content could make Copilot add and enable a malicious MCP server via .mcp.json, or repoint Visual Studio's configured ripgrep binary via settings.VisualStudio.json โ so an attacker-chosen executable runs the next time Copilot searches the workspace. Rehberger demonstrated the hijack by launching 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 find the settings file, with no confirmation prompt.
Rehberger reported the bypass to Microsoft on August 4, 2026. Microsoft confirmed it September 16, and shipped a fix โ adding GetFullPath normalization before the filename check โ on October 13, in Visual Studio 17.14.42 and 18.10.4. CVE-2026-103572, rated Important, CVSS 8.8. The report was ruled out of bounty scope. Microsoft reports no confirmed in-the-wild exploitation.
What it doesn't establish
This was the researcher's own proof-of-concept against his own installation โ not an observed attack on a real victim. There's no evidence anyone else exploited it before the patch shipped.
Why it matters anyway
The interesting part isn't "prompt injection is dangerous" in the abstract โ it's that a filename-equality check, the kind of guard rail teams reach for first, failed against a platform-specific string quirk nobody thought to test. Any agent that validates file paths by comparing strings against a denylist, rather than normalizing the path first, has the same class of gap. If your agent writes to its own config files at all, the fix here โ normalize before you compare โ is worth checking for, not just patching.
Full write-up and severity scoring: https://www.stupidllm.com/incident/STUPID-2026-0178/
Originally published by Dev.to Security. Aggregated on AIWithGhost for educational purposes โ full credit and traffic to the original publisher.