CVE-2026-27578 Overview
CVE-2026-27578 is a stored Cross-Site Scripting (XSS) vulnerability in n8n, an open source workflow automation platform. An authenticated user with permission to create or modify workflows can inject arbitrary scripts into pages rendered by the n8n application using multiple injection vectors across various nodes including Form Trigger, Chat Trigger, Send & Wait, Webhook, and Chat nodes. The injected scripts execute in the browser context of any user who visits the affected page, enabling session hijacking and account takeover.
Critical Impact
Authenticated attackers can inject malicious scripts that execute in other users' browsers, leading to session hijacking, credential theft, and complete account takeover across the n8n platform.
Affected Products
- n8n versions prior to 2.10.1
- n8n versions prior to 2.9.3
- n8n versions prior to 1.123.22
Discovery Timeline
- 2026-02-25 - CVE-2026-27578 published to NVD
- 2026-02-25 - Last updated in NVD database
Technical Details for CVE-2026-27578
Vulnerability Analysis
This vulnerability is classified as CWE-79 (Improper Neutralization of Input During Web Page Generation), commonly known as Cross-Site Scripting. The n8n workflow automation platform failed to properly sanitize user-controlled input across multiple node types before rendering content in web pages. When authenticated users with workflow creation or modification permissions configure specific nodes, their input is passed directly to the rendered HTML output without adequate sanitization, allowing JavaScript code to execute in the context of other users' browser sessions.
The vulnerability affects multiple attack surfaces within n8n: the Form Trigger node, Chat Trigger node, Send & Wait node, Webhook Node, and Chat Node. Each of these nodes processes user input that eventually gets rendered in the browser, making them susceptible to XSS payload injection.
Root Cause
The root cause of this vulnerability lies in insufficient input sanitization across multiple n8n node components. Specifically, the allowedFilesMimeTypes parameter and other user-controlled inputs were passed directly to template rendering without proper sanitization. The fix implemented in the security patches applies sanitizeUserInput() to these values before they are included in the generated HTML output.
Additionally, the Chat Trigger authentication logic had a flaw where cookie validation could be bypassed during the setup webhook phase, potentially allowing unauthorized access to sensitive functionality.
Attack Vector
An attacker with authenticated access to the n8n platform and workflow creation/modification permissions can exploit this vulnerability through the following attack flow:
- The attacker creates or modifies a workflow containing a vulnerable node (Form Trigger, Chat Trigger, Send & Wait, Webhook, or Chat Node)
- The attacker injects malicious JavaScript payload into a node configuration field that accepts user input
- When another user (including administrators) visits a page that renders the compromised workflow component, the malicious script executes in their browser
- The script can steal session cookies, perform actions on behalf of the victim, or redirect users to phishing pages
// Vulnerable code (before patch) - templates.ts
// User input was passed directly without sanitization
const sanitizedShowWelcomeScreen = !!showWelcomeScreen;
const sanitizedAllowFileUploads = !!allowFileUploads;
-const sanitizedAllowedFilesMimeTypes = allowedFilesMimeTypes?.toString() ?? '';
+const sanitizedAllowedFilesMimeTypes = sanitizeUserInput(allowedFilesMimeTypes?.toString() ?? '');
const sanitizedCustomCss = sanitizeHtml(`<style>${customCss?.toString() ?? ''}</style>`, {
allowedTags: ['style'],
allowedAttributes: false,
Source: GitHub Commit
// Authentication bypass fix - GenericFunctions.ts
// Before: Cookie validation could be skipped during setup
} else if (authentication === 'n8nUserAuth') {
const webhookName = context.getWebhookName();
+ if (webhookName !== 'setup') {
function getCookie(name: string) {
const value = `; ${headers.cookie}`;
const parts = value.split(`; ${name}=`);
if (parts.length === 2) {
return parts.pop()?.split(';').shift();
}
return '';
}
const authCookie = getCookie('n8n-auth');
- if (!authCookie && webhookName !== 'setup') {
- throw new ChatTriggerAuthorizationError(500, 'User not authenticated!');
+ if (!authCookie) {
+ throw new ChatTriggerAuthorizationError(401, 'User not authenticated!');
}
+ }
Source: GitHub Commit
Detection Methods for CVE-2026-27578
Indicators of Compromise
- Unusual JavaScript patterns in workflow node configurations, particularly in Form Trigger, Chat Trigger, Send & Wait, Webhook, or Chat nodes
- Workflow modifications containing script tags, event handlers (onclick, onerror, onload), or encoded JavaScript payloads
- Unexpected outbound network requests from user browsers when interacting with n8n workflows
- Session token exfiltration attempts visible in network traffic logs
Detection Strategies
- Review n8n workflow configurations for suspicious script content in node parameters, especially allowedFilesMimeTypes and custom CSS fields
- Monitor browser console output for unexpected JavaScript execution when loading n8n pages
- Implement Content Security Policy (CSP) headers to detect and block inline script execution attempts
- Audit workflow change logs for modifications by users who shouldn't have elevated permissions
Monitoring Recommendations
- Enable detailed logging for workflow creation and modification events in n8n
- Monitor for unusual patterns in authenticated user behavior, particularly bulk workflow modifications
- Set up alerts for session anomalies that could indicate session hijacking following XSS exploitation
- Review web server access logs for unusual patterns in webhook endpoint access
How to Mitigate CVE-2026-27578
Immediate Actions Required
- Upgrade n8n to version 2.10.1, 2.9.3, or 1.123.22 or later immediately
- Review all existing workflows for potential malicious script injections in vulnerable node types
- Audit user permissions and restrict workflow creation/editing to fully trusted users only
- Consider temporarily disabling the Webhook node if immediate upgrade is not possible
Patch Information
n8n has released security patches addressing this vulnerability. Users should upgrade to one of the following patched versions:
- n8n version 2.10.1 or later
- n8n version 2.9.3 or later (for 2.9.x branch)
- n8n version 1.123.22 or later (for 1.x branch)
The patches implement proper input sanitization using sanitizeUserInput() for user-controlled parameters and fix authentication logic in the Chat Trigger node. For detailed technical information, refer to the GitHub Security Advisory GHSA-2p9h-rqjw-gm92.
Workarounds
- Limit workflow creation and editing permissions to fully trusted users only by reviewing n8n's role-based access control settings
- Disable the Webhook node by adding n8n-nodes-base.webhook to the NODES_EXCLUDE environment variable as a temporary measure
- Implement Content Security Policy headers to mitigate the impact of XSS attacks
- Monitor and audit all existing workflows created by untrusted users for malicious content
# Temporary workaround: Disable vulnerable Webhook node
# Add to n8n environment configuration
export NODES_EXCLUDE="n8n-nodes-base.webhook"
# Restart n8n service to apply the change
systemctl restart n8n
Disclaimer: This content was generated using AI. While we strive for accuracy, please verify critical information with official sources.

