CVE-2026-27577 Overview
CVE-2026-27577 is a critical Code Injection vulnerability in n8n, an open source workflow automation platform. This vulnerability allows authenticated users with permission to create or modify workflows to abuse crafted expressions in workflow parameters, triggering unintended system command execution on the host running n8n. This issue follows previous expression evaluation exploits patched in CVE-2025-68613, indicating a continued attack surface in the expression parsing functionality.
Critical Impact
An authenticated attacker can execute arbitrary system commands on the n8n host server, potentially leading to complete system compromise, data exfiltration, lateral movement within the network, and persistent access to the workflow automation infrastructure.
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-27577 published to NVD
- 2026-02-25 - Last updated in NVD database
Technical Details for CVE-2026-27577
Vulnerability Analysis
This vulnerability is classified as CWE-94 (Improper Control of Generation of Code / Code Injection). The flaw resides in the expression evaluation mechanism within n8n's workflow engine. When users create or modify workflows, the platform processes dynamic expressions embedded in workflow parameters. The vulnerable code paths fail to properly sanitize user-controlled input before evaluating expressions, allowing injection of malicious payloads that escape the intended expression context.
The attack can be executed over the network by any authenticated user with workflow creation or modification permissions. The vulnerability requires no user interaction beyond the initial authentication, and successful exploitation impacts both the confidentiality and integrity of the host system, with potential for complete server compromise.
Root Cause
The root cause stems from insufficient input validation and sanitization in the expression evaluation pipeline. As evidenced by the security patches, multiple components were vulnerable:
Authentication bypass in ChatTrigger: The original code checked for authentication cookies after processing potentially dangerous operations, allowing the setup webhook to bypass authentication checks improperly.
Missing input sanitization: User-controlled values such as allowedFilesMimeTypes were passed directly to template rendering without sanitization, enabling injection attacks.
The patches show the n8n team addressed these by restructuring authentication checks to occur before any processing and adding explicit sanitizeUserInput() calls for user-controlled string values.
Attack Vector
The attack requires network access to an n8n instance where the attacker has authenticated credentials with workflow editing permissions. The attacker crafts a malicious expression within workflow parameters that, when evaluated by the n8n engine, breaks out of the expression sandbox and executes arbitrary system commands on the underlying host.
The low attack complexity combined with the lack of required user interaction makes this vulnerability particularly dangerous in multi-user n8n deployments where workflow permissions may be granted to users who should not have system-level access.
// Security patch in GenericFunctions.ts - Authentication bypass fix
// Source: https://github.com/n8n-io/n8n/commit/1479aab2d32fe0ee087f82b9038b1035c98be2f6
// BEFORE: Authentication check could be bypassed
const authCookie = getCookie('n8n-auth');
if (!authCookie && webhookName !== 'setup') {
// Data is not defined on node so can not authenticate
throw new ChatTriggerAuthorizationError(500, 'User not authenticated!');
}
// AFTER: Authentication enforced before processing
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) {
throw new ChatTriggerAuthorizationError(401, 'User not authenticated!');
}
}
// Security patch in templates.ts - Input sanitization fix
// Source: https://github.com/n8n-io/n8n/commit/9e5212ecbc5d2d4e6f340b636a5e84be6369882e
// BEFORE: Unsanitized user input
const sanitizedAllowedFilesMimeTypes = allowedFilesMimeTypes?.toString() ?? '';
// AFTER: Proper input sanitization applied
const sanitizedAllowedFilesMimeTypes = sanitizeUserInput(allowedFilesMimeTypes?.toString() ?? '');
Detection Methods for CVE-2026-27577
Indicators of Compromise
- Unexpected system processes spawned by the n8n application process
- Workflow definitions containing unusual expression syntax or shell command patterns
- Abnormal outbound network connections from the n8n host to unknown destinations
- Unexpected file system modifications in directories accessible to the n8n service account
Detection Strategies
- Monitor workflow creation and modification audit logs for expressions containing shell metacharacters, backticks, or command substitution patterns
- Implement runtime application security monitoring to detect process spawning from the n8n Node.js process
- Deploy file integrity monitoring on the n8n installation directories and system binaries
- Analyze n8n access logs for unusual workflow editing activity from unexpected IP addresses or user accounts
Monitoring Recommendations
- Enable verbose logging for n8n workflow execution to capture expression evaluation details
- Configure SIEM alerts for process execution events originating from the n8n application
- Monitor for new or modified workflow definitions through n8n's API or database
- Implement network segmentation monitoring to detect lateral movement attempts from the n8n host
How to Mitigate CVE-2026-27577
Immediate Actions Required
- Upgrade n8n immediately to version 2.10.1, 2.9.3, or 1.123.22 or later
- Audit all existing workflows for suspicious expressions or unauthorized modifications
- Review and restrict workflow creation and editing permissions to trusted users only
- Isolate n8n instances in hardened network segments with restricted egress
Patch Information
The n8n development team has released security patches addressing this vulnerability across multiple release branches. Users should upgrade to the following versions:
- Version 2.10.1 (latest stable branch)
- Version 2.9.3 (2.9.x branch)
- Version 1.123.22 (1.x branch for legacy deployments)
The patches are documented in the GitHub Security Advisory GHSA-v98v-ff95-f3cp and GHSA-vpcf-gvg4-6qwr. Technical details of the fixes can be found in the commit 1479aab and commit 9e5212e.
Workarounds
- Limit workflow creation and editing permissions to fully trusted users only through n8n's role-based access control
- Deploy n8n in a hardened container or VM with restricted operating system privileges
- Implement network access controls to limit outbound connectivity from the n8n host
- Run n8n with a least-privilege service account that has minimal system access
# Example: Restrict n8n service account permissions
# Create a dedicated user with minimal privileges
useradd -r -s /bin/false n8n-service
# Set restrictive file permissions on n8n directories
chown -R n8n-service:n8n-service /opt/n8n
chmod 750 /opt/n8n
# Run n8n with restricted capabilities (using systemd)
# Add to n8n.service unit file:
# [Service]
# User=n8n-service
# NoNewPrivileges=true
# ProtectSystem=strict
# ProtectHome=true
# PrivateTmp=true
Disclaimer: This content was generated using AI. While we strive for accuracy, please verify critical information with official sources.

