Security Digest · Vulnerability record
CVE-2026-57141: PraisonAI: Remote Code Execution via Sandbox Escape in `codeMode` Tool
PraisonAI is a multi-agent teams system. Prior to 1.7.2, the codeMode tool in src/praisonai-ts/src/tools/builtins/code-mode.ts executes model-generated JavaScript with new Function() and with(sandbox), while a regular-expression blocklist can be bypassed with Function('return this')() to recover the global object and…
CVSS 9.8 Critical EPSS 0.7% · p54
Should you act?
Critical and remotely reachable
No known exploitation yet, but it is network-reachable without credentials. This signal is computed from CISA KEV, EPSS and CVSS data; it is not an editorial verdict.
- No confirmed exploitation. It is not in CISA’s KEV catalog and CISA’s SSVC assessment records no known exploitation. That can change quickly after a public write-up; re-check if you are affected.
- EPSS 0.7%, percentile 54: FIRST’s model estimates a 0.7% chance of exploitation activity in the next 30 days, higher than 54% of all scored CVEs (moderate). EPSS is a probability, not a verdict.
- Remotely reachable with no login and no user interaction. If the vulnerable service is exposed to the internet, prioritize it.
- Only applies if your dependency tree includes
praisonai(npm) <= 1.7.1, fixed in 1.7.2. Check your lockfile, including transitive dependencies.
What it is
PraisonAI is a multi-agent teams system. Prior to 1.7.2, the codeMode tool in src/praisonai-ts/src/tools/builtins/code-mode.ts executes model-generated JavaScript with new Function() and with(sandbox), while a regular-expression blocklist can be bypassed with Function('return this')() to recover the global object and by constructing the childprocess module name dynamically. An attacker who can influence the code argument can access host process capabilities, read or write files, obtain environment credentials, and execute operating-system commands with the PraisonAI process privileges. This issue is fixed in version 1.7.2.
From the GitHub advisory
Summary
The codeMode tool in src/praisonai-ts/src/tools/builtins/code-mode.ts uses new Function() with a with(sandbox) pattern to execute LLM-generated code. The blocklist-based "sandbox" can be trivially bypassed via Function('return this')() to recover the global object, followed by global.require() with string concatenation to evade the blocklist regex. This allows full arbitrary code execution on the host system. This affects all deployments where the code-mode tool is enabled for agents. Details Vulnerable code (lines 187–191):
The code parameter comes from LLM tool call arguments (the execute method at line 104). Before execution, a regex-based blocklist is applied (lines 108–136):
Three fundamental weaknesses:
1. with(sandbox) does not provide isolation. The with statement in JavaScript adds an object to the scope chain but does NOT prevent accessing the global object. The sandbox object sets process: undefined and require: undefined, but these are recovered via the global scope:
Weakness type: CWE-94.
Product: praisonai (npm) · Assigned by: GitHub_M · Published: 2026-09-15
Affected and fixed versions
| Ecosystem | Package | Vulnerable | First fixed |
|---|---|---|---|
| npm | praisonai | <= 1.7.1 | 1.7.2 |
| Vendor | Product | Affected versions (per CVE record) |
|---|---|---|
| MervinPraison | PraisonAI | < 1.7.2 |
Severity scores
| Scored by | CVSS | Score | Vector |
|---|---|---|---|
| GitHub_M | 3.1 | 9.8 Critical | CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H |
| GitHub | 3.1 | 9.8 | CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H |
- Attack vector: network (remotely reachable)
- Attack complexity: low
- Privileges required: none (no login)
- User interaction: none
- Scope: unchanged
CVSS measures how bad a flaw is if exploited, not how likely exploitation is. Read it next to the exploitation data below.
Exploitation and urgency
- CISA KEV: not listed (no confirmed in-the-wild exploitation known to CISA).
- CISA SSVC assessment: exploitation none, automatable yes, technical impact total.
- FIRST EPSS (model of 2026-10-21): 0.74% probability of exploitation activity in the next 30 days; percentile 54.
Timeline
- — GitHub-reviewed advisory GHSA-p69m-4f92-2v84 published (critical)
- — CVE record last updated
- — CVE record published by GitHub_M
Sources and references
Original sources first. Version and fix details should always be confirmed against the vendor or project advisory.
Vulnerability records
- GitHub Advisory GHSA-p69m-4f92-2v84 github.com
- CVE.org record CVE-2026-57141 cve.org
- NVD entry CVE-2026-57141 nvd.nist.gov
Other references from the CVE record and advisory
- github.com github.com
- github.com github.com
- github.com github.com