Summary
A critical PostgREST filter injection vulnerability in n8n's Supabase node allows user-controlled filter values to alter the intended database query. When an attacker can influence a vulnerable Row Get Many, Delete, or Update operation, the filter may match every row, enabling broad data disclosure, deletion, or modification.
Affected context
The vulnerability occurs in n8n workflows that use the Supabase node's Row Get Many, Delete, or Update operations and pass attacker-influenced values into PostgREST filters. Risk is higher when workflow inputs, webhook data, form submissions, or other external sources reach these operations without strict validation and parameter-safe query construction.
Exploit preconditions
- Attack surface: n8n workflows using vulnerable Supabase node row operations
- Required access: Ability to influence a filter value or trigger a workflow that processes attacker-controlled input
- Trigger point: Construction and execution of a PostgREST filter query
- Why exploitation is possible: An expression-bindable value is concatenated without adequate escaping, allowing the intended filter condition to be widened
Why this happens
The underlying bug is a failure to safely separate data values from query expressions. By concatenating an unescaped value into a PostgREST filter, the application allows input intended to represent a row-selection value to affect query logic. This is consistent with CWE-89: Improper Neutralization of Special Elements used in an SQL Command, including injection risks in database query languages and query-like filtering interfaces.
Potential impact
- Sensitive records may be disclosed beyond the intended row scope
- An attacker could cause deletion of many or all matching records
- Unauthorized updates could modify broad sets of database rows
- Application integrity and downstream workflow results may be compromised
- Data loss or service disruption could occur
General mitigation guidance
Mitigation generally focuses on preserving a strict separation between filter data and query expressions.
Common defensive patterns include:
- Constructing PostgREST filters through parameter-safe APIs rather than string concatenation
- Applying strict allowlists and type validation to workflow inputs
- Rejecting unexpected operators, delimiters, and expression-like values
- Limiting workflows to the minimum database operations and columns they require
- Using database roles with least-privilege permissions
- Requiring explicit authorization before destructive or bulk-update operations
- Adding safeguards that prevent unexpectedly broad result sets or affected-row counts
How teams detect issues like this
Detection approaches may include:
- Static analysis for string concatenation involving PostgREST filters or database query parameters
- Code review checks for externally controlled values reaching Supabase node operations
- Workflow policy rules requiring validation before database actions
- Runtime monitoring for unusual filter expressions, full-table reads, or unexpectedly large delete and update counts
- Automated security review tools that identify injection-prone data-to-query flows

