
Cloud Vulnerability DB
A community-led vulnerabilities database
CVE-2026-21518 is a command injection vulnerability in Microsoft Visual Studio Code and the Visual Studio Code Copilot Chat extension that allows remote attackers to execute arbitrary code on affected installations. The flaw exists in the handling of mcp.json files, where user-supplied strings are not properly validated before being passed to system calls. It was disclosed and patched on February 10, 2026, as part of Microsoft's February 2026 Patch Tuesday. Affected versions include Visual Studio Code prior to 1.109.2. The vulnerability carries a CVSS v3.1 base score of 8.8 (High) (Microsoft MSRC, ZDI Advisory).
The root cause is classified as CWE-77 (Improper Neutralization of Special Elements used in a Command — 'Command Injection'). The vulnerability arises because Visual Studio Code fails to sanitize user-supplied strings within mcp.json project configuration files before passing them to system calls. An attacker can craft a malicious project containing a weaponized mcp.json file; when a victim opens this project in VS Code, the injected command executes in the context of the current user. Exploitation requires user interaction (opening a malicious project) but no authentication or elevated privileges, making it a realistic social engineering or supply chain attack vector. A proof-of-concept was published by Zero Day Initiative on April 2, 2026 (ZDI Advisory, Feedly).
Successful exploitation grants an attacker arbitrary code execution in the context of the logged-in developer user, resulting in high confidentiality, integrity, and availability impact. Because developers typically have broad access to source code repositories, credentials, CI/CD pipelines, and internal infrastructure, compromise of a developer workstation poses a significant supply chain risk — an attacker could exfiltrate source code, inject malicious code into projects, or pivot to organizational systems. The Visual Studio Code Copilot Chat extension is also listed as an affected product (Microsoft MSRC, ZDI Advisory).
mcp.json file with command injection payloads embedded in fields that are passed unsanitized to system calls (e.g., server command arguments or configuration strings).mcp.json is parsed automatically upon project load.mcp.json without proper input validation, causing the injected OS command to be executed as a system call in the context of the current user.mcp.json file in a VS Code project directory containing unusual command strings, shell metacharacters, or encoded payloads in server/command fields.cmd.exe, powershell.exe, /bin/bash, curl, wget, python) that are not typical for normal IDE operation.Microsoft released a patch on February 10, 2026; users should update Visual Studio Code to version 1.109.2 or later to remediate this vulnerability (Microsoft MSRC). As an interim workaround, users should avoid opening VS Code projects from untrusted or unknown sources, particularly those received via email, public repositories, or third-party channels. Organizations should enforce policies restricting the opening of unvetted external projects on developer machines until systems are fully patched. Monitoring for anomalous child process activity from VS Code can help detect exploitation attempts.
The vulnerability was covered as part of broader February 2026 Patch Tuesday reporting by outlets including BleepingComputer, GBHackers, CyberSecurityNews, and The Cyber Express, which noted it among 54–58 vulnerabilities fixed that month (BleepingComputer). Sophos and Rapid7 also included it in their Patch Tuesday analysis blogs (Sophos Blog, Rapid7 Blog). Security researchers highlighted the supply chain risk angle, noting that targeting developer environments via malicious project files is a particularly impactful attack vector. A community write-up on Dev.to characterized it as a security feature bypass affecting GitHub Copilot and VS Code (Dev.to).
Source: This report was generated using AI
Free Vulnerability Assessment
Evaluate your cloud security practices across 9 security domains to benchmark your risk level and identify gaps in your defenses.
Get a personalized demo
"Best User Experience I have ever seen, provides full visibility to cloud workloads."
"Wiz provides a single pane of glass to see what is going on in our cloud environments."
"We know that if Wiz identifies something as critical, it actually is."