CVE-2021-27082

7.8 HIGH

📋 TL;DR

This vulnerability in the Quantum Development Kit for Visual Studio Code allows remote code execution when a user opens a specially crafted malicious project file. It affects developers using the Quantum Development Kit extension in Visual Studio Code. Attackers could execute arbitrary code with the privileges of the current user.

💻 Affected Systems

Products:
  • Microsoft Quantum Development Kit for Visual Studio Code
Versions: Versions prior to 0.18.2106.138911
Operating Systems: Windows, Linux, macOS
Default Config Vulnerable: ⚠️ Yes
Notes: Only affects systems with the Quantum Development Kit extension installed in Visual Studio Code.

📦 What is this software?

⚠️ Risk & Real-World Impact

🔴

Worst Case

Full system compromise with attacker gaining the same privileges as the user running Visual Studio Code, potentially leading to data theft, lateral movement, or persistence.

🟠

Likely Case

Local file system access, credential theft from the user's environment, and installation of malware or backdoors.

🟢

If Mitigated

Limited impact due to user account restrictions, but still potential for data exfiltration from accessible files.

🌐 Internet-Facing: LOW - Requires user interaction to open malicious project files, not directly exploitable over network.
🏢 Internal Only: MEDIUM - Internal users could be targeted via social engineering or shared malicious project files.

🎯 Exploit Status

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

Exploitation requires user interaction to open a malicious project file. No authentication bypass needed beyond tricking user.

🛠️ Fix & Mitigation

✅ Official Fix

Patch Version: 0.18.2106.138911 and later

Vendor Advisory: https://portal.msrc.microsoft.com/en-US/security-guidance/advisory/CVE-2021-27082

Restart Required: Yes

Instructions:

1. Open Visual Studio Code. 2. Go to Extensions view (Ctrl+Shift+X). 3. Find 'Quantum Development Kit' extension. 4. Click Update or reinstall to get version 0.18.2106.138911+. 5. Restart Visual Studio Code.

🔧 Temporary Workarounds

Disable Quantum Development Kit Extension

all

Temporarily disable the vulnerable extension until patching is possible

code --disable-extension microsoft.quantum

Restrict Project File Sources

all

Only open Quantum project files from trusted sources

🧯 If You Can't Patch

  • Run Visual Studio Code with minimal user privileges (not as administrator/root)
  • Use application whitelisting to prevent execution of unexpected binaries

🔍 How to Verify

Check if Vulnerable:

Check Quantum Development Kit extension version in Visual Studio Code Extensions view

Check Version:

code --list-extensions --show-versions | findstr quantum

Verify Fix Applied:

Verify extension version is 0.18.2106.138911 or higher

📡 Detection & Monitoring

Log Indicators:

  • Unexpected process execution from Visual Studio Code
  • Suspicious file operations in user directories

Network Indicators:

  • Unusual outbound connections from Visual Studio Code process

SIEM Query:

Process Creation where ParentImage contains 'Code.exe' and CommandLine contains suspicious patterns

🔗 References

📤 Share & Export