CVE-2026-34938: PraisonAI Python Sandbox Escape via str Subclass startswith() Override
Summary
CVE-2026-34938: PraisonAI: Python Sandbox Escape via str Subclass startswith() Override in execute_code. Affects praisonaiagents versions < 1.5.90. Fixed in 1.5.90. How to fix ↓
Check if this vulnerability affects your application
Upload a manifest or SBOM and we'll show whether you're affected, plus every other risky package in the same scan.
No signup required · Results in about 60 seconds
Background
PraisonAI is an advanced AI framework that allows users to create and manage AI agents. It provides a sandboxed environment for executing Python code safely. However, a critical vulnerability exists in the way it handles string subclasses, which can lead to unauthorized command execution on the host system.
Vulnerability Detail
The vulnerability arises from the execute_code() function in the praisonai-agents package, which runs user-controlled Python code within a three-layer sandbox. An attacker can bypass this sandbox by passing a custom str subclass with an overridden startswith() method to the _safe_getattr function. This allows the attacker to execute arbitrary OS commands, posing a severe risk to the host system. The vulnerability is particularly dangerous because it can be triggered without human confirmation in certain deployment configurations.
How To Fix
Latest published version: 1.7.14 as of 22 Oct 2026
pip install --upgrade "praisonaiagents==1.7.14"
Upgrading to it may include breaking changes; the version below is the minimum fixed release for this vulnerability.
If you need the minimum change
1.5.90
This is the first release that contains the fix.
pip install --upgrade "praisonaiagents==1.5.90"
Tip — Not sure which version your app runs? Vulert can match this fix to it. Scan free →
Workaround
As a temporary workaround, avoid using the execute_code() function with untrusted input. Ensure that any code executed within the PraisonAI environment is thoroughly vetted and does not include any custom string subclasses that could exploit this vulnerability.
Conclusion
CVE-2026-34938 is a critical vulnerability in the PraisonAI framework that allows for arbitrary OS command execution due to improper handling of string subclasses. It is essential to update to the latest version of the package to mitigate this risk and ensure the security of your applications.
See every vulnerability recorded for praisonaiagents →
FAQ
CVE-2026-34938 is a critical vulnerability in the PraisonAI framework that allows attackers to escape a sandboxed environment and execute arbitrary OS commands.
You can use the Vulert playground at Vulert Scanner to check if your application is affected by this vulnerability without needing to sign up.
The CVSS score of this vulnerability is 10.0, indicating a critical severity level.
If you cannot update the package immediately, avoid using the execute_code() function with untrusted input as a temporary workaround.
You can find more information about PraisonAI and its features on its official documentation or GitHub repository.
References
Related vulnerabilities
Recent vulnerabilities recorded for praisonaiagents.