CVE-2026-57138: PraisonAI codeMode sandbox escape via Function constructor

Published Sep 15, 2026
·
Updated

PraisonAI is a multi-agent teams system. From 1.4.0 until 1.7.2, codeMode in src/praisonai-ts/src/tools/builtins/code-mode.ts executes untrusted JavaScript with new Function() inside with(sandbox) and relies on a small source-code blocklist plus shadowed process and require properties. Code can use ({}).constructor.constructor to recover the real Function constructor, obtain process and process.mainModule.require, and reach host filesystem and subprocess APIs despite the advertised sandbox. Attackers who control codeMode input can read secrets, modify files, execute commands, or exhaust the host process. This issue is fixed in version 1.7.2.

Affected Software

1 affected component
PraisonAI>=1.4.0<=1.7.2

Remediation

Recommended actions to resolve this vulnerability, in priority order.

  1. Upgrade

    Upgrade src/praisonai-ts/src/tools/builtins/code-mode.ts (codeMode sandbox) to a version that resolves this vulnerability.

    Fixed in 1.7.2

Event History

Sep 15, 2026
CVE Published
via MITRE·10:22 AM
Data Sourced
via MITRE·10:22 AM
DescriptionSeverityWeakness

Frequently Asked Questions

1

What access does an attacker need to exploit this issue?

An attacker must be able to control input executed by codeMode. No user interaction is required once they can supply that code.

2

Which deployments should be updated?

PraisonAI versions from 1.4.0 until the fixed 1.7.2 release are affected. Update to version 1.7.2.

3

What could successful exploitation allow?

An attacker can escape the advertised sandbox and access host filesystem and subprocess APIs. This can enable reading secrets, modifying files, executing commands, or exhausting the host process.

Contact

SecAlerts Pty Ltd.
132 Wickham Terrace
Fortitude Valley,
QLD 4006, Australia
info@secalerts.co
By using SecAlerts services, you agree to our services end-user license agreement. This website is safeguarded by reCAPTCHA and governed by the Google Privacy Policy and Terms of Service. All names, logos, and brands of products are owned by their respective owners, and any usage of these names, logos, and brands for identification purposes only does not imply endorsement. If you possess any content that requires removal, please get in touch with us.
© 2026 SecAlerts Pty Ltd.
ABN: 70 645 966 203, ACN: 645 966 203