CVE-2026-25931
Product: VSCode Code Spell Checker Extension
Vulnerability Type: Workspace Trust Bypass → Remote Code Execution (RCE)
CVSS v3.1: 7.8 (High)
Severity: High
Attack Vector: Local (malicious workspace opened by user)
Privileges Required: None
User Interaction: Required
Impact: Arbitrary code execution with user privileges
Explediation Complexity: Low once workspace is opened
Exploit Availability: No widespread public exploit kit observed; proof-of-concept techniques discussed in research communities for educational validation
Affected Versions: All versions prior to 4.5.4
Fixed Version: 4.5.4 and later
Executive Summary
A high-severity vulnerability was identified in the VSCode Code Spell Checker extension where workspace trust controls were not properly enforced. Under specific conditions, JavaScript or TypeScript configuration files placed inside a workspace could be executed even if the workspace itself was not trusted by VSCode.
This resulted in arbitrary code execution within the extension host process, operating under the permissions of the logged-in user. The issue was caused by reliance on an extension-level trust configuration flag rather than enforcing VSCode’s native workspace trust model.
If a developer opened a malicious repository or project folder containing a crafted .cspell.config.js (or related format), code execution could occur automatically when the extension loaded configuration settings.
The issue was resolved in version 4.5.4 by aligning trust validation with VSCode’s official workspace trust mechanism.
Technical Details
The extension supports configuration through JavaScript-based files such as:
.cspell.config.js.cspell.config.cjs.cspell.config.mjs.cspell.config.ts
These formats allow dynamic configuration logic. However, because they are executable formats, they are interpreted through Node.js within the extension host.
The vulnerability occurred because:
- The extension relied on
cSpell.trustedWorkspace - That setting defaulted to a permissive state
- VSCode’s native workspace trust status was not strictly enforced
- Executable configuration files were processed even when workspace trust was not fully validated
As a result, arbitrary JavaScript embedded inside configuration files could execute during extension activation or configuration parsing.
Execution occurred in the extension host process (node runtime inside VSCode), meaning:
- File system access was available
- Network access was available
- Environment variables were accessible
- User credentials/tokens stored locally could be accessed
- Additional processes could be spawned
No sandbox isolation protected against malicious configuration logic.
Root Cause Analysis
The issue stemmed from improper trust boundary enforcement:
- Trust decision was delegated to a configuration flag.
- That flag defaulted to a trusted state.
- Workspace origin was not validated before loading executable configuration.
- Executable configuration formats were treated equivalently to static JSON.
This created a condition where untrusted input controlled execution flow.
The vulnerability aligns with the following weaknesses:
- Incorrect default permissions
- Reliance on untrusted inputs for security decisions
- Inclusion of functionality from untrusted control sphere
Exploitation Scenario (Educational)
The following describes the conceptual exploitation flow strictly for defensive understanding:
- An attacker creates a malicious repository.
- Inside the repository, a
.cspell.config.jsfile is placed. - The file contains JavaScript logic executed when parsed.
- The repository is shared publicly or sent to a target.
- The target opens the workspace in VSCode.
- The extension loads the configuration file.
- The JavaScript executes automatically.
Potential post-execution actions (examples only for defensive awareness):
- Reading SSH keys
- Accessing
.envfiles - Exfiltrating tokens
- Spawning background processes
- Establishing outbound network connections
No authentication bypass was required. No additional privileges were required beyond user interaction.
Proof of Concept (Educational)
For safe lab validation:
- Create an isolated virtual machine.
- Install a vulnerable version (< 4.5.4).
- Create a test workspace.
- Add a
.cspell.config.jsfile with harmless logging logic (e.g., console output only). - Open the workspace.
If the extension loads and executes the file without verifying trust state, the behavior can be observed in extension logs.
No destructive payloads should ever be used. Only inert test logic is recommended.
Indicators of Compromise
Indicators may include:
- Unexpected
.cspell.config.*files in project roots - VSCode spawning unexpected child processes
- Node processes initiated by
code.exeorCode - Unexpected outbound connections from developer systems
- Sudden access to credential stores during VSCode activity
- Modified workspace settings enabling trust flags
Detection Strategy
Detection should focus on behavior rather than configuration alone.
Log Sources
- Endpoint Detection and Response (EDR)
- Windows Event Logs (4688 – Process Creation)
- Sysmon (Event ID 1, 3, 11)
- Linux auditd
- macOS Unified Logs
- VSCode extension logs
- Network proxy/firewall logs
Detection Rules – Process Execution (Windows)
Suspicious VSCode Child Process Execution
index=windows EventCode=4688
| where ParentProcessName="code.exe"
| where NewProcessName IN ("cmd.exe","powershell.exe","wscript.exe","cscript.exe","node.exe","bash.exe")
Sysmon – VSCode Spawning Node or Shell
index=sysmon EventID=1
| where ParentImage LIKE "%code.exe"
| where Image LIKE "%node.exe" OR Image LIKE "%cmd.exe" OR Image LIKE "%powershell.exe"
Detection Rules – File Monitoring
Creation of Executable CSpell Config Files
index=sysmon EventID=11
| where TargetFilename LIKE "%\.cspell\.config\.js"
OR TargetFilename LIKE "%\.cspell\.config\.mjs"
OR TargetFilename LIKE "%\.cspell\.config\.ts"
Detection Rules – Elastic Query DSL
VSCode Executing Node from Workspace
{
"query": {
"bool": {
"must": [
{ "match": { "process.parent.name": "code.exe" }},
{ "match": { "process.name": "node.exe" }}
]
}
}
}
Detection Rules – Linux Auditd
auditctl -w /home -p wa -k cspell_config_watch
ausearch -k cspell_config_watch | grep cspell.config
Threat Hunting Guidance
Hunt for:
- Developer machines connecting to unfamiliar domains shortly after VSCode launch.
- VSCode spawning network utilities.
- Unusual modification times on configuration files.
- Encoded or obfuscated JavaScript inside configuration files.
- Repositories containing executable configuration in otherwise simple projects.
Risk Assessment
Impact is considered high because:
- Code execution occurs under developer context.
- Developers often have access to:
- Cloud credentials
- Source code repositories
- SSH private keys
- CI/CD tokens
- Lateral movement risk is significant in enterprise environments.
Attack complexity remains low once the workspace is opened.
User interaction is the only barrier.
Mitigation
Immediate actions recommended:
- Upgrade extension to version 4.5.4 or later
- Enforce VSCode Workspace Trust policies
- Restrict extension installation in enterprise environments
- Disable JavaScript-based config parsing where possible
- Implement EDR alerting for VSCode child processes
- Educate developers not to open untrusted repositories
Incident Response Considerations
If exploitation is suspected:
- Isolate the endpoint
- Capture memory and process tree
- Review VSCode extension logs
- Inspect recently opened repositories
- Rotate SSH keys and API tokens
- Review outbound network logs
- Check for persistence mechanisms
Because execution occurs under user privileges, full credential rotation is strongly advised.
Patch Information
The vulnerability was fixed in version 4.5.4 of the extension.
Official patch release:
https://github.com/streetsidesoftware/vscode-spell-checker/releases/tag/code-spell-checker-v4.5.4
All installations running earlier versions should be updated immediately.
Final Takeaway
CVE-2026-25931 represents a classic trust boundary failure within a developer tooling extension. While it requires user interaction, exploitation can result in full user-level code execution with significant downstream risk.
The issue highlights the broader risk of executable configuration files in development environments and reinforces the importance of strict workspace trust enforcement, extension management policies, and endpoint monitoring.
Proper patching, monitoring, and developer awareness reduce exposure significantly.
