/

CVE-2026-88402

Severity:

CRITICAL RISK

(9.8)

SQL Injection (CWE-89) in NocoBase checkSQL Function

CVE-2026-88402

Deferred

Vulnerability type

Category:

SQL Injection

CWE:

CWE-89

Impact:

Sensitive Database Information Disclosure

Severity:

CRITICAL RISK

(9.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

A critical SQL injection vulnerability in NocoBase's checkSQL function may allow attackers to manipulate database queries through crafted input. Successful exploitation could expose sensitive database information when the affected function processes attacker-controlled data without adequate query separation or validation.

Affected context

The vulnerability occurs in NocoBase v2.1.21 where the checkSQL function handles input that can influence database queries. Risk depends on whether an attacker can reach the function through an exposed application endpoint or workflow and whether the resulting database account has access to sensitive records.

Exploit preconditions

  • Attack surface: An application interface, API endpoint, or workflow that invokes the checkSQL function
  • Required access: Any access level permitted to submit or influence the relevant input, depending on deployment configuration
  • Trigger point: Processing of attacker-controlled input by the database query construction or validation logic
  • Why exploitation is possible: Input may be incorporated into SQL statements without sufficient parameterization, allowing query structure to be altered

Why this happens

The underlying bug is a failure to maintain a strict separation between SQL code and external data. When the checkSQL function constructs or evaluates queries using insufficient parameterization, validation, or escaping, specially crafted input can be interpreted as part of the SQL statement rather than as a data value. This behavior maps to CWE-89: Improper Neutralization of Special Elements used in an SQL Command ('SQL Injection').

Potential impact

  • Attackers may read sensitive database records
  • Database metadata or application configuration may be exposed
  • Unauthorized query behavior could occur within the database account's permissions
  • Data integrity could be affected if the vulnerable context permits write operations
  • Further compromise may be possible when database credentials or stored secrets are accessible

General mitigation guidance

Mitigation generally focuses on eliminating the mixing of SQL syntax and untrusted input.

Common defensive patterns include:

  • Use parameterized queries, prepared statements, or query-builder APIs that keep values separate from SQL structure
  • Apply allowlisted validation for inputs that represent identifiers, operators, or other query components
  • Avoid relying on escaping alone as the primary protection
  • Restrict database accounts to the minimum read and write permissions required
  • Reduce exposure of database errors and sensitive query results
  • Treat client-controlled filters, sorting fields, and query expressions as untrusted by default

How teams detect issues like this

Organizations can identify SQL injection risks through:

  • Static analysis rules for string concatenation or interpolation in SQL construction
  • Code review checks for raw query APIs and dynamic query fragments
  • Tests that verify user-controlled values are passed as parameters rather than embedded in statements
  • Runtime monitoring for anomalous query patterns, unexpected database errors, and unusual data-access volume
  • Policy enforcement that requires approved database-access abstractions for application code

Automated application-security and code-review tools may help identify unsafe query construction, but findings should be validated against the actual data flow and database context.

Sources

SourceLink
github.comgithub.com/czx1111/cve/issues/6

Frequently asked

questions

It may be remotely exploitable when the affected checkSQL functionality is exposed through a reachable application endpoint and accepts attacker-influenced input. The exact scope depends on routing, authentication, and deployment controls.

Authentication requirements depend on the permissions assigned to the relevant NocoBase interface or API. Any account or integration permitted to reach the vulnerable function may be relevant.

Use parameterized queries or a trusted query-builder abstraction, and allow only explicitly permitted values for query components that cannot be parameterized.

Treat all external query inputs as untrusted, enforce least-privilege database permissions, review raw SQL construction, and include SQL injection testing in development and CI security checks.

Find out what's already
exploitable in your codebase.