CVE-2026-70336 Overview
CVE-2026-70336 is a code injection vulnerability in Microsoft Visual Studio Code. The flaw stems from improper control of code generation, classified as [CWE-94]. An unauthorized attacker can execute arbitrary code over a network when a user interacts with malicious content. The vulnerability carries a CVSS 3.1 score of 8.8 and requires user interaction, but no privileges or prior authentication.
Critical Impact
Successful exploitation results in arbitrary code execution in the context of the Visual Studio Code user, compromising confidentiality, integrity, and availability of the host system.
Affected Products
- Microsoft Visual Studio Code
- Refer to the Microsoft Security Update CVE-2026-70336 advisory for the authoritative list of affected builds
- Downstream distributions embedding vulnerable Visual Studio Code components
Discovery Timeline
- 2026-08-11 - CVE-2026-70336 published to the National Vulnerability Database
- 2026-08-12 - Last updated in NVD database
Technical Details for CVE-2026-70336
Vulnerability Analysis
The vulnerability originates from improper control of generated code within Visual Studio Code. The editor processes untrusted input in a code path that allows attacker-controlled data to be interpreted as executable code. When a user opens or interacts with a crafted workspace, file, or extension asset, injected code runs with the privileges of the current user.
The attack vector is network-based with low complexity. User interaction is required, which typically means opening a malicious repository, project folder, notebook, or link that Visual Studio Code processes. The scope remains unchanged, but the confidentiality, integrity, and availability impacts are each rated high.
An EPSS probability of 0.641% (47.57 percentile) indicates modest near-term exploitation likelihood, though the ease of delivery through repositories and shared projects warrants prompt remediation.
Root Cause
The root cause is insufficient sanitization or contextual escaping when Visual Studio Code generates code or evaluates content derived from untrusted sources. Data intended to be treated as inert content is instead parsed and executed by an interpreter, script host, or extension runtime inside the editor process.
Attack Vector
A remote attacker hosts a malicious workspace, repository, notebook, or extension payload. The victim is enticed to open the resource in Visual Studio Code. Upon opening, the crafted payload triggers the vulnerable code generation path, and injected code executes without further prompts. See the Microsoft Security Update CVE-2026-70336 advisory for vendor-specific technical details.
// No verified public proof-of-concept is available at time of writing.
// Vulnerability mechanism is described in prose above.
Detection Methods for CVE-2026-70336
Indicators of Compromise
- Visual Studio Code (Code.exe, code) spawning unexpected child processes such as powershell.exe, cmd.exe, bash, python, or node immediately after opening a workspace or notebook
- Outbound network connections initiated by Visual Studio Code processes to unfamiliar hosts shortly after project load
- Newly written files under user profile directories, startup locations, or extension folders following repository clone events
Detection Strategies
- Baseline legitimate Visual Studio Code child-process behavior and alert on deviations that align with living-off-the-land binaries
- Correlate git clone or archive extraction events with subsequent Visual Studio Code launches and code execution telemetry
- Hunt for anomalous script interpreters invoked with command lines referencing workspace paths or extension directories
Monitoring Recommendations
- Ingest endpoint process, file, and network telemetry into a centralized data lake for cross-source correlation
- Monitor Visual Studio Code auto-update channels to confirm patched builds are being deployed across the fleet
- Track extension installation events and workspace trust prompts to identify high-risk user behavior
How to Mitigate CVE-2026-70336
Immediate Actions Required
- Update Visual Studio Code to the fixed version identified in the Microsoft Security Update CVE-2026-70336 advisory
- Enable automatic updates for Visual Studio Code across managed developer endpoints
- Instruct users to avoid opening untrusted repositories, notebooks, or workspaces until patching is complete
Patch Information
Microsoft has issued a security update for Visual Studio Code addressing CVE-2026-70336. Consult the Microsoft Security Update CVE-2026-70336 advisory for fixed version numbers, download locations, and deployment guidance.
Workarounds
- Enable Workspace Trust in Visual Studio Code and open unknown projects only in Restricted Mode
- Disable or restrict execution of untrusted extensions and Jupyter notebook kernels
- Use isolated development environments such as containers or virtual machines when reviewing untrusted code
# Verify Visual Studio Code version and confirm patch level
code --version
# Enforce workspace trust and disable auto-detection of tasks in untrusted folders
# settings.json
# {
# "security.workspace.trust.enabled": true,
# "security.workspace.trust.startupPrompt": "always",
# "security.workspace.trust.untrustedFiles": "prompt",
# "extensions.autoUpdate": true
# }
Disclaimer: This content was generated using AI. While we strive for accuracy, please verify critical information with official sources.

