CVE-2023-24893

7.8 HIGH

📋 TL;DR

CVE-2023-24893 is a remote code execution vulnerability in Visual Studio Code that allows attackers to execute arbitrary code on a user's system by tricking them into opening a malicious workspace file. This affects all Visual Studio Code users who open untrusted workspace files. The vulnerability stems from improper input validation in workspace trust handling.

💻 Affected Systems

Products:
  • Visual Studio Code
Versions: Versions prior to 1.76.0
Operating Systems: Windows, macOS, Linux
Default Config Vulnerable: ⚠️ Yes
Notes: All platforms running vulnerable versions are affected. The vulnerability requires user interaction to open a malicious workspace file.

📦 What is this software?

⚠️ Risk & Real-World Impact

🔴

Worst Case

Complete system compromise with attacker gaining full control over the victim's machine, potentially leading to data theft, ransomware deployment, or lateral movement within networks.

🟠

Likely Case

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

🟢

If Mitigated

Limited impact with proper workspace trust settings enabled, potentially preventing execution of malicious code.

🌐 Internet-Facing: MEDIUM
🏢 Internal Only: HIGH

🎯 Exploit Status

Public PoC: ⚠️ Yes
Weaponized: LIKELY
Unauthenticated Exploit: ✅ No
Complexity: LOW

Exploitation requires user interaction to open a malicious workspace file. The vulnerability has been publicly disclosed with proof-of-concept available.

🛠️ Fix & Mitigation

✅ Official Fix

Patch Version: 1.76.0 and later

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

Restart Required: Yes

Instructions:

1. Open Visual Studio Code. 2. Go to Help > Check for Updates. 3. Install update to version 1.76.0 or later. 4. Restart Visual Studio Code after installation.

🔧 Temporary Workarounds

Enable Workspace Trust

all

Enable workspace trust feature to prevent automatic execution of code in untrusted workspaces

Set "security.workspace.trust.enabled": true in settings.json

Disable Automatic Workspace Opening

all

Prevent Visual Studio Code from automatically opening workspace files

Set "window.restoreWindows": "none" in settings.json

🧯 If You Can't Patch

  • Enable workspace trust feature and only open workspace files from trusted sources
  • Use Visual Studio Code in a sandboxed environment or virtual machine

🔍 How to Verify

Check if Vulnerable:

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

Check Version:

code --version

Verify Fix Applied:

Verify Visual Studio Code version is 1.76.0 or higher in Help > About.

📡 Detection & Monitoring

Log Indicators:

  • Unexpected workspace file openings
  • Suspicious process executions from Visual Studio Code
  • Error logs related to workspace trust failures

Network Indicators:

  • Unusual outbound connections from Visual Studio Code process
  • Downloads of suspicious workspace files

SIEM Query:

Process Creation where Parent Process Name contains "Code.exe" and Command Line contains suspicious patterns

🔗 References

📤 Share & Export