CVE-2023-36742

7.8 HIGH

📋 TL;DR

This vulnerability in Visual Studio Code allows remote code execution when a user opens a maliciously crafted file or project. It affects users who open untrusted files in Visual Studio Code, potentially allowing attackers to execute arbitrary code on the victim's system.

💻 Affected Systems

Products:
  • Visual Studio Code
Versions: Versions prior to 1.82.0
Operating Systems: Windows, macOS, Linux
Default Config Vulnerable: ⚠️ Yes
Notes: All default installations of Visual Studio Code are vulnerable. No special configuration required for exploitation.

📦 What is this software?

⚠️ Risk & Real-World Impact

🔴

Worst Case

Complete system compromise with attacker gaining full control over the victim's machine, data theft, and lateral movement within the network.

🟠

Likely Case

Local privilege escalation leading to unauthorized access to sensitive files, credentials, and system resources on the affected machine.

🟢

If Mitigated

Limited impact with proper sandboxing and security controls preventing code execution beyond the application context.

🌐 Internet-Facing: MEDIUM - Requires user interaction (opening malicious file) but can be delivered via email, downloads, or compromised websites.
🏢 Internal Only: MEDIUM - Internal users could be targeted via shared files or compromised internal resources.

🎯 Exploit Status

Public PoC: ✅ No
Weaponized: UNKNOWN
Unauthenticated Exploit: ✅ No
Complexity: MEDIUM

Exploitation requires user interaction (opening malicious file). No public exploit code available at this time.

🛠️ Fix & Mitigation

✅ Official Fix

Patch Version: 1.82.0 and later

Vendor Advisory: https://msrc.microsoft.com/update-guide/vulnerability/CVE-2023-36742

Restart Required: Yes

Instructions:

1. Open Visual Studio Code. 2. Click on Help menu. 3. Select Check for Updates. 4. Install update to version 1.82.0 or later. 5. Restart Visual Studio Code.

🔧 Temporary Workarounds

Disable automatic file opening

all

Prevent automatic opening of files from untrusted sources

Use sandboxed environment

all

Run Visual Studio Code in a container or virtual machine when handling untrusted files

🧯 If You Can't Patch

  • Restrict file opening to trusted sources only
  • Implement application whitelisting to prevent unauthorized code execution

🔍 How to Verify

Check if Vulnerable:

Check Visual Studio Code version in Help > About. If version is below 1.82.0, system is vulnerable.

Check Version:

code --version

Verify Fix Applied:

Verify version is 1.82.0 or higher in Help > About menu.

📡 Detection & Monitoring

Log Indicators:

  • Unusual file opening patterns
  • Process execution from Visual Studio Code context
  • Error logs related to file parsing

Network Indicators:

  • Downloads of suspicious files followed by Visual Studio Code execution

SIEM Query:

Process Creation where Parent Process contains 'code.exe' and Command Line contains unusual parameters

🔗 References

📤 Share & Export