/

CVE-2026-33713

Severity:

HIGH RISK

(8.8)

SQL Injection in n8n Data Table Get Workflow Node

CVE-2026-33713

Analyzed

Vulnerability type

Category:

SQL Injection

CWE:

CWE-89

Impact:

Arbitrary SQL execution leading to potential data modification and deletion

Severity:

HIGH RISK

(8.8)

CVSS version:

3.1

Catch this CVE while code is being written

Detect vulnerable code directly in pull requests, so CVEs are fixed before merge.

Summary

A SQL injection vulnerability in the n8n Data Table Get node allows an authenticated workflow editor to inject arbitrary SQL into database queries.

On PostgreSQL deployments this can enable multi-statement execution, including data modification or deletion; on the default SQLite backend, impact is more limited to manipulating single statements.

Affected context

The vulnerability occurs in n8n instances where:

  • The Data Table Get node is available and used in workflows
  • Users are allowed to create or modify workflows
  • Workflow expressions can influence SQL-related parameters such as orderByColumn
  • The instance uses a relational database backend (SQLite by default, PostgreSQL in many production setups)

Risk increases significantly in PostgreSQL deployments due to support for multi-statement execution and richer SQL features.

Exploit preconditions

  • Attack surface: The n8n web interface / API for workflow creation and editing, specifically the configuration of the Data Table Get node.
  • Required access: Authenticated account with permission to create or modify workflows that include the Data Table Get node.
  • Trigger point: Execution of a workflow containing a Data Table Get node where orderByColumn (or similar query-related fields) is set to an expression that incorporates attacker-controlled data.
  • Why exploitation is possible: User-controlled expressions are concatenated or interpolated into SQL queries without adequate parameterization or validation, allowing crafted input to alter the intended query structure.

Why this happens

This issue stems from constructing SQL queries using dynamic strings that directly embed user-controlled values from node expressions.

Instead of binding values through parameterized queries or restricting them to safe identifiers, the implementation allows arbitrary expression output to influence clauses such as ORDER BY. This maps to CWE-89: Improper Neutralization of Special Elements used in an SQL Command, where untrusted input is not correctly sanitized before being included in a SQL statement, enabling attackers to change query logic or append additional commands.

Potential impact

  • Unauthorized reading of additional records beyond what the workflow designer intended
  • Modification or deletion of database records in PostgreSQL deployments
  • Tampering with workflow-related or application data, affecting automation logic and business processes
  • Escalation of impact to other integrated systems that depend on the integrity of n8n-managed data
  • In some environments, pivoting to broader data exposure if the same database hosts other application schemas

General mitigation guidance

Effective mitigation focuses on eliminating unsafe query construction and tightening trust boundaries around workflow inputs:

  • Replace string-concatenated SQL building with parameterized queries or query builders that separate SQL structure from values.
  • Constrain query-related configuration fields (e.g., columns or table names) to validated, whitelist-based options instead of arbitrary expressions.
  • Reduce trust in workflow input by treating all expression output as untrusted data, even if it originates from internal nodes.
  • Apply least-privilege database permissions so the n8n database user can perform only the minimum required operations.
  • Limit workflow creation and editing rights to users who are operationally trusted and have basic security awareness.
  • Consider disabling high-risk nodes in environments where workflows can be edited by a broad user base.

How teams detect issues like this

Detection can combine code, configuration, and behavioral inspection:

  • Static analysis / code review: Look for dynamic SQL string construction that interpolates node expressions or user-controlled variables, especially in ORDER BY, WHERE, or LIMIT clauses.
  • Configuration review: Identify workflows containing Data Table Get nodes with orderByColumn or similar fields set to expressions rather than fixed, validated values.
  • Database monitoring: Use query logging or database auditing to flag anomalous queries, such as those containing unexpected operators, stacked statements, or schema-manipulation commands.
  • Policy enforcement: Introduce internal development standards or automated checks that prohibit direct string concatenation for SQL in node implementations and require parameterized access patterns.
  • Automated security review tools or SAST scanners can be configured to detect patterns of unsafe SQL construction within workflow engine codebases.

Sources

SourceLink
github.comgithub.com/n8n-io/n8n/security/advisories/GHSA-98c2-4cr3-4jc3

Frequently asked

questions

It is exploitable through the n8n interface or API, but only by authenticated users who can create or modify workflows that include the Data Table Get node. External, unauthenticated users cannot directly exploit it without first gaining such access.

An attacker must have an account with permissions to create or edit workflows. Once they can configure a Data Table Get node, they can craft expressions that inject SQL into the underlying query.

The robust fix is to treat all expression output as untrusted and use parameterized SQL APIs or query builders for every query, combined with strict validation or whitelisting for identifiers like column names. Avoid any direct concatenation of user-controlled data into SQL statements.

Establish a development standard that all data access layers use parameterized queries only, enforce validation for any dynamic query components, and subject new nodes or connectors to security review focused on injection risks. Additionally, restrict powerful nodes to trusted users and regularly review workflows that incorporate user or external input into data-access operations.

Find out what's already
exploitable in your codebase.