Summary
NocoDB contains a SQL injection vulnerability in formula handling during table creation. An authenticated user with the Creator role may supply a crafted parsed_tree that causes a binary-expression operator to be interpolated into a raw SQL fragment; on SQLite installations, this could expose user and token data and enable privilege escalation.
Affected context
The issue affects NocoDB versions before 2026.10.0 when table creation processes a formula parsed_tree and incorporates a binary-expression operator into a raw SQL fragment. The described access to user and token tables and escalation to super administrator apply to SQLite installations.
Exploit preconditions
- Attack surface: Formula processing during table creation
- Required access: An authenticated account with the Creator role
- Trigger point: Creation of a table using a crafted formula
parsed_tree - Why exploitation is possible: A supplied binary-expression operator is interpolated into a
knex.rawSQL fragment without adequate protection
Why this happens
The underlying issue is SQL injection (CWE-89): input that can influence SQL syntax is incorporated into a query as executable SQL rather than being safely separated from query structure. In this case, a binary-expression operator from the parsed formula tree reaches a raw SQL fragment. If the operator is not constrained to trusted, expected values, it can alter the meaning of the generated query.
Potential impact
- An attacker could access data from user or token tables on affected SQLite installations.
- Sensitive account or token information may be exposed.
- An attacker may be able to escalate privileges to super administrator on SQLite installations.
- SQL operations could have additional unintended effects, depending on the database context and permissions.
General mitigation guidance
Mitigation generally focuses on keeping user-controlled values out of SQL syntax.
- Use parameterized query interfaces for data values rather than interpolating input into raw SQL.
- Map operators to a strict allowlist of supported operations; reject unknown or malformed operators.
- Validate formula structures against a defined schema before query construction.
- Prefer query-builder abstractions that preserve separation between SQL structure and user-controlled data.
- Apply least-privilege database access and limit exposure of sensitive tables.
How teams detect issues like this
- Use static analysis to identify raw SQL construction that interpolates values derived from request or formula data.
- Review formula parsing and table-creation paths for operator allowlisting and validation before query generation.
- Add tests that verify malformed or unsupported formula operators are rejected and cannot change generated SQL structure.
- Enforce code-review or CI policies for raw-query use and parameter binding.

