Summary
NocoDB contains a SQL injection flaw in formula handling: a crafted formula tree can be persisted and later reused without revalidation. An authenticated Creator or Owner may exploit this behavior to escalate privileges, and under certain database configurations could cause operating-system commands to run on an external PostgreSQL host.
Affected context
The issue affects NocoDB deployments with vulnerable formula handling. It occurs when a crafted parsed formula tree is persisted and reused without revalidation; the described path can bypass a SQLite metadata path guard through an alias. The reported affected releases are those before 2026.09.0.
Exploit preconditions
- Attack surface: NocoDB formula parsing and persistence
- Required access: An authenticated Creator or Owner account
- Trigger point: Reuse of a persisted crafted formula tree
- Why exploitation is possible: The tree is reused without revalidation, and an alias can bypass the SQLite metadata path guard. Further impact depends on database configuration and permissions.
Why this happens
The underlying flaw is SQL injection (CWE-89): formula-derived data is treated as trusted when constructing or processing SQL. Persisting a parsed tree and reusing it without validating it at the point of use can allow crafted input to cross the boundary into SQL operations. A path guard that can be bypassed through an alias does not reliably protect that boundary.
Potential impact
- Crafted input may alter SQL operations or access data beyond intended boundaries.
- An authenticated user may be able to escalate privileges, potentially to super administrator.
- In some external PostgreSQL configurations, database-side behavior may enable operating-system command execution on the database host.
- Data confidentiality, integrity, or service availability could be affected.
General mitigation guidance
Defensive patterns focus on keeping user-controlled formula data separate from executable SQL:
- Use parameterized queries and safe query-building APIs rather than interpolating formula content.
- Validate and normalize formula trees at the point of use, including after persistence or transformations.
- Apply strict allowlists for formula operations, identifiers, and supported expression types.
- Make path and alias checks canonical and consistent across validation and use.
- Limit database account privileges and avoid granting unnecessary host-level capabilities.
- Treat persisted user-generated formulas as untrusted input and restrict who can create or modify them.
How teams detect issues like this
- Use static analysis to identify SQL construction involving formula-derived values and unsafe string interpolation.
- Review code paths where parsed or persisted trees are reused without validation, especially around aliases and path checks.
- Enforce policies that require parameterized queries and approved query-building APIs.
- Monitor for unexpected formula changes, unusual administrative privilege changes, and anomalous database activity.
- Automated code review tools can help flag risky query construction and missing validation boundaries.

