n8n: CVE-2025–68613
The n8n workflow expression evaluation system executes user-supplied JavaScript expressions without adequate sandboxing, allowing an authenticated attacker to escape the sandbox and run arbitrary system commands. This gives the attacker the ability to access sensitive environment variables, exfiltrate credentials, and fully compromise the host.
medium.com
Published on medium.com
Because n8n is frequently used to automate operational, security, and SaaS workflows, it often has access to sensitive credentials, API tokens, and internal systems. This makes vulnerabilities in its execution engine especially dangerous.
The full write-up lives on its author's site
It belongs to its author, so we link to it rather than copy it. The other two tabs are our own rewrites, checked against it.
Not written yet. The AI write-up for this write-up has not been written yet. The Original tab links to the source.
How it worked
Root cause
The expression evaluator lacks proper context isolation and sandboxing, allowing JavaScript code to escape and access dangerous runtime objects.
Impact
An authenticated attacker could execute arbitrary system commands, access sensitive environment variables, exfiltrate credentials, and fully compromise the host system.
What the attacker needed
Authenticated access to n8n; ability to create or edit workflows
The fix
The vulnerability was fixed in versions 1.120.4, 1.121.1, and 1.122.0, so upgrading to a patched version is essential.
How it was found
- Log in to n8n with any authenticated account, even a low-privileged one.
- Create or edit a workflow and insert a malicious JavaScript expression inside double curly braces.
- Use an immediately invoked function expression to encapsulate and execute arbitrary logic.
- Chain the expression with Node.js internals to run system commands with the n8n process's privileges.
Explained by bugbounty.wiki with AI from the original and checked against quotes from it; it can still be wrong. Read the original before relying on a detail.
Not written yet. The AI write-up for this write-up has not been written yet. The Original tab links to the source.
n8n is a tool that lets you connect apps and automate tasks by writing small bits of code called expressions. The problem is that these expressions were not properly isolated, so someone with a normal account could sneak in extra code that runs commands on the server. This means a low-level user could take over the whole system.
What is RCE?
Running the attacker's code on the target's servers: through command or code injection, unsafe deserialisation or template injection.