CVE-2026-54311 Overview
CVE-2026-54311 affects n8n, an open source workflow automation platform. The vulnerability allows an authenticated user with workflow creation or modification rights to pollute the sandbox used by the Merge node's SQL Query mode. The sandbox context is cached and reused across all workflow executions on the instance, so prototype mutations persist into Merge SQL executions belonging to other users or projects. A low-privileged attacker can intercept workflow data processed by other tenants on the same instance. The flaw is tracked under CWE-488: Exposure of Data Element to Wrong Session. Versions prior to 2.25.7 and 2.26.2 are affected.
Critical Impact
A low-privileged authenticated user on a shared n8n instance can pollute a cached JavaScript sandbox and intercept workflow data from other users or projects.
Affected Products
- n8n versions prior to 2.25.7
- n8n versions prior to 2.26.2
- Multi-user n8n instances where multiple users can author and execute workflows using the Merge node in SQL Query mode
Discovery Timeline
- 2026-06-23 - CVE-2026-54311 published to NVD
- 2026-06-23 - Last updated in NVD database
Technical Details for CVE-2026-54311
Vulnerability Analysis
The vulnerability resides in the Merge node's SQL Query mode, which evaluates user-supplied SQL expressions inside a JavaScript sandbox. The sandbox context object is constructed once and cached for reuse across subsequent executions on the same instance. This caching pattern is the root of the issue cataloged under CWE-488, where data from one session leaks into another.
When one workflow mutates a prototype reachable from the cached sandbox, those mutations remain in memory. Every later Merge SQL execution observes the polluted prototype chain, including workflows owned by unrelated users or projects. The attacker does not need to break out of the sandbox. They only need to modify shared object prototypes used by downstream SQL evaluations.
Because Merge SQL operations process workflow data, the polluted prototypes can be used to read or rewrite values flowing through other tenants' workflows. This converts a single low-privileged session into a passive interception channel across the instance.
Root Cause
The Merge node reused a single sandbox context across executions instead of creating a fresh, isolated context per run. Because JavaScript object prototypes are mutable and shared by reference, any prototype change made by one workflow persisted for every later Merge SQL execution.
Attack Vector
An attacker authenticates to a multi-user n8n instance with permission to create workflows. They build a workflow that uses the Merge node in SQL Query mode and supplies JavaScript that mutates a prototype reachable from the sandbox context. After execution, the cached sandbox carries the mutation. Subsequent Merge SQL executions by other users invoke the polluted prototype, exposing their workflow data to the attacker-controlled logic. Full technical details are available in the n8n GitHub Security Advisory GHSA-9c38-2mcm-q7f7.
Detection Methods for CVE-2026-54311
Indicators of Compromise
- Workflows containing Merge nodes configured in SQL Query mode with expressions that reference __proto__, prototype, or constructor.
- Unexpected modifications to workflow output fields that were not declared in the originating workflow definition.
- Audit log entries showing workflow creation or edits by low-privileged users immediately followed by Merge SQL executions across other projects.
Detection Strategies
- Review stored workflow JSON for Merge node parameters whose SQL expressions include prototype-manipulation tokens such as __proto__, Object.prototype, or constructor.prototype.
- Correlate execution logs to identify Merge SQL runs whose output schema diverges from the workflow's declared schema.
- Track n8n instance version against fixed releases 2.25.7 and 2.26.2 and flag any host still on a vulnerable build.
Monitoring Recommendations
- Forward n8n audit and execution logs to a centralized logging platform and alert on Merge node edits from non-admin accounts.
- Monitor process memory growth and execution latency of the n8n worker, as repeated sandbox pollution can manifest as anomalous runtime behavior.
- Alert on creation of new workflows by accounts that historically only executed existing workflows.
How to Mitigate CVE-2026-54311
Immediate Actions Required
- Upgrade n8n to version 2.25.7 or 2.26.2 or later on every instance.
- Inventory existing workflows for Merge nodes operating in SQL Query mode and review their expressions for prototype manipulation.
- Restrict workflow creation and edit permissions to trusted users until the upgrade is complete.
Patch Information
The maintainers fixed the issue in n8n 2.25.7 and 2.26.2. The fix isolates the Merge node SQL sandbox per execution so prototype mutations cannot persist across runs or tenants. See the n8n GitHub Security Advisory GHSA-9c38-2mcm-q7f7 for vendor details.
Workarounds
- Operate single-user n8n instances, since the vulnerability requires more than one user able to create and execute Merge SQL workflows.
- Disable or remove workflows that use the Merge node in SQL Query mode until the patched version is deployed.
- Segment tenants onto separate n8n instances so a polluted sandbox cannot reach workflows owned by other projects.
# Verify the installed n8n version and upgrade to a fixed release
n8n --version
npm install -g n8n@2.26.2
# or, for the 2.25.x branch
npm install -g n8n@2.25.7
Disclaimer: This content was generated using AI. While we strive for accuracy, please verify critical information with official sources.

