Jul 22, 2026·5 min read·20 visits
Unsandboxed iframe and sanitizer bypass in n8n's HTML preview allow low-privileged users to execute arbitrary JavaScript in the victim's session context, leading to session hijacking.
A critical DOM-based Cross-Site Scripting (XSS) vulnerability exists in n8n's workflow editor HTML preview component. By failing to include a sandbox attribute on the iframe used to display node execution output, n8n allowed rendered execution outputs to run arbitrary JavaScript within the same-origin context of the editor parent window. This vulnerability can be exploited by an attacker with low-privileged ('global:member') access to hijack an authenticated administrator's session and perform unauthorized API actions.
n8n is an extensible workflow automation platform that allows users to build complex integrations and data processing pipelines. A key feature of the n8n workflow editor is the ability to view the execution output of specific nodes in an HTML format directly within the user interface. This feature is intended to display rich representations of HTTP responses, parsed data, or custom code outputs.\n\nThe HTML preview functionality is implemented on the frontend to present content to the user in a styled layout. To prevent the rendered output's styling and structure from interfering with the parent application's layout, n8n developers embedded the output within an HTML iframe element. This design choice, however, introduced a significant security boundary that was not properly restricted.\n\nBecause the iframe is populated dynamically using the 'srcdoc' attribute, it inherits the origin of the parent page. Without proper sandboxing or strict execution controls, any active content within the iframe runs in the same origin as the n8n editor, creating an avenue for DOM-based Cross-Site Scripting (XSS).
The underlying vulnerability stems from the omission of the 'sandbox' attribute on the iframe container used to render the preview. In modern web browsers, iframes loaded via the 'srcdoc' attribute inherit the origin of their parent document unless they are explicitly restricted. This default browser behavior means that the iframe and the parent editor window share the same execution origin, enabling full DOM access across the boundary.\n\nWhile n8n attempted to neutralize malicious content by running user-supplied HTML through a client-side sanitizer, this defense proved insufficient. Client-side sanitizers are notoriously susceptible to parser-differential and mutation-based XSS (mXSS) bypasses. When a sanitizer fails to recognize a specific nested or malformed HTML construct, the browser's parser reconstructs the document into an active executable format during DOM insertion.\n\nOnce a payload successfully bypasses the sanitizer filter, it is written into the iframe's 'srcdoc' attribute. Because the iframe runs under the same-origin policy as the n8n interface, the script can seamlessly access the 'window.parent' object, bypassing any attempt to isolate the preview environment.
Analyzing the DOM structure reveals how the vulnerability manifests in the browser. In vulnerable versions of n8n, the preview panel renders the HTML content using a standard iframe tag without restriction:\n\nhtml\n<!-- Vulnerable Implementation -->\n<iframe srcdoc=\"<div>User-controlled content here</div>\"></iframe>\n\n\nTo remediate this, the iframe must be explicitly sandboxed to restrict script execution, form submission, and origin sharing. The patch introduces the 'sandbox' attribute to ensure that the iframe content is treated as having a unique, opaque origin, preventing it from interacting with the parent window:\n\nhtml\n<!-- Patched Implementation -->\n<iframe sandbox=\"allow-popups\" srcdoc=\"<div>User-controlled content here</div>\"></iframe>\n\n\nThe following diagram illustrates the interaction between the parent editor and the unsandboxed iframe:\n\nmermaid\ngraph LR\n Parent[\"n8n Editor Parent Window\"] -->|Injects output into srcdoc| Iframe[\"Unsandboxed Iframe\"]\n Iframe -->|Bypasses sanitizer| Script[\"Malicious Script Execution\"]\n Script -->|window.parent Access| Parent\n Parent -->|Steals session data| Attacker[\"Attacker Server\"]\n
To exploit this vulnerability, an attacker must first obtain 'global:member' privileges within the n8n application. This level of access allows the attacker to create or modify workflows, specifically configuring a node (such as an HTTP Request or Code node) that generates a custom execution output containing a crafted payload.\n\nOnce the malicious workflow is configured, the attacker triggers an execution or waits for a victim with administrative privileges to view the workflow run. When the victim opens the HTML preview panel for the affected node, the frontend retrieves the execution output, sanitizes it using the vulnerable client-side routine, and inserts it into the iframe.\n\nIf the payload leverages a parser-differential bypass, it executes within the iframe. Because the iframe is same-origin, the script accesses 'window.parent.localStorage' or cookies to retrieve the active session token. It then utilizes the 'fetch' API or 'navigator.sendBeacon' to transmit the credentials to an attacker-controlled listener, completing the session hijacking process.
The security consequences of CVE-2026-65597 are critical due to the privileged context in which n8n editors operate. Since n8n is an automation platform, the web interface typically has access to integrated database credentials, API keys, and third-party authentication tokens stored within the workspace.\n\nA successful session hijacking attack allows the adversary to impersonate the victim administrator entirely. The attacker can read sensitive workflow definitions, extract API credentials from the system configuration, or modify active workflows to execute arbitrary commands on the hosting server.\n\nThis vulnerability has been assigned a CVSS v4.0 score of 8.2 (High). The high impact on confidentiality and integrity, combined with the lack of system-level restrictions on same-origin iframe execution, makes it a severe vector for privilege escalation within the n8n ecosystem.
The primary remediation for CVE-2026-65597 is updating the n8n installation to a secure release. The vendors have backported the fix to multiple release branches to ensure coverage for various deployment environments.\n\n> [!IMPORTANT]\n> Users on the 1.x branch must upgrade to version 1.123.64 or higher. Users on the 2.x branch must upgrade to version 2.29.8 or 2.30.1 depending on their current release track.\n\nIf immediate patching is not feasible, organizations should restrict member-level access ('global:member') to trusted personnel only. Additionally, administrators should avoid inspecting HTML previews of executions derived from untrusted external sources, such as public webhooks or unverified HTTP responses, until the software is updated.
CVSS:4.0/AV:N/AC:L/AT:N/PR:L/UI:A/VC:H/VI:L/VA:N/SC:H/SI:L/SA:N| Product | Affected Versions | Fixed Version |
|---|---|---|
n8n n8n-io | < 1.123.64 | 1.123.64 |
n8n n8n-io | 2.x < 2.29.8 | 2.29.8 |
n8n n8n-io | < 2.30.1 | 2.30.1 |
| Attribute | Detail |
|---|---|
| CWE ID | CWE-79 |
| Attack Vector | Network (AV:N) |
| CVSS Score | 8.2 (High) |
| Privileges Required | Low (PR:L) |
| User Interaction | Required (UI:A) |
| Exploit Status | Proof-of-Concept / Conceptual |
| CISA KEV Status | Not Listed |
The application does not neutralize or incorrectly neutralizes user-controlled input before it is placed in active content (HTML, JavaScript), allowing code execution.
An LDAP injection vulnerability exists in the centraldogma-server-auth-shiro module of LY Corporation Central Dogma before version 0.84.0. The search logic dynamically constructs LDAP search filters by interpolating user-provided usernames without escaping RFC 4515 metacharacters. Unauthenticated remote attackers can leverage this flaw to bypass authentication, enumerate directory hierarchies, and access unauthorized resources.
CVE-2026-11746 is a critical vulnerability in Central Dogma Server prior to version 0.84.0, where an embedded ZooKeeper replication secret silently falls back to a publicly known, hard-coded default string ('ch4n63m3'). Remote attackers with access to the replication network can authenticate as legitimate cluster peers, potentially leading to unauthorized data exposure, state manipulation, or complete cluster takeover.
A logical verification flaw in ZITADEL's external JWT Identity Provider validation allows attackers to bypass session expiration checks. If an incoming JWT lacks the 'exp' claim, the system skips validation entirely, creating an indefinitely valid session. This issue has been addressed in versions 3.4.12 and 4.15.2.
CVE-2026-59149 identifies a directory traversal vulnerability in `@mockoon/commons-server`, the backend mock-server library powering the Mockoon application. The flaw occurs in the path containment validation logic used during raw file response generation. An unauthenticated attacker can exploit this weakness to retrieve arbitrary files from sibling directories sharing a common prefix with the designated static base directory.
An in-depth analysis of CVE-2026-59148, a high-severity flaw in Mockoon where unauthenticated administrative endpoints and a wildcard Cross-Origin Resource Sharing (CORS) policy allow remote execution, state poisoning, and credential theft.
An improper authentication vulnerability (CWE-287) in ZITADEL's external identity provider handler before version 4.15.3 allows remote attackers to perform complete account takeover. When auto-linking by email is enabled, ZITADEL verifies that the local target account has a verified email address but fails to verify if the external provider confirmed ownership of that same email. Attackers can exploit this by registering an unverified account with a victim's email address on a permissive external provider, leading to unauthorized account binding and persistent access.