---
id: CVE-2026-59257
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 t…
severity: medium
cvss: 5.3
cvssVector: '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'
cvssSource: cna
cwe:
  - CWE-89
vendor: n8n
product: n8n
affected:
  - n8n < 1.123.61
  - n8n >= 2.28.0 < 2.28.1
  - n8n >= 2.0.0-rc.0 < 2.27.4
ssvc:
  exploitation: none
  automatable: 'no'
  technicalImpact: total
  timestamp: '2026-07-09T13:39:34.978946Z'
published: '2026-07-08'
updated: '2026-10-29'
sourceUpdated: '2026-10-29T21:16:04.286Z'
source: CVEORG
sourceUrl: 'https://www.cve.org/CVERecord?id=CVE-2026-59257'
references:
  - url: 'https://github.com/n8n-io/n8n/security/advisories/GHSA-hwmj-qg4v-cvg9'
    label: GitHub Security Advisory (GHSA-hwmj-qg4v-cvg9)
  - url: >-
      https://www.vulncheck.com/advisories/n8n-sql-injection-in-mysql-v1-executequery-operation-via-expression-interpolation
    label: >-
      VulnCheck Advisory: n8n - SQL Injection in MySQL v1 executeQuery Operation
      via Expression Interpolation
  - url: 'https://nvd.nist.gov/vuln/detail/CVE-2026-59257'
  - url: 'https://github.com/n8n-io/n8n/releases/tag/n8n@1.123.61'
  - url: 'https://github.com/n8n-io/n8n/releases/tag/n8n@2.27.4'
  - url: 'https://github.com/n8n-io/n8n/releases/tag/n8n@2.28.1'
  - url: 'https://github.com/advisories/GHSA-hwmj-qg4v-cvg9'
tags:
  - cve.org
  - ghsa
  - npm
epss: 0.00572
epssPercentile: 0.47392
aliases:
  - GHSA-hwmj-qg4v-cvg9
ecosystem: npm
patched:
  - n8n 1.123.61
  - n8n 2.28.1
  - n8n 2.27.4
ingestedAt: '2026-07-22T23:07:32.770Z'
---

## Overview

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

- `n8n < 1.123.61`
- `n8n >= 2.28.0 < 2.28.1`
- `n8n >= 2.0.0-rc.0 < 2.27.4`

## Remediation

Refer to the linked advisories for vendor-supplied fixes and affected version ranges.

## Package advisory (CVE-2026-59257)

Affected packages:

- `n8n < 1.123.61`
- `n8n >= 2.28.0, < 2.28.1`
- `n8n >= 2.0.0-rc.0, < 2.27.4`

Patched in:

- `n8n 1.123.61`
- `n8n 2.28.1`
- `n8n 2.27.4`

Source: https://github.com/advisories/GHSA-hwmj-qg4v-cvg9
