Cross-platform detection and removal tool for malicious VSCode extensions affected by the Glassworm supply chain attack (October 2025).
Available for:
- π§ Linux/macOS: Bash script (
glassworm-detect.sh) - πͺ Windows: PowerShell script (
glassworm-detect.ps1)
Glassworm is a supply chain attack that compromised multiple VSCode extensions on both the OpenVSX and Microsoft VSCode marketplaces. The malicious versions of these extensions contained code that could:
- Execute arbitrary commands on the host system
- Steal sensitive data including credentials
- Establish persistent backdoors
- Exfiltrate source code and project files
This tool checks for the following malicious extensions and their compromised versions, according to https://www.koi.ai/blog/glassworm-first-self-propagating-worm-using-invisible-code-hits-openvsx-marketplace
codejoy.codejoy-vscode-extension@ 1.8.3, 1.8.4l-igh-t.vscode-theme-seti-folder@ 1.2.3kleinesfilmroellchen.serenity-dsl-syntaxhighlight@ 0.3.2JScearcy.rust-doc-viewer@ 4.2.1SIRILMP.dark-theme-sm@ 3.11.4CodeInKlingon.git-worktree-menu@ 1.0.9, 1.0.91ginfuru.better-nunjucks@ 0.3.2ellacrity.recoil@ 0.7.4grrrck.positron-plus-1-e@ 0.0.71jeronimoekerdt.color-picker-universal@ 2.8.91srcery-colors.srcery-colors@ 0.3.9sissel.shopify-liquid@ 4.0.1TretinV3.forts-api-extention@ 0.3.1
cline-ai-main.cline-ai-agent@ 3.1.3
- Bash 4.0+ (the script uses associative arrays)
- macOS/Linux operating system
- VSCode, VSCode Insiders, or VSCodium installed (optional - script will check all)
bash --versionOn macOS, the default /bin/bash is version 3.2. If you need to upgrade:
# Install via Homebrew
brew install bash
# Verify installation
/usr/local/bin/bash --versionThe script uses #!/usr/bin/env bash to automatically use the newer version if available.
- PowerShell Core 7.0+ (recommended) or Windows PowerShell 5.1+
- Windows operating system
- VSCode, VSCode Insiders, or VSCodium installed (optional - script will check all)
$PSVersionTable.PSVersionIf you need to install or upgrade to PowerShell Core:
# Using winget (Windows 10/11)
winget install --id Microsoft.PowerShell --source winget
# Or download from: https://github.com/PowerShell/PowerShell/releasesIf you encounter execution policy errors when running the script:
# Allow scripts from remote sources (recommended)
Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope CurrentUser
# Or allow all scripts (less secure)
Set-ExecutionPolicy -ExecutionPolicy Unrestricted -Scope CurrentUser-
Clone the repository:
git clone https://github.com/unic/glassworm-detect cd glassworm-detect -
Make the script executable (if not already):
chmod +x glassworm-detect.sh
-
Run the script:
./glassworm-detect.sh
-
Follow the prompts - if infected extensions are found, you'll be asked whether to uninstall them.
-
Clone the repository:
git clone https://github.com/unic/glassworm-detect cd glassworm-detect
-
Run the script:
.\glassworm-detect.ps1Or with PowerShell Core explicitly:
pwsh .\glassworm-detect.ps1 -
Follow the prompts - if infected extensions are found, you'll be asked whether to uninstall them.
Note: If you get an execution policy error, see the Setting Execution Policy section above.
The script will:
-
β Scan all VSCode installations on your system:
- Visual Studio Code (
code) - Visual Studio Code Insiders (
code-insiders) - VSCodium (
codium)
- Visual Studio Code (
-
π Check all installed extensions against the known malicious list
-
π Report findings with color-coded output:
- π’ Green = Clean/Safe
- π‘ Yellow = Warnings
- π΄ Red = Infected extensions found
-
ποΈ Offer to uninstall any infected extensions (with confirmation)
-
π Generate a log file with scan results (timestamped)
Both scripts return meaningful exit codes for automation:
0- Clean system, no infections found1- Infected extensions detected
This allows you to use them in scripts:
Bash:
if ./glassworm-detect.sh; then
echo "System is clean"
else
echo "Infections found - please review"
fiPowerShell:
.\glassworm-detect.ps1
if ($LASTEXITCODE -eq 0) {
Write-Host "System is clean"
} else {
Write-Host "Infections found - please review"
}-
Discovery Phase
- Checks for available VSCode installations using
command -v - Stores found installations for reporting
- Checks for available VSCode installations using
-
Scanning Phase
- For each VSCode installation, runs:
code --list-extensions --show-versions - Parses the output to extract extension IDs and version numbers
- Compares each installed extension against the malicious extensions database
- For each VSCode installation, runs:
-
Matching Phase
- Checks both the extension ID (publisher.name) and specific version number
- Only flags extensions that match BOTH the ID and a known malicious version
- Safe versions of the same extension are not flagged
-
Reporting Phase
- Displays all findings with clear visual indicators
- Warns if multiple VSCode installations are present
- Creates a timestamped log file for auditing
-
Remediation Phase (optional)
- Prompts user for each infected extension
- Executes
code --uninstall-extension <id>for confirmed removals - Reports success/failure of each uninstall operation
Each scan creates a log file named: glassworm-scan-YYYYMMDD-HHMMSS.log
The log contains:
- Scan timestamp
- User who ran the scan
- Computer name (PowerShell only)
- VSCode installations found
- List of infected extensions (if any)
========================================
Glassworm Extension Detection Tool
========================================
Checking Visual Studio Code...
β No infected extensions found
Checking Visual Studio Code Insiders...
β Visual Studio Code Insiders not found
Checking VSCodium...
β VSCodium not found
========================================
Summary
========================================
VSCode installations found: 1
β CLEAN: No infected extensions found!
Your system appears to be safe from Glassworm.
Scan log saved to: glassworm-scan-20251023-143052.log
========================================
Glassworm Extension Detection Tool
========================================
Checking Visual Studio Code...
β INFECTED: cline-ai-main.cline-ai-agent@3.1.3
========================================
Summary
========================================
VSCode installations found: 1
β INFECTED: Found 1 malicious extension(s)!
Infected extensions:
β’ cline-ai-main.cline-ai-agent@3.1.3 (in Visual Studio Code)
========================================
Uninstall Infected Extensions
========================================
Found: cline-ai-main.cline-ai-agent@3.1.3 in Visual Studio Code
Do you want to uninstall this extension? (y/n): y
Uninstalling cline-ai-main.cline-ai-agent@3.1.3 from Visual Studio Code...
β Successfully uninstalled cline-ai-main.cline-ai-agent
========================================
Recommended Next Steps
========================================
1. Review your system for suspicious activity
2. Change passwords for sensitive accounts
3. Run a full system security scan
4. Monitor for unusual network activity
5. Check browser extensions and other applications
Scan log saved to: glassworm-scan-20251023-143127.log
If the script detects infected extensions, you should:
- β Uninstall all infected extensions (script offers to do this)
- π Change passwords for:
- GitHub/GitLab accounts
- Cloud service providers (AWS, Azure, GCP)
- Email accounts
- Any credentials stored in your projects
- π Rotate API keys and tokens
- π Review recent activity in your repositories and cloud accounts
- π‘οΈ Run security scans:
- Full system antivirus scan
- Rootkit detection tools
- Network traffic monitoring
- π Check logs for:
- Unauthorized access attempts
- Unusual file modifications
- Suspicious network connections
- π Enable 2FA on all critical accounts if not already enabled
- πΎ Review backups - ensure they're not compromised
- π₯ Inform your team if working in a shared environment
- Version-specific detection: Only flags the exact malicious versions listed
- User scope only: Checks extensions for the current user only
- Installed versions only: Cannot detect extensions that were installed and removed
- System extensions: May not detect system-wide installed extensions
- Manual installation: Cannot detect manually installed extensions (not via marketplace)
If you discover additional compromised extensions or versions, please update the malicious extensions list:
In Bash script (glassworm-detect.sh):
MALICIOUS_EXTENSIONS["publisher.extension-name"]="version1 version2"In PowerShell script (glassworm-detect.ps1):
$MaliciousExtensions = @{
"publisher.extension-name" = @("version1", "version2")
}This script is provided as-is for security purposes. Feel free to use, modify, and distribute.
- Glassworm Attack Information
- VSCode Security Best Practices
- OpenVSX Registry
This tool is provided for detection and remediation purposes only. While it checks for known malicious extensions, it cannot guarantee complete protection or detect all potential threats. Always follow security best practices and consult with security professionals if you suspect your system has been compromised.
Last Updated: October 23, 2025 Script Version: 1.0.0