CVE-2025-68613

n8n Improper Control of Dynamically-Managed Code Resources (CVE-2025-68613)

Execution Lateral Movement Impact Last updated:

Detects exploitation of CVE-2025-68613, a critical vulnerability in n8n workflow automation platform where improper control of dynamically-managed code resources (CWE-913) allows attackers to execute arbitrary code. This vulnerability is actively exploited in the wild (CISA KEV). Attackers can abuse n8n's Code node or expression evaluation engine to break out of intended sandboxing and execute arbitrary system commands on the underlying host.

Vulnerability Intelligence

KEV — Known Exploited

Affected Software

Vendor
n8n
Product
n8n

Weakness (CWE)

Timeline

Disclosed
March 11, 2026

CVSS

Unscored
Write-up coming soon

What is CVE-2025-68613 n8n Improper Control of Dynamically-Managed Code Resources (CVE-2025-68613)?

n8n Improper Control of Dynamically-Managed Code Resources (CVE-2025-68613) (CVE-2025-68613) maps to the Execution and Lateral Movement and Impact tactics — the adversary is trying to run malicious code in MITRE ATT&CK.

This page provides production-ready detection logic for n8n Improper Control of Dynamically-Managed Code Resources (CVE-2025-68613), covering the data sources and telemetry it touches: Microsoft Defender for Endpoint, Microsoft Sentinel. The queries below are rated critical severity at medium confidence, and ship for 7 SIEM platforms — KQL, SPL, Elastic, QRadar, Sumo, YARA-L, LogScale.

MITRE ATT&CK

Tactic
Execution Lateral Movement Impact
Microsoft Sentinel / Defender
kusto
let n8n_processes = DeviceProcessEvents
| where FileName in~ ("node", "node.exe") or ProcessCommandLine has "n8n"
| project DeviceId, DeviceName, Timestamp, ProcessId, FileName, ProcessCommandLine, InitiatingProcessFileName, InitiatingProcessCommandLine, AccountName;
let suspicious_children = DeviceProcessEvents
| where InitiatingProcessFileName in~ ("node", "node.exe")
| where FileName in~ ("sh", "bash", "cmd.exe", "powershell.exe", "python", "python3", "wget", "curl", "nc", "ncat", "perl", "ruby")
    or ProcessCommandLine has_any ("chmod", "chown", "/etc/passwd", "/etc/shadow", "base64", "whoami", "id", "net user", "net localgroup", "certutil", "bitsadmin")
| project DeviceId, DeviceName, Timestamp, ProcessId, FileName, ProcessCommandLine, InitiatingProcessId, InitiatingProcessFileName;
let n8n_network = DeviceNetworkEvents
| where InitiatingProcessFileName in~ ("node", "node.exe")
| where RemotePort !in (5678, 443, 80, 8080)
| where RemoteIPType != "Private"
| project DeviceId, DeviceName, Timestamp, RemoteIP, RemotePort, RemoteUrl, InitiatingProcessFileName, InitiatingProcessCommandLine;
let n8n_file_writes = DeviceFileEvents
| where InitiatingProcessFileName in~ ("node", "node.exe")
| where FolderPath has_any ("/tmp", "/var/tmp", "C:\\Windows\\Temp", "%TEMP%", "/dev/shm")
    or FileName has_any (".sh", ".ps1", ".bat", ".py", ".exe", ".elf")
| project DeviceId, DeviceName, Timestamp, FileName, FolderPath, InitiatingProcessFileName;
suspicious_children
| union (n8n_network | project DeviceId, DeviceName, Timestamp, ProcessId = 0, FileName = InitiatingProcessFileName, ProcessCommandLine = strcat(RemoteIP, ":", tostring(RemotePort)), InitiatingProcessId = 0, InitiatingProcessFileName)
| union (n8n_file_writes | project DeviceId, DeviceName, Timestamp, ProcessId = 0, FileName, ProcessCommandLine = FolderPath, InitiatingProcessId = 0, InitiatingProcessFileName)
| summarize EventCount = count(), FirstSeen = min(Timestamp), LastSeen = max(Timestamp), Commands = make_set(ProcessCommandLine, 20) by DeviceId, DeviceName, InitiatingProcessFileName
| where EventCount >= 1
| extend AlertTitle = "CVE-2025-68613: Potential n8n Code Execution Exploitation"
| project AlertTitle, DeviceName, DeviceId, FirstSeen, LastSeen, EventCount, Commands

Detects n8n workflow automation processes spawning suspicious child processes, writing files to temporary directories, or making unexpected outbound network connections indicative of CVE-2025-68613 exploitation.

critical severity medium confidence

Data Sources

Microsoft Defender for Endpoint Microsoft Sentinel

Required Tables

DeviceProcessEvents DeviceNetworkEvents DeviceFileEvents

False Positives

  • Legitimate n8n workflows that intentionally execute shell commands via the Execute Command node
  • n8n instances used for DevOps automation that spawn child processes as part of normal workflow execution
  • Security scanning tools that probe n8n API endpoints
  • Administrators testing n8n Code node functionality in development environments
  • n8n self-update mechanisms triggering process spawning

Sigma rule & cross-platform mapping

The detection logic for n8n Improper Control of Dynamically-Managed Code Resources (CVE-2025-68613) (CVE-2025-68613) above is provided in a vendor-neutral form so you can deploy it on any SIEM. The same logic is shipped here as native KQL (Microsoft Sentinel / Defender), SPL (Splunk), Elastic (Elastic Security (EQL)), QRadar (IBM QRadar (AQL)), Sumo (Sumo Logic CSE), YARA-L (Google Chronicle / SecOps), LogScale (CrowdStrike LogScale (CQL)) queries. In Sigma terms, this detection targets the following logsource:

logsource:
  category: process_creation
  product: windows

Browse the community-maintained Sigma rules for this technique:


Testing Methodology

Validate this detection against 4 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 available with Pro.

  1. Test 1n8n Code Node Shell Command Execution

    Expected signal: Sysmon Event ID 1 showing node process spawning sh or bash child process with command arguments containing 'id', 'whoami', 'hostname'

  2. Test 2n8n Expression Evaluator File Write to Temp Directory

    Expected signal: Sysmon Event ID 11 (FileCreate) showing node process creating a .sh file in /tmp, followed by Event ID 1 showing chmod +x execution

  3. Test 3n8n Code Node Reverse Shell Simulation (Netcat)

    Expected signal: Sysmon Event ID 1 showing node.js spawning nc/ncat process with -e flag and IP/port arguments; Sysmon Event ID 3 showing network connection from node process to 127.0.0.1:4444

  4. Test 4n8n Credential Exfiltration Simulation via HTTP

    Expected signal: Sysmon Event ID 1 showing node spawning bash then curl with base64-encoded data arguments; Sysmon Event ID 3 showing network connection from curl to external host on port 9999

Unlock Pro Content

Get the full detection package for CVE-2025-68613 including response playbook, investigation guide, and atomic red team tests.

Response PlaybookInvestigation GuideHunting QueriesAtomic Red Team TestsTuning Guidance

Related Detections