CVE-2021-22195
📋 TL;DR
This vulnerability in GitLab's Visual Studio Code extension allows attackers to execute arbitrary code on users' systems through client-side exploitation. It affects users of GitLab's VS Code extension version 3.15.0 and earlier. Attackers can exploit this by tricking users into interacting with malicious content.
💻 Affected Systems
- GitLab Visual Studio Code Extension
📦 What is this software?
⚠️ Risk & Real-World Impact
Worst Case
Complete system compromise with attacker gaining full control over the user's machine, potentially leading to data theft, ransomware deployment, or lateral movement within networks.
Likely Case
Local privilege escalation leading to unauthorized access to user files, credentials, and system resources.
If Mitigated
Limited impact with proper application sandboxing and user privilege restrictions in place.
🎯 Exploit Status
Exploitation requires user interaction but is straightforward once the malicious payload is delivered.
🛠️ Fix & Mitigation
✅ Official Fix
Patch Version: 3.16.0 and later
Vendor Advisory: https://gitlab.com/gitlab-org/cves/-/blob/master/2021/CVE-2021-22195.json
Restart Required: Yes
Instructions:
1. Open Visual Studio Code. 2. Go to Extensions view. 3. Find GitLab extension. 4. Click Update button. 5. Restart VS Code after update completes.
🔧 Temporary Workarounds
Disable GitLab Extension
allTemporarily disable the vulnerable extension until patching is possible.
code --disable-extension GitLab.gitlab-workflow
Remove GitLab Extension
allCompletely remove the vulnerable extension.
code --uninstall-extension GitLab.gitlab-workflow
🧯 If You Can't Patch
- Run VS Code with minimal privileges and in sandboxed environments
- Implement application whitelisting to prevent unauthorized code execution
🔍 How to Verify
Check if Vulnerable:
Check extension version in VS Code Extensions view or run: code --list-extensions --show-versions | grep gitlab
Check Version:
code --list-extensions --show-versions | grep gitlab
Verify Fix Applied:
Verify extension version is 3.16.0 or higher using same command
📡 Detection & Monitoring
Log Indicators:
- Unusual process execution from VS Code context
- Suspicious network connections from VS Code
Network Indicators:
- Unexpected outbound connections from developer workstations
SIEM Query:
process_name:code.exe AND (parent_process:explorer.exe OR cmdline:*gitlab*)