CVE-2021-29261
📋 TL;DR
This vulnerability in the unofficial Svelte extension for Visual Studio Code allows attackers to execute arbitrary code by tricking users into opening a malicious workspace configuration. It affects developers using the Svelte extension in VS Code with versions before 104.8.0.
💻 Affected Systems
- Svelte for VS Code (unofficial extension)
📦 What is this software?
Svelte by Svelte
⚠️ Risk & Real-World Impact
Worst Case
Complete system compromise with attacker gaining full control of the developer's machine, potentially leading to data theft, lateral movement, or ransomware deployment.
Likely Case
Attacker executes malicious code in the context of the VS Code process, potentially stealing source code, credentials, or installing backdoors.
If Mitigated
Limited impact if extension is updated promptly and users avoid opening untrusted workspace configurations.
🎯 Exploit Status
Exploitation requires social engineering to get user to open malicious workspace configuration. No authentication bypass needed once user interacts with the file.
🛠️ Fix & Mitigation
✅ Official Fix
Patch Version: 104.8.0
Vendor Advisory: https://github.com/sveltejs/language-tools/releases/tag/extensions-104.8.0
Restart Required: Yes
Instructions:
1. Open VS Code. 2. Go to Extensions view (Ctrl+Shift+X). 3. Find 'Svelte for VS Code'. 4. Click Update button or uninstall/reinstall. 5. Restart VS Code.
🔧 Temporary Workarounds
Disable Svelte Extension
allTemporarily disable the vulnerable extension until patched
code --disable-extension svelte.svelte-vscode
Avoid Untrusted Workspaces
allDo not open workspace configurations from untrusted sources
🧯 If You Can't Patch
- Disable the Svelte extension completely in VS Code
- Implement strict policies against opening workspace files from untrusted sources
🔍 How to Verify
Check if Vulnerable:
Check extension version in VS Code: Extensions view → Svelte for VS Code → check version number
Check Version:
code --list-extensions --show-versions | grep svelte
Verify Fix Applied:
Verify extension version is 104.8.0 or higher in VS Code Extensions view
📡 Detection & Monitoring
Log Indicators:
- VS Code extension loading errors
- Unusual workspace configuration file access
Network Indicators:
- Unusual outbound connections from VS Code process
SIEM Query:
process_name:vscode AND (process_cmdline:*svelte* OR file_path:*workspace*)
🔗 References
- https://github.com/sveltejs/language-tools/commit/5d7bf1fd98bfe2cd2080863a3c95ce099b898075
- https://github.com/sveltejs/language-tools/releases
- https://github.com/sveltejs/language-tools/releases/tag/extensions-104.8.0
- https://marketplace.visualstudio.com/items?itemName=svelte.svelte-vscode
- https://vuln.ryotak.me/advisories/3
- https://github.com/sveltejs/language-tools/commit/5d7bf1fd98bfe2cd2080863a3c95ce099b898075
- https://github.com/sveltejs/language-tools/releases
- https://github.com/sveltejs/language-tools/releases/tag/extensions-104.8.0
- https://marketplace.visualstudio.com/items?itemName=svelte.svelte-vscode
- https://vuln.ryotak.me/advisories/3