CVEReports
CVEReports

Automated vulnerability intelligence platform. Comprehensive reports for high-severity CVEs generated by AI.

Product

  • Home
  • Sitemap
  • RSS Feed

Company

  • About
  • Contact
  • Privacy Policy
  • Terms of Service

© 2026 CVEReports. All rights reserved.

Made with love by Amit Schendel & Alon Barad



CVE-2026-52887

CVE-2026-52887: Critical SQL Injection and Remote Code Execution in NocoBase

Amit Schendel
Amit Schendel
Senior Security Researcher

Aug 1, 2026·7 min read·59 visits

Executive Summary (TL;DR)

SQL injection via Sequelize.literal in NocoBase's in-app message plugin allows authenticated attackers to execute stacked queries and achieve OS command execution via PostgreSQL.

A critical SQL injection vulnerability exists in the @nocobase/plugin-notification-in-app-message plugin of NocoBase prior to version 2.0.61. The flaw is caused by direct string interpolation of user-controlled input into a Sequelize.literal() query, allowing authenticated users to execute stacked PostgreSQL queries and achieve remote code execution on the underlying database server.

Vulnerability Overview

NocoBase is an open-source, AI-powered no-code and low-code platform designed to build business applications and internal tools. The application architecture relies on a modular plugin system to provide core features, including user management, workflows, and notifications. The vulnerability resides specifically within the @nocobase/plugin-notification-in-app-message plugin, which handles in-app notification channels and messaging capabilities.

This plugin exposes a resource action handler called defineMyInAppChannels, which is routed to the HTTP endpoint GET /api/myInAppChannels:list. This endpoint is designed to allow users to retrieve lists of notification channels, applying server-side filters such as timestamps. Because this endpoint handles notifications, it is exposed to authenticated (signed-up) platform users, creating an internal attack surface.

The vulnerability is classified under CWE-89 (Improper Neutralization of Special Elements used in an SQL Command). Input supplied to the query filters is evaluated in an unsafe raw SQL context. An attacker who has achieved standard user registration on a NocoBase deployment can exploit this flaw to execute arbitrary database queries, bypass security boundaries, and gain complete control over the underlying PostgreSQL server.

Root Cause Analysis

The root cause of CVE-2026-52887 lies in the insecure configuration and utilization of the Sequelize Object-Relational Mapper (ORM). When building relational queries in Sequelize, developers can use abstraction structures like operators (e.g., Op.and, Op.or, Op.lt) or direct queries. However, when complex database-specific functionality is required, developers often resort to using the Sequelize.literal() function.

The Sequelize.literal() function is designed to insert raw SQL fragments directly into the query generator. Because Sequelize treats the input of Sequelize.literal() as trusted developer-defined code, it completely bypasses the built-in sanitization, quoting, and parameterized binding mechanisms. Any string passed into this function is directly concatenated into the final SQL query sent to the database backend.

In the affected versions of NocoBase, the backend extracts query filters directly from the HTTP query parameters using the context action: const { filter = {}, limit = 30 } = ctx.action?.params ?? {};. When processing the filter[latestMsgReceiveTimestamp][$lt] parameter, the application attempts to filter messages by a specified cut-off timestamp. The code checks for the existence of this key and interpolates the raw, unvalidated string directly into the template literal passed to Sequelize.literal(). This direct interpolation merges user input with SQL commands before execution, resulting in an SQL injection vulnerability.

Code Analysis

An analysis of the source code changes in commit 68d64e3fcfb8be2ae4f3bfc9e1ee3f85b87c89ce highlights the exact location of the security flaw and the engineering changes applied to fix it.

Prior to the security patch, the query filter for the timestamp was constructed dynamically using raw string template interpolation:

// VULNERABLE CODE
const latestMsgReceiveTSFilter = filter?.latestMsgReceiveTimestamp?.$lt
  ? Sequelize.literal(`${latestMsgReceiveTimestampSQL} < ${filter.latestMsgReceiveTimestamp.$lt}`)
  : null;

In the vulnerable implementation above, if the client sends a request containing filter[latestMsgReceiveTimestamp][$lt]=1) OR 1=1 --, the string is appended directly to the SQL fragment. This alters the query logic, allowing attackers to access unauthorized resources or execute stacked commands.

The patch addresses this vulnerability by introducing strict schema enforcement and refactoring the query interface to use standard Sequelize validation rules and parameter binding:

// SECURE PATCH IMPLEMENTATION
function parseLatestMsgReceiveTimestampLt(filter: unknown) {
  const latestMsgReceiveTimestamp =
    typeof filter === 'object' && filter !== null
      ? (filter as { latestMsgReceiveTimestamp?: unknown }).latestMsgReceiveTimestamp
      : null;
  if (
    typeof latestMsgReceiveTimestamp !== 'object' ||
    latestMsgReceiveTimestamp === null ||
    !Object.prototype.hasOwnProperty.call(latestMsgReceiveTimestamp, '$lt')
  ) {
    return null;
  }
 
  const value = (latestMsgReceiveTimestamp as { $lt?: unknown }).$lt;
  if (typeof value === 'string' && value.trim() === '') {
    throw new Error('Invalid latest message receive timestamp filter');
  }
  if (typeof value !== 'number' && typeof value !== 'string') {
    throw new Error('Invalid latest message receive timestamp filter');
  }
 
  const timestamp = Number(value);
  if (!Number.isFinite(timestamp)) {
    throw new Error('Invalid latest message receive timestamp filter');
  }
 
  return timestamp;
}

Additionally, the patch replaces the Sequelize.literal() comparison with an explicit Sequelize operator construct:

// SECURE PATCH IMPLEMENTATION (FILTER GENERATION)
const latestMsgReceiveTSFilter =
  latestMsgReceiveTimestampLt !== null
    ? Sequelize.where(Sequelize.literal(latestMsgReceiveTimestampSQL), Op.lt, latestMsgReceiveTimestampLt)
    : null;

By leveraging Sequelize.where combined with Op.lt, the application safely maps the strictly-validated floating point number latestMsgReceiveTimestampLt to a bound database parameter. Because the database driver executes this as a prepared parameter, the input is never evaluated as raw SQL. The remediation is highly complete because the type-casting helper actively rejects non-numeric strings, blocking any payload containing SQL syntax.

Exploitation & Attack Methodology

To successfully exploit this vulnerability, an attacker requires network access to the NocoBase API endpoint and valid session credentials. In many default NocoBase deployments, public user registration is enabled, allowing anyone to register a basic account and acquire an active JSON Web Token (JWT) session.

The attack begins by crafting an HTTP GET request targeting /api/myInAppChannels:list with an engineered filter query parameter. Since the database engine behind NocoBase is typically PostgreSQL, and the Node.js database connector (node-pg) permits stacked queries by default, statements can be chained using a semicolon.

An attacker can execute administrative tasks or shell commands on the server by leveraging PostgreSQL's COPY ... TO PROGRAM directive. This command spawns an OS shell and executes arbitrary commands as the database runtime user. The following payload sequence illustrates this attack pathway:

GET /api/myInAppChannels:list?filter[latestMsgReceiveTimestamp][$lt]=1); COPY (SELECT 'exploit') TO PROGRAM 'id' -- HTTP/1.1
Host: target-nocobase.local
Authorization: Bearer <JWT_TOKEN>

If the database connection possesses sufficient privileges (which is common in containerized environments where the database user is configured as postgres or superuser), the injected OS command executes within the context of the database container, leading to Remote Code Execution.

Technical Impact Assessment

The technical impact of CVE-2026-52887 is evaluated as Critical, carrying a maximum CVSS v3.1 Base Score of 10.0. The vulnerability allows an authenticated attacker to execute arbitrary command structures inside the environment, resulting in a total compromise of confidentiality, integrity, and availability.

While the CVSS vector assigns 'Privileges Required: None' in some databases, the vulnerability requires authenticated access. However, because self-registration is often exposed on low-code platforms, this prerequisite is easily satisfied. The scope is defined as Changed (S:C) because exploitation allows an attacker to transition from the application database security context directly to the container's operating system environment.

In deployments utilizing standard Docker Compose files, the PostgreSQL process frequently runs with administrative privileges. This design flaw allows an attacker to compromise the entire container network, extract database credentials, manipulate application source files, or initiate lateral movement into the cloud hosting environment.

Remediation & Defensive Controls

The primary defense against CVE-2026-52887 is updating NocoBase to version 2.0.61 or later, which incorporates the structural type validation and parameter binding patches. If an immediate upgrade is not feasible, several defensive controls can be implemented to mitigate risk.

First, restrict PostgreSQL database permissions. Ensure the database user used by NocoBase is not configured with SUPERUSER privileges. Execute the following SQL commands to revoke dangerous execution permissions from application databases:

ALTER USER nocobase WITH NOSUPERUSER;
REVOKE EXECUTE ON FUNCTION pg_read_file(text) FROM public;
REVOKE EXECUTE ON FUNCTION pg_write_file(text, text, boolean) FROM public;

Second, deploy Web Application Firewall (WAF) rules to inspect incoming query parameters on the affected endpoint. The following ModSecurity rule can be utilized to block malicious patterns in the timestamp filter:

SecRule REQUEST_FILENAME "@rx /api/myInAppChannels:list" \
    "id:100001,phase:2,deny,status:400,log,msg:'Block SQLi in myInAppChannels Filter',\
    chain"
    SecRule ARGS:filter[latestMsgReceiveTimestamp][$lt] "@rx [^0-9]" "t:none"

Implementing these controls reduces the attack surface, preventing exploitation of raw string interpolation before a platform-wide patch is applied.

Official Patches

nocobaseCore repair commit implementing safe typecasting and binding.

Fix Analysis (2)

Technical Appendix

CVSS Score
10.0/ 10
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:C/C:H/I:H/A:H
EPSS Probability
0.59%
Top 55% most exploited

Affected Systems

NocoBase installations prior to version 2.0.61 running the @nocobase/plugin-notification-in-app-message plugin

Affected Versions Detail

Product
Affected Versions
Fixed Version
@nocobase/plugin-notification-in-app-message
nocobase
< 2.0.612.0.61
AttributeDetail
CWE IDCWE-89
Attack VectorNetwork (AV:N)
CVSS Score10.0 (Critical)
EPSS Score0.00593 (Percentile: 44.98%)
ImpactRemote Code Execution (RCE) / Full Database Compromise
Exploit StatusProof of Concept (PoC)
KEV StatusNot Listed

MITRE ATT&CK Mapping

T1190Exploit Public-Facing Application
Initial Access
CWE-89
Improper Neutralization of Special Elements used in an SQL Command ('SQL Injection')

The software constructs all or part of an SQL command using externally-influenced input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could modify the intended SQL command when it is sent to a downstream database.

Known Exploits & Detection

GitHub AdvisoryOfficial Security Advisory detailing technical mechanisms and mitigation routes.

References & Sources

  • [1]GitHub Security Advisory GHSA-p849-8hwh-84j9
  • [2]NocoBase Code Fix Commit 68d64e3fcfb
  • [3]CVE-2026-52887 Record

Attack Flow Diagram

Press enter or space to select a node. You can then use the arrow keys to move the node around. Press delete to remove it and escape to cancel.
Press enter or space to select an edge. You can then press delete to remove it or escape to cancel.

More Reports

•about 1 hour ago•GHSA-CJCG-CXMH-9WCR
7.5

GHSA-cjcg-cxmh-9wcr: Unbounded Memory Allocation via HTTP/2 Bomb in praxis-proxy

A critical vulnerability exists in the praxis-proxy library where the omission of default limits on HTTP/2 server options allows remote attackers to trigger a Denial of Service (DoS) using an HPACK compression bomb and flow-control window stalls. This vulnerability is cataloged as GHSA-cjcg-cxmh-9wcr.

Amit Schendel
Amit Schendel
1 views•7 min read
•about 2 hours ago•GHSA-MWM8-39RW-8826
8.1

GHSA-MWM8-39RW-8826: Use-After-Free Vulnerability in Ruby sqlite3 Gem native extension

A Use-After-Free (UAF) vulnerability exists in the sqlite3-ruby native C extension when marshaling arguments for user-defined SQLite aggregate functions with multiple arguments. Due to temporary heap-allocated argument arrays not being registered with the Ruby Garbage Collector, active objects can be prematurely reclaimed, resulting in memory corruption or process-level crashes.

Alon Barad
Alon Barad
2 views•7 min read
•about 3 hours ago•CVE-2026-19484
7.5

CVE-2026-19484: Remote Denial of Service via Boyer-Moore-Horspool Integer Wrap-around in @fastify/busboy

An unauthenticated remote denial of service vulnerability exists in @fastify/busboy versions 3.1.0 through 3.2.0. The vulnerability is caused by an integer wrap-around in the Boyer-Moore-Horspool algorithm implementation inside the sbmh submodule when initializing skip distances. When processing a specific boundary of 252 bytes, the parser triggers an infinite loop, stalling the single-threaded Node.js event loop and exhausting CPU resources.

Alon Barad
Alon Barad
6 views•6 min read
•about 4 hours ago•CVE-2026-19481
7.5

CVE-2026-19481: Unauthenticated Remote Denial of Service via Prototype Lookup Crash in @fastify/busboy

A critical remote, unauthenticated Denial of Service (DoS) vulnerability in @fastify/busboy (<= 3.2.0) allows attackers to crash the Node.js process. By submitting a crafted multipart/form-data request with a header key matching an inherited property of Object.prototype (like __proto__ or constructor), the internal HeaderParser triggers a synchronous TypeError.

Amit Schendel
Amit Schendel
4 views•7 min read
•about 5 hours ago•GHSA-P23F-CM6Q-2QP8
8.6

GHSA-P23F-CM6Q-2QP8: Workspace Boundary Bypass and Arbitrary File Leak in SiYuan MCP

SiYuan is an open-source personal knowledge management system. Its Model Context Protocol (MCP) implementation within the asset.upload tool contains a path-traversal and workspace boundary bypass flaw. This allows remote AI models—acting on behalf of attackers via malicious prompts or documents—to import and read sensitive host-system files, such as private keys and system configurations, through absolute path inputs.

Alon Barad
Alon Barad
5 views•6 min read
•about 6 hours ago•GHSA-X8GV-G2G3-65FJ
8.2

CVE-2026-82234: Server-Side Request Forgery via DNS-Rebinding TOCTOU in SiYuan Kernel

An Server-Side Request Forgery (SSRF) vulnerability via DNS-Rebinding Time-of-Check to Time-of-Use (TOCTOU) has been discovered in SiYuan (思源笔记), an open-source personal knowledge management system. The flaw exists within the AI Agent tools http_request (util.HTTPRequest) and web_fetch (util.WebFetch) of the SiYuan Kernel, allowing unauthenticated remote attackers to bypass SSRF validation and access private internal services or cloud metadata endpoints.

Amit Schendel
Amit Schendel
5 views•7 min read