Summary
NocoDB contains an SQL injection flaw in queries that resolve user-related fields because member email addresses are concatenated into SQL text. A registered user who can set an email address with a quoted local part may be able to execute arbitrary SQL, potentially exposing user records, API tokens, and data-source credentials.
Affected context
The issue occurs in NocoDB's handling of base-member email addresses when resolving user, created-by, or last-modified-by fields. It is relevant to deployments using affected code before 2026.06.2, where email values are incorporated into SQL queries without safe parameterization.
Exploit preconditions
- Attack surface: Application queries that resolve user, created-by, or last-modified-by fields
- Required access: A registered account with the ability to set an email address
- Trigger point: Processing a relevant query containing the member's email address
- Why exploitation is possible: The email value is concatenated into SQL text, allowing a quoted local part to alter query syntax
Why this happens
The underlying bug is the construction of SQL statements by concatenating a user-controlled email value into query text. This fails to keep data separate from SQL instructions, mapping to CWE-89: Improper Neutralization of Special Elements used in an SQL Command ('SQL Injection').
Potential impact
- Attackers may access user records beyond their intended permissions
- API tokens and data-source credentials could be exposed
- Depending on database permissions and query behavior, data could be altered or other database operations could be affected
General mitigation guidance
Defensive patterns focus on ensuring user-controlled values are always treated as data rather than SQL syntax.
Common approaches include:
- Use parameterized queries or prepared statements for all values
- Avoid building SQL statements through string concatenation
- Validate inputs against the expected email format as a supplementary control, not a substitute for parameterization
- Apply least-privilege permissions to database accounts and restrict access to sensitive records
- Limit exposure of tokens and credentials through appropriate access controls and storage practices
How teams detect issues like this
- Use static analysis to identify SQL statements built with string concatenation or interpolation
- Review query-building code that incorporates user profiles, email addresses, or other mutable fields
- Enforce code-review and CI policies requiring parameterized database access
- Monitor for unusual query errors or unexpected access to sensitive records
- Automated code review tools may help flag unsafe query construction patterns

