Executive brief
n8n is a workflow automation platform that allows users to build and execute automation scripts using expressions. A flaw in the expression compiler's sandbox allows an attacker with expression authoring permissions to execute arbitrary code in the n8n process (on the backend) or in the browser session of any user who opens a malicious workflow (in the editor). An attacker can exploit this by rebinding a class field named `__sanitize` to bypass the security sanitizer and access the Function constructor.
Technical details
The vulnerability is a code injection flaw (CWE-94) in n8n's expression compiler. The compiler's sanitizer is resolved through a dynamically-scoped `this` context, which allows an attacker to rebind it by creating a class field named `__sanitize`. By rebinding the sanitizer, an attacker can reach the underlying `Function` constructor and execute arbitrary JavaScript code. On the backend, any user with expression authoring permissions can execute code within the n8n process itself; in the editor preview, the malicious expression runs as JavaScript in the session of whoever opens the workflow, potentially compromising other users. The attack requires workflow creation/edit permissions. The fix rejects reserved class-member names. Patches are available in versions 1.123.76, 2.37.7, and 2.38.2.
Affected products
- n8n n8n all versions before 1.123.76, versions 2.0.0 to 2.37.6, versions 2.38.0 to 2.38.1
Timeline
- 2026-09-02: disclosed
- 2026-09-10: advisory
- 2026-09-02: patched: patches released for versions 1.123.76, 2.37.7, and 2.38.2