n8n's legacy MySQL v1 node builds raw SQL strings by directly substituting evaluated workflow expression values, so any workflow that feeds externally-supplied input — most commonly via a Webhook trigger — into that node's executeQuery operation is vulnerable to classic SQL injection, letting an attacker run arbitrary queries with the privileges of the configured MySQL credentials. n8n is widely used to wire together AI agent and automation pipelines, and this CVE sits in a package with 123 other known CVEs and an OpenSSF Scorecard of just 6.6/10, signaling weaker-than-average security hygiene across the project; there's no public exploit or Nuclei template yet and it isn't in CISA KEV, but the 8.8 CVSS score (network vector, low complexity, no user interaction) means any exposed instance still using the deprecated node is a soft target. The blast radius is scoped to deployments still relying on the MySQL v1 node — v2 already uses parameterized queries and is unaffected — but any workflow connecting v1 to a public trigger risks full compromise of the linked database, including any AI pipeline metadata, credentials, or agent state stored there. Patch to n8n 1.123.61, 2.27.4, or 2.28.1 immediately, and in the interim audit all workflows for MySQL v1 node usage on externally-reachable triggers and migrate them to the MySQL v2 node or remove the legacy node entirely.
What is the risk?
High severity (CVSS 8.8) with a straightforward exploitation path: network-reachable, low complexity, no user interaction. The constraint is scope, not difficulty — exploitation requires a specific misconfiguration pattern (legacy MySQL v1 node, expression-sourced values, connected to an externally-reachable trigger such as a Webhook), so not every n8n deployment is affected, but where that pattern exists the attack is a well-understood, low-skill SQL injection with full read/write/delete impact on the connected database. No active exploitation signals exist (no CISA KEV listing, no EPSS score, no public exploit or Nuclei template), so this is currently a patch-now-not-panic situation. The package's track record (123 other CVEs, OpenSSF Scorecard 6.6/10) suggests broader security debt in n8n that warrants continued scrutiny of other legacy nodes.
How does the attack unfold?
What systems are affected?
| Package | Ecosystem | Vulnerable Range | Patched |
|---|---|---|---|
| n8n | npm | < 1.123.61 | 1.123.61 |
Do you use n8n? You're affected.
How severe is it?
What is the attack surface?
What should I do?
1 step-
Upgrade n8n to 1.123.61 (1.x), 2.27.4 (2.x), or 2.28.1 (2.28.x) immediately. As an interim measure, audit all workflows for MySQL v1 node 'Execute Query' operations connected to externally-reachable triggers (Webhook, form triggers, etc.) and either migrate them to the parameterized MySQL v2 node or disable/remove the legacy node from those workflows. Apply least-privilege database credentials to any MySQL connection used by n8n workflows so a compromised credential has minimal blast radius. Monitor MySQL query logs for anomalous or malformed queries originating from the n8n service account, and restrict webhook endpoints with authentication or IP allowlisting where feasible.
What does CISA's SSVC say?
Source: CISA Vulnrichment (SSVC v2.0). Decision based on the CISA Coordinator decision tree.
How is it classified?
Which compliance frameworks are affected?
This CVE is relevant to:
Frequently Asked Questions
What is CVE-2026-59257?
n8n's legacy MySQL v1 node builds raw SQL strings by directly substituting evaluated workflow expression values, so any workflow that feeds externally-supplied input — most commonly via a Webhook trigger — into that node's executeQuery operation is vulnerable to classic SQL injection, letting an attacker run arbitrary queries with the privileges of the configured MySQL credentials. n8n is widely used to wire together AI agent and automation pipelines, and this CVE sits in a package with 123 other known CVEs and an OpenSSF Scorecard of just 6.6/10, signaling weaker-than-average security hygiene across the project; there's no public exploit or Nuclei template yet and it isn't in CISA KEV, but the 8.8 CVSS score (network vector, low complexity, no user interaction) means any exposed instance still using the deprecated node is a soft target. The blast radius is scoped to deployments still relying on the MySQL v1 node — v2 already uses parameterized queries and is unaffected — but any workflow connecting v1 to a public trigger risks full compromise of the linked database, including any AI pipeline metadata, credentials, or agent state stored there. Patch to n8n 1.123.61, 2.27.4, or 2.28.1 immediately, and in the interim audit all workflows for MySQL v1 node usage on externally-reachable triggers and migrate them to the MySQL v2 node or remove the legacy node entirely.
Is CVE-2026-59257 actively exploited?
No confirmed active exploitation of CVE-2026-59257 has been reported, but organizations should still patch proactively.
How to fix CVE-2026-59257?
Upgrade n8n to 1.123.61 (1.x), 2.27.4 (2.x), or 2.28.1 (2.28.x) immediately. As an interim measure, audit all workflows for MySQL v1 node 'Execute Query' operations connected to externally-reachable triggers (Webhook, form triggers, etc.) and either migrate them to the parameterized MySQL v2 node or disable/remove the legacy node from those workflows. Apply least-privilege database credentials to any MySQL connection used by n8n workflows so a compromised credential has minimal blast radius. Monitor MySQL query logs for anomalous or malformed queries originating from the n8n service account, and restrict webhook endpoints with authentication or IP allowlisting where feasible.
What systems are affected by CVE-2026-59257?
This vulnerability affects the following AI/ML architecture patterns: agent frameworks, workflow orchestration pipelines, database-backed integrations.
What is the CVSS score for CVE-2026-59257?
CVE-2026-59257 has a CVSS v3.1 base score of 8.8 (HIGH). The EPSS exploitation probability is 0.31%.
What is the AI security impact?
Affected AI Architectures
MITRE ATLAS Techniques
AML.T0036 Data from Information Repositories AML.T0049 Exploit Public-Facing Application AML.T0106 Exploitation for Credential Access Compliance Controls Affected
What are the technical details?
Original Advisory
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.
Exploitation Scenario
An attacker discovers a publicly reachable n8n Webhook URL that triggers a workflow performing an 'Execute Query' operation on the legacy MySQL v1 node, where the query string embeds an expression like {{ $json.field }} sourced directly from the webhook payload. The attacker sends a crafted payload injecting SQL syntax into that field (e.g., closing the intended string and appending additional statements), which n8n evaluates and concatenates unsanitized into the raw SQL sent to MySQL, executing with the workflow's configured database credentials. This grants the attacker read/write access to the underlying database — enabling data exfiltration, record tampering, or further pivoting if that database account has broader privileges or network reach.
Weaknesses (CWE)
CWE-89 Improper Neutralization of Special Elements used in an SQL Command ('SQL Injection')
Primary
CWE-89 Improper Neutralization of Special Elements used in an SQL Command ('SQL Injection')
Primary
CWE-89 Improper Neutralization of Special Elements used in an SQL Command ('SQL Injection') CWE-89 — Improper Neutralization of Special Elements used in an SQL Command ('SQL Injection'): The product constructs all or part of an SQL command using externally-influenced input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could modify the intended SQL command when it is sent to a downstream component. Without sufficient removal or quoting of SQL syntax in user-controllable inputs, the generated SQL query can cause those inputs to be interpreted as SQL instead of ordinary user data.
- [Architecture and Design] Use a vetted library or framework that does not allow this weakness to occur or provides constructs that make this weakness easier to avoid [REF-1482]. For example, consider using persistence layers such as Hibernate or Enterprise Java Beans, which can provide significant protection against SQL injection if used properly.
- [Architecture and Design] If available, use structured mechanisms that automatically enforce the separation between data and code. These mechanisms may be able to provide the relevant quoting, encoding, and validation automatically, instead of relying on the developer to provide this capability at every point where output is generated. Process SQL queries using prepared statements, parameterized queries, or stored procedures. These features should accept parameters or variables and support strong typing. Do not dynamically construct and execute query strings within these features using "exec" or similar functionality, since this may re-introduce the possibility of SQL injection. [REF-867]
Source: MITRE CWE corpus.
CVSS Vector
CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H References
- github.com/n8n-io/n8n/security/advisories/GHSA-hwmj-qg4v-cvg9
- vulncheck.com/advisories/n8n-sql-injection-in-mysql-v1-executequery-operation-via-expression-interpolation
- github.com/advisories/GHSA-hwmj-qg4v-cvg9
- github.com/n8n-io/n8n/releases/tag/n8n@1.123.61
- github.com/n8n-io/n8n/releases/tag/n8n@2.27.4
- github.com/n8n-io/n8n/releases/tag/n8n@2.28.1
- nvd.nist.gov/vuln/detail/CVE-2026-59257
Timeline
Related Vulnerabilities
CVE-2026-33663 10.0 n8n: member role steals plaintext HTTP credentials
Same package: n8n CVE-2026-33660 10.0 TensorFlow: type confusion NPD in tensor conversion
Same package: n8n CVE-2026-21858 10.0 n8n: Input Validation flaw enables exploitation
Same package: n8n CVE-2026-27577 9.9 n8n: Code Injection enables RCE
Same package: n8n CVE-2026-27494 9.9 n8n: security flaw enables exploitation
Same package: n8n