CVE-2026-59257
JSON

5.3medium

n8n - SQL Injection in MySQL v1 executeQuery Operation via Expression Interpolation

Severity
5.3medium CVSS:4.0 by VulnCheck
Exploit likelihood
0.42% (higher than 37% of CVEs; EPSS, by FIRST)
Published
Last changed
Assigned by
VulnCheck
Also known as
GHSA-hwmj-qg4v-cvg9

Description

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.

Affected

Product or packageVersionsReported by
n8n n8nbefore 1.123.61, from 2.28.0 before 2.28.1, from 2.0.0-rc.0 before 2.27.4, from 2.0.0 before 2.27.4, 2.28.0
Not affected: 1.123.61, 2.28.1, 2.27.4
CVE List, NVD
n8n (npm)before 1.123.61, from 2.28.0 before 2.28.1, from 2.0.0-rc.0 before 2.27.4GitHub Advisory Database

All scores

VulnCheck5.3medium CVSS:4.0CVSS:4.0/AV:N/AC:L/AT:P/PR:L/UI:N/VC:N/VI:N/VA:N/SC:H/SI:H/SA:N
GitHubmedium CVSS:4.0CVSS:4.0/AV:N/AC:L/AT:P/PR:L/UI:N/VC:N/VI:N/VA:N/SC:H/SI:H/SA:N
NVD8.8high CVSS:3.1CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H

Classification

CWE-89

SSVC (CISA-ADP): exploitation none, automatable no, technical impact total.

What each source says

CVE List

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.

GitHub Advisory Database

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 NODES_EXCLUDE 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.

NVD (es)

n8n anterior a 1.123.61, 2.x anterior a 2.27.4, y 2.28.x anterior a 2.28.1 contiene una vulnerabilidad de inyección SQL en la operación executeQuery del nodo MySQL v1 heredado. La operación sustituye los valores de expresiones {{ ... }} evaluados directamente en la cadena SQL sin procesar sin parametrización. Cuando un flujo de trabajo utiliza esta operación con valores originados en expresiones y está conectado a un disparador accesible externamente (como un nodo Webhook), la entrada controlada por el atacante que llega a esas expresiones resulta en inyección SQL, permitiendo la ejecución de SQL arbitrario con los privilegios de las credenciales de MySQL configuradas. El nodo MySQL v2, que utiliza consultas parametrizadas, no se ve afectado.

References

Sources

SourceRecordLicence
CVE ListCVE-2026-59257 changed 2026-10-29CVE Terms of Use
GitHub Advisory DatabaseGHSA-hwmj-qg4v-cvg9 changed 2026-07-22CC-BY-4.0
NVDCVE-2026-59257 changed 2026-10-29Public domain