CVE-2026-59257: n8n - SQL Injection in MySQL v1 executeQuery Operation via Expression Interpolation
Impact The legacy MySQL v1 node's executeQuery operation substitutes evaluated {{ ... }} expression values directly into the raw SQL string without parameterization. If a workflow uses this operation with expression-sourced values in the query and is connected to an externally-reachable trigger (such as a Webhook node), attacker-controlled input reaching those expressions results in SQL injection.
Successful exploitation allows arbitrary SQL execution with the configured MySQL credentials' privileges, enabling unauthorized disclosure, modification, or deletion of data in the downstream database. MySQL v2 node is not affected.
This issue can affect only instances running workflows that use the MySQL v1 node with executeQuery operations.
Patches The issue has been fixed in n8n versions 1.123.61, 2.27.4, and 2.28.1. Users should upgrade to one of these versions or later to remediate the vulnerability.
Workarounds If upgrading is not immediately possible, administrators should consider the following temporary mitigations: - Disable the MySQL node by adding n8n-nodes-base.mySql to the NODESEXCLUDE environment variable, or audit and restrict access to workflows using the MySQL v1 node with the executeQuery operation. - Ensure that webhook endpoints used in workflows containing MySQL v1 executeQuery nodes with expression interpolation require authentication. - Migrate affected workflows to use the MySQL v2 node, which uses parameterized queries.
These workarounds do not fully remediate the risk and should only be used as short-term mitigation measures.
Other sources
n8n before 1.123.61, 2.x before 2.27.4, and 2.28.x before 2.28.1 contains a SQL injection vulnerability in the legacy MySQL v1 node's executeQuery operation. The operation substitutes evaluated {{ ... }} expression values directly into the raw SQL string without parameterization. When a workflow uses this operation with expression-sourced values and is connected to an externally-reachable trigger (such as a Webhook node), attacker-controlled input reaching those expressions results in SQL injection, allowing execution of arbitrary SQL with the configured MySQL credentials' privileges. The MySQL v2 node, which uses parameterized queries, is not affected.
— NVD
Affected Software
Remediation
Recommended actions to resolve this vulnerability, in priority order.
- Upgrade
Upgrade
npm/n8nto a version that resolves this vulnerability.Fixed in 2.27.4 - Upgrade
Upgrade
npm/n8nto a version that resolves this vulnerability.Fixed in 2.28.1 - Upgrade
Upgrade
npm/n8nto a version that resolves this vulnerability.Fixed in 1.123.61 - Upgrade
Upgrade
n8nto a version that resolves this vulnerability.Fixed in 1.123.61 - Upgrade
Upgrade
n8nto a version that resolves this vulnerability.Fixed in 2.27.4 - Upgrade
Upgrade
n8nto a version that resolves this vulnerability.Fixed in 2.28.1 - Configuration
Disable the legacy MySQL node by adding `n8n-nodes-base.mySql` to the `NODES_EXCLUDE` environment variable.
n8n NODES_EXCLUDE = n8n-nodes-base.mySql - Configuration
Ensure webhook endpoints used in workflows containing MySQL v1 `executeQuery` nodes with expression interpolation require authentication (especially when connected to externally-reachable triggers like Webhook nodes).
n8n workflows using MySQL v1 executeQuery webhook_authentication = required - Configuration
Migrate affected workflows to use the MySQL v2 node instead of the legacy MySQL v1 `executeQuery` node; the MySQL v2 node uses parameterized queries.
n8n workflows mysql_node_version_usage = use MySQL v2 node
Event History
Frequently Asked Questions
What is the severity of CVE-2026-59257?
CVE-2026-59257 has a medium severity rating of 5.3.
What type of vulnerability is described in CVE-2026-59257?
CVE-2026-59257 is a SQL Injection vulnerability.
How do I fix CVE-2026-59257?
To fix CVE-2026-59257, update n8n to version 1.123.61, 2.27.4, or 2.28.1 or later.
What systems are affected by CVE-2026-59257?
CVE-2026-59257 affects n8n versions before 1.123.61 and 2.x versions before 2.27.4 and 2.28.x before 2.28.1.
What impact does CVE-2026-59257 have on n8n users?
CVE-2026-59257 allows attackers to execute arbitrary SQL commands through crafted input, potentially compromising database integrity.