Skip to main content
Live Webinar with SANS (June 25)— Agentic CTI Automation for Fun & ProfitRegister Free
Mallory
High

Command Injection in GitHub Copilot and Visual Studio Code mcp.json Handling

IdentifiersCVE-2026-21518CWE-77· Improper Neutralization of Special…

CVE-2026-21518 is a command injection vulnerability affecting GitHub Copilot and Microsoft Visual Studio Code. The flaw is described as improper neutralization of special elements used in a command and is specifically tied to the handling of mcp.json files. Available reporting indicates that the vulnerable code path fails to properly validate or sanitize a user-controlled string before it is incorporated into a system call, enabling command injection. In practical exploitation scenarios, a remote attacker can craft a malicious project containing a specially prepared mcp.json file and induce a target user to open that project in Visual Studio Code. Successful exploitation can result in arbitrary code execution in the security context of the current user, while Microsoft classifies the issue as a security feature bypass.

Share:
For your environment

Are you exposed to this one?

Mallory correlates every CVE against your assets, your vendors, and active adversary campaigns. Know which vulnerabilities matter for you, not just which ones are loud.

ANALYST BRIEF

Impact, mitigation & remediation

What it means. What to do now. Patch path, mitigations, and the assume-compromise checklist.

Impact

What an attacker gets, and what they’ve been doing with it.

Successful exploitation allows arbitrary command execution on the affected system in the context of the user running Visual Studio Code. This can lead to full compromise of the user session, including execution of attacker-controlled programs, access to user-accessible data, modification of files, installation of additional payloads, and use of the compromised workstation as a pivot point for further activity. Because exploitation requires opening a malicious project, the impact is bounded by user privileges but can still be severe on developer workstations and similar environments.

Mitigation

If you can’t patch tonight, do this now.

Until patching is completed, avoid opening untrusted or externally supplied Visual Studio Code projects, especially those containing mcp.json files. Restrict use of GitHub Copilot and related project metadata processing in environments where untrusted repositories are routinely opened. Use least-privilege user accounts for development workflows and isolate developer tooling from sensitive environments to reduce post-exploitation impact. Additional mitigation details are not currently available from the provided content.

Remediation

Patch, then assume compromise.

Apply Microsoft's security update that addresses CVE-2026-21518 in the affected GitHub Copilot and Visual Studio Code components. Microsoft has issued a patch for supported versions and published guidance in its Security Response Center Update Guide entry for this CVE. Upgrade Visual Studio Code and associated affected components to the fixed release level provided by Microsoft.
PUBLIC EXPLOITS

Exploits

No public exploits tracked yet. Mallory keeps watching.

VALID 0 / 0 TOTALView more in app

No public exploit code observed for this vulnerability.

EXPOSURE SURFACE

Affected products & vendors

Products and vendors Mallory has correlated with this vulnerability. Open in Mallory to drill down to specific CPE configurations and version ranges.

VendorProductType
GitHubCopilotapplication
Microsoft CorporationVisual Studio Codeapplication
Microsoft CorporationVisual Studio Code Copilot Chat Extensionapplication

Vendor-confirmed product mapping. Mallory continuously reconciles this list against your asset inventory.

What this page doesn’t show

The version that knows your environment.

This page is what’s public. Mallory adds the parts that aren’t: which of your assets are affected, which adversaries are exploiting it right now, which detections to deploy, and what to do tonight.
Exposure mapping

Query your assets running an affected version, and investigate the blast radius.

Threat actor evidence

Every observed campaign linking this CVE to a named adversary.

Associated malware

Malware families riding this exploit, with evidence and IOCs.

Detection signatures

YARA, Sigma, Snort, and vendor rules, auto-deployed to your SIEM.

Vendor-by-vendor mapping

Cross-references every affected SKU, including bundled OEM variants.

Social activity2

Community discussion across Reddit, Mastodon, and other social sources.