Advisory Details

April 2nd, 2026

Microsoft Visual Studio Code mcp.json Command Injection Remote Code Execution Vulnerability

ZDI-26-253
ZDI-CAN-29184

CVE ID CVE-2026-21518
CVSS SCORE 7.8, AV:L/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H
AFFECTED VENDORS Microsoft
AFFECTED PRODUCTS Visual Studio Code
VULNERABILITY DETAILS

This vulnerability allows remote attackers to execute arbitrary code on affected installations of Microsoft Visual Studio Code. User interaction is required to exploit this vulnerability in that the target open a malicious project.

The specific flaw exists within the handling of mcp.json files. The issue results from the lack of proper validation of a user-supplied string before using it to execute a system call. An attacker can leverage this vulnerability to execute code in the context of the current user.

ADDITIONAL DETAILS Microsoft has issued an update to correct this vulnerability. More details can be found at:
https://msrc.microsoft.com/update-guide/vulnerability/CVE-2026-21518
DISCLOSURE TIMELINE
  • 2026-03-05 - Vulnerability reported to vendor
  • 2026-04-02 - Coordinated public release of advisory
  • 2026-04-02 - Advisory Updated
CREDIT Amol Dosanjh, Dre Cura (@dre_cura), and Nicholas Zubrisky (@NZubrisky) of TrendAI Research
BACK TO ADVISORIES