SQL Injection Affecting @nocobase/database package, versions <2.0.39


Severity

Recommended
0.0
high
0
10

CVSS assessment by Snyk's Security Team. Learn more

Threat Intelligence

Exploit Maturity
Proof of Concept
EPSS
4.21% (89th percentile)

Do your applications use this vulnerable package?

In a few clicks we can analyze your entire application and see what components are vulnerable in your application, and suggest you quick fixes.

Test your applications

Snyk Learn

Learn about SQL Injection vulnerabilities in an interactive lesson.

Start learning
  • Snyk IDSNYK-JS-NOCOBASEDATABASE-16421470
  • published5 May 2026
  • disclosed22 Apr 2026
  • creditp80n-sec

Introduced: 22 Apr 2026

NewCVE-2026-41640  (opens in a new tab)
CWE-89  (opens in a new tab)

How to fix?

Upgrade @nocobase/database to version 2.0.39 or higher.

Overview

@nocobase/database is a

Affected versions of this package are vulnerable to SQL Injection via the queryParentSQL function. An attacker can execute arbitrary SQL commands, extract sensitive data, modify or delete database records, and potentially cause denial of service by injecting malicious input into string-type primary key fields when recursive eager loading is triggered on a tree collection. This is only exploitable if the attacker has permission to create records in a collection with string-type primary keys and recursive eager loading is enabled.

Workaround

This vulnerability can be mitigated by validating primary key values at record creation time and rejecting or escaping values containing SQL metacharacters such as ', ", ;, and --.

CVSS Base Scores

version 4.0
version 3.1