Advisory Database
  • Advisories
  • Dependency Scanning
  1. npm
  2. ›
  3. praisonai
  4. ›
  5. GHSA-vmmj-pfw7-fjwp

GHSA-vmmj-pfw7-fjwp: npm PraisonAI codeMode sandbox escape via Function constructor

June 18, 2026

The published npm package praisonai exports a TypeScript built-in tool named codeMode. The package describes this tool as executing code in a sandboxed environment, marks its capability as sandbox: true, and registers it through the public tools facade.

The implementation does not create an isolation boundary. It applies a small regular-expression blocklist, sets process and require to undefined inside a plain JavaScript object, and then executes attacker-controlled code with the host process new Function constructor:

const fn = new Function('sandbox', `with (sandbox) { ${code} }`);
const result = fn(sandbox);

Because this runs in the host V8 context, code inside codeMode can use the JavaScript prototype chain to recover the real Function constructor:

({}).constructor.constructor('return process')()

From a normal CommonJS application script, the recovered process object exposes process.mainModule.require. That bypasses the explicit require('fs') and require('child_process') controls and allows host filesystem access and subprocess execution from code that was supposed to be sandboxed.

References

  • github.com/MervinPraison/PraisonAI/security/advisories/GHSA-vmmj-pfw7-fjwp
  • github.com/advisories/GHSA-vmmj-pfw7-fjwp

Code Behaviors & Features

Detect and mitigate GHSA-vmmj-pfw7-fjwp with GitLab Dependency Scanning

Secure your software supply chain by verifying that all open source dependencies used in your projects contain no disclosed vulnerabilities. Learn more about Dependency Scanning →

Affected versions

All versions starting from 1.4.0 before 1.7.2

Fixed versions

  • 1.7.2

Solution

Upgrade to version 1.7.2 or above.

Impact 9.9 CRITICAL

CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:C/C:H/I:H/A:H

Learn more about CVSS

Weakness

  • CWE-184: Incomplete List of Disallowed Inputs
  • CWE-693: Protection Mechanism Failure

Source file

npm/praisonai/GHSA-vmmj-pfw7-fjwp.yml

Spotted a mistake? Edit the file on GitLab.

  • Site Repo
  • About GitLab
  • Terms
  • Privacy Statement
  • Contact

Page generated Tue, 23 Jun 2026 12:24:02 +0000.