Summary
NocoDB versions before 2026.08.0 have a SQL injection vulnerability in the legacy where parameter on PostgreSQL. An authenticated user with read access, including a Viewer-role user, may exploit it to run read queries that expose data beyond their permitted view.
Affected context
The issue occurs in NocoDB's PostgreSQL filtering path when the legacy where parameter is used. It is risky where filter values are concatenated into SQL rather than safely bound, allowing an authenticated user with read access to influence the resulting query.
Exploit preconditions
- Attack surface: PostgreSQL-backed NocoDB filtering through the legacy
whereparameter - Required access: An authenticated account with read access; Viewer-role access may be sufficient
- Trigger point: Processing a filter whose value is incorporated into a query by
CustomKnex.ts - Why exploitation is possible: Filter values are concatenated into SQL, allowing crafted input to alter read-query structure
Why this happens
The underlying bug is unsafe SQL construction: user-controlled filter values are concatenated into a query instead of being passed as bound parameters. This maps to CWE-89: Improper Neutralization of Special Elements used in an SQL Command ('SQL Injection'), because input can change the meaning of the SQL statement.
Potential impact
- Users may read data from other tables or schemas
- Queries may expose rows beyond intended view filters
- Hidden columns may become accessible
- Sensitive information may be disclosed to authenticated users without the appropriate data permissions
General mitigation guidance
Mitigation patterns focus on keeping user-controlled values separate from SQL structure.
- Use parameterized queries or query-builder bindings for filter values
- Prefer structured, allowlisted filter APIs over legacy free-form query parameters
- Validate filter fields and operators against the user's authorized data scope
- Apply authorization checks to the resulting query, not only to the requested table or view
- Follow least-privilege principles for database and application accounts
How teams detect issues like this
- Use static analysis to flag SQL assembled through string concatenation with request or filter values
- Review query-builder calls to confirm values are bound rather than interpolated
- Test that filter inputs cannot broaden access to other tables, schemas, rows, or columns
- Enforce code-review and CI policies requiring parameterized database access
- Monitor for unusual read-query patterns and access to data outside expected scopes

