The SentinelOne Annual Threat Report - A Defenders Guide from the FrontlinesThe SentinelOne Annual Threat ReportGet the Report
Experiencing a Breach?Blog
Get StartedContact Us
SentinelOne
  • Platform
    Platform Overview
    • Singularity Platform
      Welcome to Integrated Enterprise Security
    • AI for Security
      Leading the Way in AI-Powered Security Solutions
    • Securing AI
      Accelerate AI Adoption with Secure AI Tools, Apps, and Agents.
    • How It Works
      The Singularity XDR Difference
    • Singularity Marketplace
      One-Click Integrations to Unlock the Power of XDR
    • Pricing & Packaging
      Comparisons and Guidance at a Glance
    Data & AI
    • Purple AI
      Accelerate SecOps with Generative AI
    • Singularity Hyperautomation
      Easily Automate Security Processes
    • AI-SIEM
      The AI SIEM for the Autonomous SOC
    • AI Data Pipelines
      Security Data Pipeline for AI SIEM and Data Optimization
    • Singularity Data Lake
      AI-Powered, Unified Data Lake
    • Singularity Data Lake for Log Analytics
      Seamlessly Ingest Data from On-Prem, Cloud or Hybrid Environments
    Endpoint Security
    • Singularity Endpoint
      Autonomous Prevention, Detection, and Response
    • Singularity XDR
      Native & Open Protection, Detection, and Response
    • Singularity RemoteOps Forensics
      Orchestrate Forensics at Scale
    • Singularity Threat Intelligence
      Comprehensive Adversary Intelligence
    • Singularity Vulnerability Management
      Application & OS Vulnerability Management
    • Singularity Identity
      Identity Threat Detection and Response
    Cloud Security
    • Singularity Cloud Security
      Block Attacks with an AI-Powered CNAPP
    • Singularity Cloud Native Security
      Secure Cloud and Development Resources
    • Singularity Cloud Workload Security
      Real-Time Cloud Workload Protection Platform
    • Singularity Cloud Data Security
      AI-Powered Threat Detection for Cloud Storage
    • Singularity Cloud Security Posture Management
      Detect and Remediate Cloud Misconfigurations
    Securing AI
    • Prompt Security
      Secure AI Tools Across Your Enterprise
  • Why SentinelOne?
    Why SentinelOne?
    • Why SentinelOne?
      Cybersecurity Built for What’s Next
    • Our Customers
      Trusted by the World’s Leading Enterprises
    • Industry Recognition
      Tested and Proven by the Experts
    • About Us
      The Industry Leader in Autonomous Cybersecurity
    Compare SentinelOne
    • Arctic Wolf
    • Broadcom
    • CrowdStrike
    • Cybereason
    • Microsoft
    • Palo Alto Networks
    • Sophos
    • Splunk
    • Trellix
    • Trend Micro
    • Wiz
    Verticals
    • Energy
    • Federal Government
    • Finance
    • Healthcare
    • Higher Education
    • K-12 Education
    • Manufacturing
    • Retail
    • State and Local Government
  • Services
    Managed Services
    • Managed Services Overview
      Wayfinder Threat Detection & Response
    • Threat Hunting
      World-Class Expertise and Threat Intelligence
    • Managed Detection & Response
      24/7/365 Expert MDR Across Your Entire Environment
    • Incident Readiness & Response
      DFIR, Breach Readiness, & Compromise Assessments
    Support, Deployment, & Health
    • Technical Account Management
      Customer Success with Personalized Service
    • SentinelOne GO
      Guided Onboarding & Deployment Advisory
    • SentinelOne University
      Live and On-Demand Training
    • Services Overview
      Comprehensive Solutions for Seamless Security Operations
    • SentinelOne Community
      Community Login
  • Partners
    Our Network
    • MSSP Partners
      Succeed Faster with SentinelOne
    • Singularity Marketplace
      Extend the Power of S1 Technology
    • Cyber Risk Partners
      Enlist Pro Response and Advisory Teams
    • Technology Alliances
      Integrated, Enterprise-Scale Solutions
    • SentinelOne for AWS
      Hosted in AWS Regions Around the World
    • Channel Partners
      Deliver the Right Solutions, Together
    • SentinelOne for Google Cloud
      Unified, Autonomous Security Giving Defenders the Advantage at Global Scale
    • Partner Locator
      Your Go-to Source for Our Top Partners in Your Region
    Partner Portal→
  • Resources
    Resource Center
    • Case Studies
    • Data Sheets
    • eBooks
    • Reports
    • Videos
    • Webinars
    • Whitepapers
    • Events
    View All Resources→
    Blog
    • Feature Spotlight
    • For CISO/CIO
    • From the Front Lines
    • Identity
    • Cloud
    • macOS
    • SentinelOne Blog
    Blog→
    Tech Resources
    • SentinelLABS
    • Ransomware Anthology
    • Cybersecurity 101
  • About
    About SentinelOne
    • About SentinelOne
      The Industry Leader in Cybersecurity
    • Investor Relations
      Financial Information & Events
    • SentinelLABS
      Threat Research for the Modern Threat Hunter
    • Careers
      The Latest Job Opportunities
    • Press & News
      Company Announcements
    • Cybersecurity Blog
      The Latest Cybersecurity Threats, News, & More
    • FAQ
      Get Answers to Our Most Frequently Asked Questions
    • DataSet
      The Live Data Platform
    • S Foundation
      Securing a Safer Future for All
    • S Ventures
      Investing in the Next Generation of Security, Data and AI
  • Pricing
Get StartedContact Us
CVE Vulnerability Database
Vulnerability Database/CVE-2026-41640

CVE-2026-41640: NocoBase SQL Injection Vulnerability

CVE-2026-41640 is a SQL injection flaw in NocoBase that allows attackers to inject malicious SQL through crafted primary key values. This article covers the technical details, affected versions, and mitigation steps.

Published: May 7, 2026

CVE-2026-41640 Overview

CVE-2026-41640 is a SQL injection vulnerability in NocoBase, an AI-powered no-code/low-code platform for building business applications. The flaw resides in the queryParentSQL() function within the core database package, which constructs a recursive Common Table Expression (CTE) query by concatenating nodeIds values directly into the SQL string instead of using parameterized queries. Because 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. The injection triggers when any subsequent request invokes recursive eager loading on that collection. NocoBase patched the issue in version 2.0.39.

Critical Impact

Authenticated attackers can execute arbitrary SQL statements against the backing database, leading to data exfiltration, modification, or full database compromise.

Affected Products

  • NocoBase versions prior to 2.0.39
  • The @nocobase/database core package (packages/core/database)
  • The @nocobase/plugin-field-sort plugin (packages/plugins/@nocobase/plugin-field-sort)

Discovery Timeline

  • 2026-05-07 - CVE CVE-2026-41640 published to NVD
  • 2026-05-07 - Last updated in NVD database

Technical Details for CVE-2026-41640

Vulnerability Analysis

The vulnerability is a stored, second-order SQL injection classified as [CWE-89]. NocoBase uses Sequelize to perform recursive eager loading for self-referencing tree collections. The queryParentSQL() function in packages/core/database/src/eager-loading/eager-loading-tree.ts builds a WITH RECURSIVE cte query that filters by IN (...) against a list of nodeIds. These IDs are joined as quoted string literals rather than bound parameters. An attacker who has permission to create or modify records on a tree-enabled collection can submit a crafted primary key value containing single quotes and SQL syntax. The payload sits dormant until any user, including privileged ones, triggers an operation that loads the tree, at which point the database executes the injected SQL.

Root Cause

The root cause is unsafe string interpolation of user-controllable values into a raw SQL statement. The original code used nodeIds.join("','") to flatten the array into the IN clause, trusting that primary key values were safe. Because primary keys can be user-supplied strings, this assumption fails and breaks the trust boundary between data and code.

Attack Vector

Exploitation requires network access and low-privileged authenticated access sufficient to insert a record into a collection that participates in recursive eager loading. The attacker stores a payload such as 1') OR 1=1 -- as a primary key. When the application later resolves parent relationships for that collection, the injected fragment becomes part of the executed CTE query.

typescript
// Source: https://github.com/nocobase/nocobase/commit/202e2b8efe44ba90adbf1087f6f70881ff947604
// Patch in packages/core/database/src/eager-loading/eager-loading-tree.ts
  const queryInterface = db.sequelize.getQueryInterface();
  const q = queryInterface.quoteIdentifier.bind(queryInterface);
- return `WITH RECURSIVE cte AS (
+ const placeholders = nodeIds.map((_, index) => `$${index + 1}`).join(', ');
+ return {
+   sql: `WITH RECURSIVE cte AS (
      SELECT ${q(targetKeyField)}, ${q(foreignKeyField)}
      FROM ${tableName}
-     WHERE ${q(targetKeyField)} IN ('${nodeIds.join("','")}')
+     WHERE ${q(targetKeyField)} IN (${placeholders})
      UNION ALL
      SELECT t.${q(targetKeyField)}, t.${q(foreignKeyField)}
      FROM ${tableName} AS t
      INNER JOIN cte ON t.${q(targetKeyField)} = cte.${q(foreignKeyField)}
      )
-     SELECT ${q(targetKeyField)} AS ${q(targetKey)}, ${q(foreignKeyField)} AS ${q(foreignKey)} FROM cte`;
+     SELECT ${q(targetKeyField)} AS ${q(targetKey)}, ${q(foreignKeyField)} AS ${q(foreignKey)} FROM cte`,
+   bind: nodeIds,
+ };

The patch replaces inline string concatenation with positional bind placeholders ($1, $2, ...) and passes nodeIds through the Sequelize bind array, ensuring the database driver escapes values. A parallel fix in packages/plugins/@nocobase/plugin-field-sort/src/server/sort-field.ts applies the same parameterization pattern to scope value filtering.

Detection Methods for CVE-2026-41640

Indicators of Compromise

  • Database records containing primary key values with single quotes, parentheses, SQL keywords (UNION, SELECT, --), or comment sequences.
  • Database error log entries referencing malformed WITH RECURSIVE cte statements originating from the NocoBase application user.
  • Anomalous query patterns from the NocoBase service account that include subqueries or UNION clauses inside recursive CTEs.

Detection Strategies

  • Inspect database audit logs for queries matching the pattern WITH RECURSIVE cte AS whose IN (...) clause contains unusually long string literals or nested quotes.
  • Review HTTP request logs for record-create and record-update API calls where primary key fields contain non-alphanumeric metacharacters.
  • Run integrity checks on tree-enabled collections to find primary keys that violate expected formats (UUIDs, integers, slugs).

Monitoring Recommendations

  • Enable PostgreSQL or MySQL statement logging for the NocoBase service account and forward to a centralized log platform for correlation.
  • Alert on application-level exceptions raised by Sequelize when parsing CTE results, which often indicate injection attempts.
  • Track creation events on collections that have recursive parent-child relationships and review high-volume insert activity from a single account.

How to Mitigate CVE-2026-41640

Immediate Actions Required

  • Upgrade all NocoBase deployments to version 2.0.39 or later, which contains the parameterized query fix.
  • Audit existing records in tree-enabled collections for primary keys containing SQL metacharacters and quarantine suspicious entries.
  • Restrict record creation permissions on tree collections to trusted roles until the upgrade is complete.
  • Rotate database credentials if log review indicates the vulnerability was exploited prior to patching.

Patch Information

The fix is delivered in NocoBase v2.0.39. See the GitHub Security Advisory GHSA-4948-f92q-f432, the GitHub Pull Request #9133, the fix commit 202e2b8, and the v2.0.39 release notes. The patch converts IN (...) clauses to positional bind placeholders and routes user-supplied values through Sequelize's bind mechanism.

Workarounds

  • If immediate patching is not possible, enforce strict server-side validation on primary key fields to reject any value containing quotes, semicolons, or SQL keywords.
  • Apply database-level least privilege so the NocoBase service account cannot read sensitive tables or execute administrative statements.
  • Place a Web Application Firewall rule in front of NocoBase to block request bodies whose ID fields contain SQL injection signatures.
bash
# Upgrade NocoBase to the patched release
npm install @nocobase/[email protected]
yarn nocobase upgrade
# Verify the installed version
yarn nocobase --version

Disclaimer: This content was generated using AI. While we strive for accuracy, please verify critical information with official sources.

  • Vulnerability Details
  • TypeSQLI

  • Vendor/TechNocobase

  • SeverityHIGH

  • CVSS Score7.5

  • Known ExploitedNo
  • CVSS Vector
  • CVSS:3.1/AV:N/AC:H/PR:L/UI:N/S:U/C:H/I:H/A:H
  • Impact Assessment
  • ConfidentialityHigh
  • IntegrityNone
  • AvailabilityHigh
  • CWE References
  • CWE-89
  • Technical References
  • GitHub Commit Update

  • GitHub Pull Request

  • GitHub Release v2.0.39

  • GitHub Security Advisory GHSA-4948
  • Related CVEs
  • CVE-2026-41641: NocoBase SQL Injection Vulnerability

  • CVE-2026-34825: NocoBase Workflow SQL Injection Vulnerability

  • CVE-2026-40346: NocoBase SSRF Vulnerability

  • CVE-2026-6224: NocoBase Workflow JavaScript RCE Vulnerability
Default Legacy - Prefooter | Experience the World’s Most Advanced Cybersecurity Platform

Experience the World’s Most Advanced Cybersecurity Platform

See how our intelligent, autonomous cybersecurity platform can protect your organization now and into the future.

Try SentinelOne
  • Get Started
  • Get a Demo
  • Product Tour
  • Why SentinelOne
  • Pricing & Packaging
  • FAQ
  • Contact
  • Contact Us
  • Customer Support
  • SentinelOne Status
  • Language
  • Platform
  • Singularity Platform
  • Singularity Endpoint
  • Singularity Cloud
  • Singularity AI-SIEM
  • Singularity Identity
  • Singularity Marketplace
  • Purple AI
  • Services
  • Wayfinder TDR
  • SentinelOne GO
  • Technical Account Management
  • Support Services
  • Verticals
  • Energy
  • Federal Government
  • Finance
  • Healthcare
  • Higher Education
  • K-12 Education
  • Manufacturing
  • Retail
  • State and Local Government
  • Cybersecurity for SMB
  • Resources
  • Blog
  • Labs
  • Case Studies
  • Videos
  • Product Tours
  • Events
  • Cybersecurity 101
  • eBooks
  • Webinars
  • Whitepapers
  • Press
  • News
  • Ransomware Anthology
  • Company
  • About Us
  • Our Customers
  • Careers
  • Partners
  • Legal & Compliance
  • Security & Compliance
  • Investor Relations
  • S Foundation
  • S Ventures

©2026 SentinelOne, All Rights Reserved.

Privacy Notice Terms of Use

English