Summary
A SQL injection flaw in n8n's SeaTable node allowed user-controlled input to be concatenated directly into SQL query strings for the row:search and row:get operations.
When workflows passed external user data into these operations via expressions, an attacker could manipulate the generated queries to bypass intended row-level filters and retrieve unauthorized records from the connected SeaTable base.
Affected context
The vulnerability appears in n8n workflows that use the SeaTable node's row:search or row:get operations and accept values derived from external or semi-trusted sources (such as API requests, webhooks, or user-supplied form fields).
In these workflows, the parameters used to filter or identify rows are interpolated into SQL query strings without proper escaping or parameterization, creating a risk whenever those parameters are influenced—directly or indirectly—by user input.
Exploit preconditions
- Attack surface: n8n workflows that expose the SeaTable node via webhooks, API endpoints, triggers, or integrations that accept input controlled by end users or external systems.
- Required access: Ability to supply or influence the values passed into the SeaTable
row:searchorrow:getparameters (for example, query parameters, JSON payload fields, or headers mapped through expressions). - Trigger point: Execution of the workflow path that invokes the SeaTable node, where the crafted input is concatenated into the SQL query string.
- Why exploitation is possible: The SeaTable node builds SQL statements by string concatenation using user-controlled values, without using bound parameters or escaping. This allows attackers to alter the logical structure of the query and bypass workflow-level row filters.
Why this happens
The core issue is that the SeaTable node constructs SQL queries by directly concatenating user-controlled values into query strings.
This pattern exemplifies CWE-89: Improper Neutralization of Special Elements used in an SQL Command ('SQL Injection'), where identifiers, conditions, or filter values are treated as trusted and embedded as raw text.
Because the node does not enforce parameterized queries or robust escaping at this boundary, any expressions that propagate external input into these fields can inadvertently grant attackers control over parts of the SQL WHERE clause, leading to unauthorized data retrieval.
Potential impact
- Unauthorized reading of additional rows beyond those intended by the workflow's row-level filtering logic.
- Bypassing business rules or security controls implemented at the workflow layer that rely on specific query filters.
- Exposure of sensitive or tenant-isolated data stored in the affected SeaTable base.
- Facilitation of data mining or reconnaissance by attackers to understand schema, relationships, and data distributions.
General mitigation guidance
Effective mitigation focuses on eliminating direct string concatenation and reducing trust boundaries around query construction.
Common defensive patterns include:
- Using parameterized queries or prepared statements for all query filters and identifiers, avoiding dynamic SQL where possible.
- Implementing strict input validation and normalization on fields that are used to construct queries, accepting only expected formats and whitelisting known-safe values.
- Designing workflows so that sensitive query logic (such as tenant or user scoping conditions) is enforced centrally and not derived from user input.
- Applying least-privilege principles when configuring database access, ensuring that credentials used by workflow integrations can only read the minimum required tables and rows.
- Separating "query shape" (columns, operators) from user-supplied values, so that users can influence only data values, not the structure of the SQL statement.
How teams detect issues like this
Organizations can approach detection of this vulnerability class by:
- Reviewing workflow definitions and integration nodes for places where user-controlled expressions are interpolated into query-related fields or filters.
- Applying static analysis rules or linters to node code and custom integrations to flag string-based SQL construction that uses untrusted variables.
- Using code review checklists that explicitly call out dynamic SQL or concatenated query patterns, especially in low-code/automation environments.
- Implementing centralized policies that prefer parameterized query APIs and disallow direct string concatenation for database access.
- Monitoring database logs for anomalous or unusually complex queries originating from automation tools, which may indicate injection attempts.

