NewApp Monitoring is liveSign up free
AgentbeamBeta
AI agent vulnerability · n8n

CVE-2026-59257: n8n: MySQL v1 Node executeQuery Operation Allows SQL Injection via Unparameterized Expression Interpolation

mediumCVSS 4.0 5.3GHSA-hwmj-qg4v-cvg9

The legacy MySQL v1 node in n8n builds its executeQuery SQL by pasting evaluated expression values straight into the query string. If attacker input from a Webhook or similar trigger reaches those expressions, it becomes SQL injection. The MySQL v2 node is not affected. Fixed in n8n 1.123.61, 2.27.4 and 2.28.1.

Published Jul 22, 2026 · Analysis Oct 25, 2026

What an attacker can do

In the MySQL v1 node, the executeQuery operation evaluates {{ ... }} expressions and substitutes the results into the raw SQL text. Nothing is parameterized (CWE-89, SQL injection). If a workflow puts webhook data or other outside input into those expressions, the caller controls part of the SQL statement.

Successful exploitation runs arbitrary SQL with the privileges of the MySQL credentials configured on the node. That can mean reading, changing or deleting data in the downstream database. How far it goes depends on what those credentials can do.

The workflow must be wired to an externally reachable trigger such as a Webhook node, and it must use the v1 node with executeQuery and expression values in the query. Only instances running such workflows are affected. The CVSS 4.0 vector lists low privileges and an attack requirement, and rates the impact on the downstream database as high for confidentiality and integrity. Webhook endpoints without authentication are the most exposed.

Who is affected

Affected: n8n below 1.123.61 on the 1.x line, 2.0.0-rc.0 up to but not including 2.27.4, and 2.28.0. Only workflows that use the MySQL v1 node with the executeQuery operation and expression values in the query are at risk. The v2 node is not affected.

Check the version:

npm ls n8n

Then search your workflows for MySQL nodes of version 1 with executeQuery.

n8n

Ecosystem
npm
Affected
< 1.123.61
Fixed in
1.123.61
Check
npm ls n8n

n8n

Ecosystem
npm
Affected
>= 2.28.0, < 2.28.1
Fixed in
2.28.1
Check
npm ls n8n

n8n

Ecosystem
npm
Affected
>= 2.0.0-rc.0, < 2.27.4
Fixed in
2.27.4
Check
npm ls n8n

How to fix it

Upgrade to n8n 1.123.61, 2.27.4 or 2.28.1, or later. For an npm install, run npm install [email protected].

Temporary mitigations from the advisory, none of which fully remove the risk:

  • Add n8n-nodes-base.mySql to NODES_EXCLUDE, or audit and restrict workflows that use MySQL v1 executeQuery.
  • Require authentication on webhook endpoints used by those workflows.
  • Migrate affected workflows to the MySQL v2 node, which uses parameterized queries.

How to tell if you were hit

Find workflows with a MySQL v1 node on executeQuery where the query contains {{ }} expressions fed from a webhook or other external trigger. In the MySQL server's general or audit log, look for statements run by the n8n database user that contain unexpected clauses, such as UNION, stacked statements, comment sequences or reads from information_schema. Review execution history for webhook calls with quotes or SQL keywords in their parameters.

Original advisory

From the GitHub Advisory Database (CC BY 4.0).

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.

Credited to shmulc8.

Questions

Is the MySQL v2 node affected by CVE-2026-59257?

No. The advisory says the v2 node uses parameterized queries and is not affected. Only the legacy v1 node's executeQuery operation is.

What does the attacker need?

A way to feed input into an expression in the query, usually an externally reachable Webhook trigger. The CVSS vector lists low privileges and an attack requirement, so the exact conditions depend on how the workflow is built.

Which versions are patched?

n8n 1.123.61, 2.27.4 and 2.28.1, or later.

Can I just require webhook authentication?

It reduces who can reach the flaw, and the advisory lists it as a temporary mitigation. It does not fix the injection, so upgrade or migrate to the v2 node.

References

How this page is made: the data panel comes from the GitHub Advisory Database, CISA’s KEV catalog, the NVD and FIRST EPSS, and updates twice a day. The analysis is written by an AI model from the sources listed above and checked by automated rules before it is published. Check versions against the vendor's advisory before you act. Methodology

More n8n vulnerabilities

All n8n entries