CVE-2026-57141: PraisonAI codeMode tool remote code execution via sandbox escape

CVE-2026-57141 · Severity: critical · CVSS 9.8 · Published 2026-09-15

PraisonAI's codeMode tool allows AI agents to execute code for task automation. An attacker can craft malicious prompts that break out of the sandbox isolation and execute arbitrary commands on the server with full system access, including file theft, credential exfiltration, and installing backdoors.

Technologies: praisonai (npm). Vendors: npm.

Quick answers

Is CVE-2026-57141 exploited in the wild?
No. Junglewise Threat Intelligence has no report of CVE-2026-57141 being exploited in the wild.
How severe is CVE-2026-57141?
Critical severity, with a CVSS score of 9.8, published 15 September 2026.
Which products and versions are affected?
praisonai (npm) SEMVER:introduced=0,fixed=1.7.2.
Is there a fix for CVE-2026-57141?
Yes. praisonai (npm): upgrade to 1.7.2 or later. Junglewise finds every place you run it, drafts the upgrade and applies it once you approve.
How is CVE-2026-57141 attacked?
It is attacked over the network.
Am I affected by CVE-2026-57141?
Check whether you run praisonai (npm) at an affected version. Junglewise does that check for you around the clock: connect your code, cloud and domains, and it matches new vulnerabilities like this one against what you actually run and tells you when one reaches you.

How to fix

  • praisonai (npm): upgrade to 1.7.2 or later
    npm install praisonai@1.7.2

Technical details

The vulnerability is an unsafe code execution in the codeMode tool (src/praisonai-ts/src/tools/builtins/code-mode.ts), which uses JavaScript's new Function() with a with(sandbox) pattern to execute LLM-generated code. The with statement does not isolate the scope—attackers can bypass it via Function('return this')() to recover the global object and access require(), then evade the regex blocklist by breaking apart module names via string concatenation (e.g., require('child_' + 'process')). The blocklist patterns are incomplete and do not cover Function constructors or prototype access. An attacker who can influence prompts to the AI agent achieves full RCE as the process user. The fix requires replacing the with(sandbox) + blocklist pattern with proper VM isolation (vm.createContext or isolated-vm) or subprocess execution with resource limits.

Affected products

  • Mervin Praison PraisonAI <=1.7.1

Identifiers

  • CVE-2026-57141
  • GHSA-p69m-4f92-2v84

Timeline

  • 2026-06-18: disclosed
  • 2026-06-18: patched: Patch available in version 1.7.2 or later

References

This page as Markdown. Free to reuse under CC BY 4.0 with a link back.