Breaking n8n's Expression Sandbox into RCE (CVE-2026-27577) with striga.ai
The n8n expression sandbox's PrototypeSanitizer only blocks direct Identifier references to dangerous base classes like Function, so a CallExpression that returns Function at runtime bypasses it. Separately, node names are interpolated into expression strings without escaping, allowing an authenticated workflow editor to inject JavaScript and achieve remote code execution.
striga.ai
Published on striga.ai
n8n is one of the most popular open-source workflow automation platforms with over 230,000 active users and nearly 200 million Docker pulls. One of its core features is an expression engine that lets users embed JavaScript snippets in workflow node fields, a powerful capability that demands robust sandboxing.
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
Likely the sandbox validator only matched Identifier AST nodes for blocked classes and did not resolve CallExpression results, while node names were interpolated into expression templates without escaping.
Impact
Any authenticated user with workflow editing permissions could execute arbitrary commands on the server, access environment variables and stored credentials, and pivot to internal networks; the text states both vulnerabilities have been patched.
What the attacker needed
Authenticated user; workflow editing permissions
The fix
Both vulnerabilities were patched by the n8n team in the release published on 25 Feb 2026, and self-hosted users should update.
How it was found
- Create a workflow with a Form Trigger connected to a Form node named 'Form Page 2'.
- Set the Form Trigger's responseMode to lastNode.
- Rename the Form Trigger node to a crafted string that breaks out of the string context and injects the sandbox bypass.
- When the workflow executes, the expression engine evaluates the injected code and runs the reverse shell payload.
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 lets users write small JavaScript snippets in workflow fields, and it tries to stop them from doing anything dangerous by inspecting the code's structure. The check only looked for one specific way of writing a reference to a powerful built-in function, so a slightly different way of writing the same thing slipped through. Separately, user-chosen node names were pasted into code without escaping, letting a crafted name break out and run commands on the server.
What is RCE?
Running the attacker's code on the target's servers: through command or code injection, unsafe deserialisation or template injection.