/

CVE-2026-28399

Severity:

HIGH RISK

(8.8)

SQL Injection in NocoDB

CVE-2026-28399

Analyzed

Vulnerability type

Category:

SQL Injection

CWE:

CWE-89

Impact:

Arbitrary SQL Execution within Application Database Context

Severity:

HIGH RISK

(8.8)

CVSS version:

3.1

Catch this CVE while code is being written

Detect vulnerable code directly in pull requests, so CVEs are fixed before merge.

Summary

NocoDB contained a SQL injection vulnerability where an authenticated user with the Creator role could inject arbitrary SQL through the unit parameter of the DATEADD formula.

When exploited, this issue can allow manipulation or disclosure of database contents under the permissions of the NocoDB application.

Affected context

This vulnerability occurs in NocoDB deployments that:

  • Expose formula functionality to authenticated users with the Creator role
  • Support the DATEADD formula in spreadsheet-like views or formula fields
  • Construct SQL queries using user-controlled formula parameters without proper sanitization or parameterization

It is most relevant in environments where Creators can define or modify formulas that are translated into backend SQL queries.

Exploit preconditions

  • Attack surface: Application formula handling and query-generation layer backing NocoDB's spreadsheet/database views.
  • Required access: Valid authenticated account with at least the Creator role, allowing definition or editing of formulas.
  • Trigger point: Evaluation or persistence of a DATEADD formula where the unit parameter is accepted and subsequently used to construct SQL.
  • Why exploitation is possible: The unit parameter of the DATEADD formula is incorporated into SQL statements without strong validation, escaping, or use of parameterized queries, allowing crafted input to alter the intended query structure.

Why this happens

The underlying issue is a classic SQL injection flaw, aligning with CWE-89: Improper Neutralization of Special Elements used in an SQL Command.

NocoDB's formula engine takes the unit parameter from the DATEADD formula—intended to specify time units like days or months—and feeds it into SQL query construction in a way that treats it as part of the SQL syntax rather than as data.

Because this parameter is not strictly validated against an allowlist of legitimate unit values and is not safely parameterized, an attacker with Creator privileges can craft input that injects additional SQL fragments, effectively modifying or extending the query executed by the backend database.

Potential impact

  • Reading data from tables that the application has access to, beyond what the user's UI normally exposes.
  • Modifying or deleting records, potentially corrupting application state and business data.
  • Escalating impact by chaining with other misconfigurations (e.g., overly privileged database accounts).
  • Inferring database schema and structure through error-based or blind injection techniques.
  • Potential pivoting to other application functionalities that rely on the compromised data.

General mitigation guidance

Effective mitigation focuses on strict separation between user input and SQL logic within the formula and query-generation engine:

  • Treat all formula parameters, including unit in DATEADD, as data and pass them via parameterized queries or bind variables wherever possible.
  • Enforce strong validation and allowlisting for formula parameters that represent enums (e.g., second, minute, hour, day, week, month, year), rejecting any value outside the predefined set.
  • Centralize query construction logic so that user-controlled values never directly influence SQL keywords or structural elements (e.g., operators, identifiers, clauses).
  • Apply least-privilege principles to the database account used by NocoDB, limiting the blast radius if an injection flaw is present.
  • Design formula languages and expression evaluators to be compiled into a safe, intermediate representation before mapping to SQL, reducing direct string concatenation.

How teams detect issues like this

Organizations can detect and monitor for this class of issue using a combination of static and dynamic approaches:

  • Static analysis: Scan the codebase for string-based SQL construction where formula parameters or other user inputs are concatenated directly into queries; flag any usage of formula components in SQL without parameter binding or strict validation.
  • Code review: Pay special attention to formula evaluation logic and query-builders, looking for:
  • Lack of allowlists for enum-like parameters.
  • Conditional string concatenation to build WHERE, ORDER BY, or function arguments from user-controlled values.
  • Dynamic testing: Use application-level security tests (including SAST/DAST) that exercise formula creation features, attempting to inject SQL through parameters like unit.
  • Monitoring and logging: Instrument database and application logs to detect anomalous queries, unusual errors, or patterns indicative of injection (e.g., unexpected comments, stacked queries, or tautological conditions).
  • Policy enforcement: Incorporate automated checks in CI/CD pipelines to prevent introduction of new query-building patterns that rely on unvalidated string concatenation.

Sources

SourceLink
github.comgithub.com/nocodb/nocodb/releases/tag/0.301.3
github.comgithub.com/nocodb/nocodb/security/advisories/GHSA-45rp-9p97-h852

Frequently asked

questions

It is remotely exploitable via the web interface or API, but only by users who can authenticate and obtain at least the Creator role. Anonymous or read-only users cannot typically trigger the vulnerable code path.

The attacker must have valid credentials and be granted Creator-level rights or any role that permits creation or editing of formulas using DATEADD. With such access, they can supply crafted values for the unit parameter.

The safest approach is to enforce strict allowlists for all formula parameters that map into SQL constructs and ensure that all user-supplied data is passed through parameterized queries or equivalent safe abstractions, never directly interpolated into SQL strings.

Standardize a secure query abstraction layer, forbid ad-hoc SQL string building, and treat formula languages as untrusted input that must be parsed, validated, and compiled into safe operations. Complement this with security-focused code reviews, automated static analysis for injection patterns, and defensive database privilege configurations.

Find out what's already
exploitable in your codebase.