{"id":"CVE-2026-59257","aliases":["CVE-2026-59257","GHSA-hwmj-qg4v-cvg9"],"related":[],"kind":"vulnerability","state":"published","title":"n8n - SQL Injection in MySQL v1 executeQuery Operation via Expression Interpolation","summary":"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.","summarySource":"cvelist","descriptions":[{"lang":"en","text":"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.","source":"cvelist"},{"lang":"en","text":"## Impact\nThe 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.\n\nSuccessful 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.\n\nThis issue can affect only instances running workflows that use the MySQL v1 node with `executeQuery` operations.\n\n## Patches\nThe 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.\n\n## Workarounds\nIf upgrading is not immediately possible, administrators should consider the following temporary mitigations:\n- 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.\n- Ensure that webhook endpoints used in workflows containing MySQL v1 `executeQuery` nodes with expression interpolation require authentication.\n- Migrate affected workflows to use the MySQL v2 node, which uses parameterized queries.\n\nThese workarounds do not fully remediate the risk and should only be used as short-term mitigation measures.","format":"markdown","source":"ghsa"},{"lang":"es","text":"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.","source":"nvd"}],"published":"2026-07-08T13:49:13.618Z","modified":"2026-10-29T21:16:04.286Z","severity":{"scorer":"VulnCheck","scheme":"CVSS:4.0","vector":"CVSS:4.0/AV:N/AC:L/AT:P/PR:L/UI:N/VC:N/VI:N/VA:N/SC:H/SI:H/SA:N","score":5.3,"rating":"MEDIUM"},"severities":[{"scorer":"VulnCheck","scheme":"CVSS:4.0","vector":"CVSS:4.0/AV:N/AC:L/AT:P/PR:L/UI:N/VC:N/VI:N/VA:N/SC:H/SI:H/SA:N","score":5.3,"rating":"MEDIUM"},{"scorer":"GitHub","scheme":"CVSS:4.0","vector":"CVSS:4.0/AV:N/AC:L/AT:P/PR:L/UI:N/VC:N/VI:N/VA:N/SC:H/SI:H/SA:N","rating":"MEDIUM"},{"scorer":"NVD","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H","score":8.8,"rating":"HIGH"}],"cwes":["CWE-89"],"affected":[{"ranges":[{"type":"semver","introduced":"0","fixed":"1.123.61","status":"affected"},{"type":"semver","version":"1.123.61","status":"unaffected"}],"vendor":"n8n","product":"n8n","source":"cvelist"},{"ranges":[{"type":"semver","introduced":"2.28.0","fixed":"2.28.1","status":"affected"},{"type":"semver","version":"2.28.1","status":"unaffected"}],"vendor":"n8n","product":"n8n","source":"cvelist"},{"ranges":[{"type":"semver","introduced":"2.0.0-rc.0","fixed":"2.27.4","status":"affected"},{"type":"semver","version":"2.27.4","status":"unaffected"}],"vendor":"n8n","product":"n8n","source":"cvelist"},{"ranges":[{"type":"semver","introduced":"0","status":"affected","fixed":"1.123.61"}],"ecosystem":"npm","package":"n8n","purl":"pkg:npm/n8n","source":"ghsa"},{"ranges":[{"type":"semver","introduced":"2.28.0","status":"affected","fixed":"2.28.1"}],"ecosystem":"npm","package":"n8n","purl":"pkg:npm/n8n","source":"ghsa"},{"ranges":[{"type":"semver","introduced":"2.0.0-rc.0","status":"affected","fixed":"2.27.4"}],"ecosystem":"npm","package":"n8n","purl":"pkg:npm/n8n","source":"ghsa"},{"ranges":[{"status":"affected","fixed":"1.123.61"},{"status":"affected","introduced":"2.0.0","fixed":"2.27.4"},{"status":"affected","version":"2.28.0"}],"vendor":"n8n","product":"n8n","cpe":"cpe:2.3:a:n8n:n8n:*:*:*:*:*:node.js:*:*","source":"nvd"}],"references":[{"url":"https://github.com/n8n-io/n8n/security/advisories/GHSA-hwmj-qg4v-cvg9","tags":["mitigation","vendor-advisory","web"],"sources":["cvelist","ghsa","nvd"]},{"url":"https://www.vulncheck.com/advisories/n8n-sql-injection-in-mysql-v1-executequery-operation-via-expression-interpolation","tags":["third-party-advisory","web"],"sources":["cvelist","ghsa","nvd"]},{"url":"https://nvd.nist.gov/vuln/detail/CVE-2026-59257","tags":["advisory"],"sources":["ghsa"]},{"url":"https://github.com/n8n-io/n8n","tags":["package"],"sources":["ghsa"]},{"url":"https://github.com/n8n-io/n8n/releases/tag/n8n@1.123.61","tags":["web"],"sources":["ghsa"]},{"url":"https://github.com/n8n-io/n8n/releases/tag/n8n@2.27.4","tags":["web"],"sources":["ghsa"]},{"url":"https://github.com/n8n-io/n8n/releases/tag/n8n@2.28.1","tags":["web"],"sources":["ghsa"]}],"credits":[],"assigner":"VulnCheck","ssvc":{"scorer":"CISA-ADP","exploitation":"none","automatable":"no","technicalImpact":"total","date":"2026-07-09T13:39:34.978Z"},"sources":[{"source":"cvelist","name":"CVE List","id":"CVE-2026-59257","url":"https://www.cve.org/CVERecord?id=CVE-2026-59257","licence":"CVE Terms of Use","modified":"2026-10-29T21:16:04.286Z"},{"source":"ghsa","name":"GitHub Advisory Database","id":"GHSA-hwmj-qg4v-cvg9","url":"https://github.com/advisories/GHSA-hwmj-qg4v-cvg9","licence":"CC-BY-4.0","modified":"2026-07-22T22:31:06.001Z"},{"source":"nvd","name":"NVD","id":"CVE-2026-59257","url":"https://nvd.nist.gov/vuln/detail/CVE-2026-59257","licence":"Public domain","modified":"2026-10-29T19:17:24.860Z"}],"updatedAt":"2026-11-25T22:59:27.373Z","epss":{"score":0.00417,"percentile":0.3795,"date":"2026-12-01T12:00:22.000Z"}}