Detect n8n Improper Control of Dynamically-Managed Code Resources (CVE-2025-68613) in Splunk
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.
MITRE ATT&CK
- Tactic
- Execution Lateral Movement Impact
SPL Detection Query
index=* sourcetype IN ("sysmon", "linux:audit", "osquery:results", "crowdstrike:events:sensor")
(EventCode=1 OR EventID=1 OR event_simpleName=ProcessRollup2)
| eval parent_proc=coalesce(ParentImage, parent_process_name, TargetFileName)
| eval child_proc=coalesce(Image, process_name, FileName)
| eval cmdline=coalesce(CommandLine, process, cmdLine)
| where (match(parent_proc, "(?i)node(\.exe)?$") AND (
match(child_proc, "(?i)(sh|bash|dash|zsh|cmd\.exe|powershell\.exe|pwsh\.exe|python[23]?|wget|curl|ncat|nc|perl|ruby|mshta)") OR
match(cmdline, "(?i)(whoami|id\b|/etc/passwd|/etc/shadow|base64|chmod\s+[0-9]+|chown\s+root|net\s+user|net\s+localgroup|certutil|bitsadmin|curl\s+-o|wget\s+-O)")))
| eval risk_score=case(
match(child_proc, "(?i)(powershell|cmd\.exe|bash|sh)") AND match(cmdline, "(?i)(base64|encoded|iex|invoke-expression)"), 90,
match(child_proc, "(?i)(wget|curl)") AND match(cmdline, "(?i)(-o|-O|--output)"), 85,
match(cmdline, "(?i)(/etc/passwd|/etc/shadow)"), 95,
true(), 70)
| table _time, host, parent_proc, child_proc, cmdline, risk_score, user
| sort -risk_score
| eval alert="CVE-2025-68613: n8n Dynamic Code Execution Abuse"
| where risk_score >= 70 Detects suspicious process lineage from n8n Node.js processes that may indicate exploitation of CVE-2025-68613, filtering for high-risk child process spawning patterns.
Data Sources
Required Sourcetypes
False Positives & Tuning
- Legitimate n8n Execute Command nodes running authorized shell scripts
- n8n workflows that use Python or other scripting for data processing
- DevOps n8n pipelines that spawn build tools or deployment scripts
- Security automation workflows in n8n triggering remediation scripts
- n8n running in development mode with debugging tools attached
Other platforms for CVE-2025-68613
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.
- 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'
- 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
- 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
- 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.