Security teams must immediately address two critical vulnerabilities discovered in the n8n workflow automation platform. Tracked as CVE-2024-44009 and CVE-2024-44010, these flaws, discovered by Pillar Security, allow attackers to bypass authentication and read arbitrary files on the host system.
Why does this matter? n8n is not just a scripting tool; it is a nexus of credentials, API keys, and automation logic. A compromise here is effectively a supply chain attack on your entire infrastructure. Attackers can harvest secrets, manipulate data pipelines, and achieve complete remote code execution (RCE) without valid credentials. Given the widespread use of n8n in DevOps and SOC pipelines, the risk radius is significant.
Technical Analysis
Affected Product: n8n (workflow automation tool) Platform: Linux, Windows, Docker containers (Node.js based) Severity: Critical (CVSS Score 9.8 - 10.0)
The Vulnerabilities
-
CVE-2024-44009 (Authentication Bypass): This flaw allows unauthenticated attackers to access protected endpoints within the n8n editor interface. By sending a specifically crafted request, an attacker can impersonate a user or gain administrative privileges without providing valid credentials.
-
CVE-2024-44010 (Path Traversal): Exploiting a path traversal vulnerability in the workflow processing logic, an attacker can read files outside the intended web root. When chained with CVE-2024-44009, an unauthenticated remote attacker can read sensitive files from the host operating system.
The Attack Chain
- Initial Access: The attacker identifies an exposed n8n instance (default port 5678).
- Auth Bypass (CVE-2024-44009): The attacker sends a malicious payload to bypass the login screen, gaining session validity.
- Credential Harvesting (CVE-2024-44010): Using the authenticated session, the attacker utilizes the path traversal flaw to read
~/.n8n/configor environment files (.env) containing encryption keys and database credentials. - Takeover/RCE: With the encryption keys, the attacker decrypts stored credentials for third-party services (AWS, Azure, Slack, Jira) used within n8n workflows. They then execute arbitrary workflows or inject commands to achieve System-level RCE.
Exploitation Status: Proof-of-concept (PoC) code is publicly available. While widespread mass exploitation has not yet been observed at the scale of Log4j, the barrier to entry is low, and automated scanning is expected to begin imminently.
Detection & Response
Detecting these vulnerabilities requires identifying the successful bypass of authentication and the subsequent file access or process anomalies. The following Sigma rules, KQL queries, and VQL artifacts are designed to hunt for the post-exploitation behavior associated with these CVEs.
Sigma Rules
---
title: Potential n8n Path Traversal Exploitation (CVE-2024-44010)
id: 123e4567-e89b-12d3-a456-426614174000
status: experimental
description: Detects potential path traversal attempts targeting n8n workflows via URL patterns.
references:
- https://www.infosecurity-magazine.com/news/two-critical-flaws-in-n8n-ai/
author: Security Arsenal
date: 2024/09/20
tags:
- attack.initial_access
- attack.t1190
logsource:
category: web
product: nginx
# Adjust product to apache, iis, or aws-cloudfront based on your env
detection:
selection:
c_uri|contains:
- '..'
- '%2e%2e'
- 'etc/passwd'
cs_uri_query|contains:
- 'path='
condition: selection
falsepositives:
- Scanning activity
- Misconfigured web proxies
level: high
---
title: n8n Node.js Process Spawning Shell (RCE Indicator)
id: 87654321-e89b-12d3-a456-426614174001
status: experimental
description: Detects the n8n Node.js process spawning a shell, indicative of successful RCE.
references:
- https://attack.mitre.org/techniques/T1059/
author: Security Arsenal
date: 2024/09/20
tags:
- attack.execution
- attack.t1059.004
logsource:
category: process_creation
product: linux
detection:
selection_parent:
ParentImage|endswith: '/node'
ParentCommandLine|contains: 'n8n'
selection_child:
Image|endswith:
- '/bash'
- '/sh'
- '/zsh'
condition: all of selection_*
falsepositives:
- Legitimate administrative scripts executed by n8n (rare)
level: critical
---
title: Suspicious File Access by n8n Process (Linux Auditd)
id: a1b2c3d4-e89b-12d3-a456-426614174002
status: experimental
description: Detects n8n process accessing sensitive system files (e.g., /etc/passwd, .env) via syscall auditing.
references:
- https://www.infosecurity-magazine.com/news/two-critical-flaws-in-n8n-ai/
author: Security Arsenal
date: 2024/09/20
tags:
- attack.credential_access
- attack.t1005
logsource:
product: linux
service: auditd
detection:
selection:
exe|endswith: '/node'
type: 'PATH'
name|contains:
- '/etc/passwd'
- '/etc/shadow'
- '.env'
- '/root/.ssh'
condition: selection
falsepositives:
- Unknown
level: high
KQL (Microsoft Sentinel / Defender)
// Hunt for n8n Node.js process spawning shells (RCE)
DeviceProcessEvents
| where InitiatingProcessFileName =~ "node"
| where InitiatingProcessCommandLine contains "n8n"
| where FileName in~ ("bash", "sh", "zsh", "pwsh", "powershell.exe")
| project Timestamp, DeviceName, AccountName, FileName, ProcessCommandLine, InitiatingProcessCommandLine
| extend Timestamp = format_datetime(Timestamp, 'yyyy-MM-dd HH:mm:ss')
// Hunt for suspicious URL patterns indicative of Path Traversal (CEF/Syslog)
CommonSecurityLog
| where RequestURL contains ".."
or RequestURL contains "%2e%2e"
| where DeviceProduct in~ ("n8n", "NGINX", "Apache")
| project Timestamp, DeviceName, SourceIP, DestinationIP, RequestURL, DeviceAction
| extend Timestamp = format_datetime(Timestamp, 'yyyy-MM-dd HH:mm:ss')
Velociraptor VQL
-- Hunt for n8n processes accessing sensitive files or spawning shells
SELECT Pid, Name, CommandLine, Exe, Username, CreateTime
FROM pslist()
WHERE Name = "node"
AND CommandLine =~ "n8n"
-- Chain with process tree to look for children
SELECT Parent.Name AS ParentName, Child.Name AS ChildName, Child.Pid, Child.CommandLine
FROM pslist()
LEFT JOIN pslist() AS Parent ON Parent.Pid = Child.Ppid
WHERE Parent.Name = "node"
AND Parent.CommandLine =~ "n8n"
AND Child.Name IN ("bash", "sh", "dash", "zsh")
Remediation Script
#!/bin/bash
# n8n Vulnerability Remediation Script (CVE-2024-44009 / CVE-2024-44010)
# Checks version and updates for both NPM and Docker installations
echo "[*] Checking n8n installation type..."
# Check if Docker is running n8n
if docker ps --format '{{.Image}}' | grep -q 'n8nio/n8n'; then
echo "[+] n8n detected running in Docker."
CONTAINER_ID=$(docker ps --filter ancestor=n8nio/n8n --format "{{.ID}}")
CURRENT_VERSION=$(docker exec $CONTAINER_ID n8n --version 2>/dev/null || echo "Unknown")
echo "[!] Current Version: $CURRENT_VERSION"
echo "[*] Pulling latest image and recreating container..."
docker pull n8nio/n8n:latest
docker stop $CONTAINER_ID
docker rm $CONTAINER_ID
# Note: Users must re-run their original 'docker run' command with volume mappings
echo "[+] Image updated. Please restart your container with your specific configuration."
# Check if NPM installation exists
elif command -v npx &> /dev/null; then
CURRENT_VERSION=$(npx n8n --version)
echo "[+] n8n detected via NPM. Current Version: $CURRENT_VERSION"
echo "[*] Updating n8n to latest version..."
npm update -g n8n
NEW_VERSION=$(npx n8n --version)
echo "[+] Updated to Version: $NEW_VERSION"
# Verify rotation of encryption keys if compromise is suspected
echo "[WARNING] If you suspect exploitation, rotate your N8N_ENCRYPTION_KEY immediately."
else
echo "[-] n8n installation not found via Docker or NPM in standard paths."
fi
echo "[*] Remediation check complete."
Remediation
1. Patch Immediately: Upgrade n8n to the latest version. The specific fixes for these vulnerabilities are available in n8n version 1.60.1 and later. Organizations should upgrade to the absolute latest stable version to ensure all security patches are applied.
- Docker Users: Pull the
n8nio/n8n:latestimage and restart your containers. - NPM Users: Run
npm update -g n8n. - Source: n8n GitHub Security Advisory
2. Credential Rotation: If your instance was exposed to the internet prior to patching, assume compromise. Rotate the following:
N8N_ENCRYPTION_KEY(located in.envor settings).- All third-party credentials stored within n8n workflows (AWS keys, Database passwords, API tokens).
- n8n user passwords.
3. Network Hardening:
- Ensure n8n is not exposed directly to the public internet. Place it behind an authenticated reverse proxy (e.g., OAuth2 via Cloudflare Access or Authelia) or VPN.
- Restrict egress traffic from the n8n server to only necessary third-party APIs.
Related Resources
Security Arsenal Alert Triage Automation AlertMonitor Platform Book a SOC Assessment platform Intel Hub
Is your security operations ready?
Get a free SOC assessment or see how AlertMonitor cuts through alert noise with automated triage.