Read the docs
TI-2026-28973 Aliases CVE-2026-40158GHSA-3c4r-6p77-xwr7

PraisonAI has Improper Control of Generation of Code ('Code Injection') and Protection Mechanism Failure in praisonai

Priority HIGH 72CWE-693Published · Updated

Key facts

Attack vector
Local
Privileges required
None
User interaction
Required
Attack complexity
Low
Impact type
Security bypass, Code execution
Confidentiality · integrity · availability
High · High · High
Fix status
Fixed

Attack profile from CVSS 3.1 · CNA. Fix status from CNA and GitHub. Impact type from CWE-693 and CWE-94.

Summary

PraisonAI is a multi-agent teams system. Prior to 4.5.128, PraisonAI's AST-based Python sandbox can be bypassed using type.__getattribute__ trampoline, allowing arbitrary code execution when running untrusted agent code. The _execute_code_direct function in praisonaiagents/tools/python_tools.py uses AST filtering to block dangerous Python attributes like __subclasses__, __globals__, and __bases__. However, the filter only checks ast.Attribute nodes, allowing a bypass. The sandbox relies on AST-based filtering of attribute access but fails to account for dynamic attribute resolution via built-in methods such as type.getattribute, resulting in incomplete enforcement of security restrictions. The string '__subclasses__' is an ast.Constant, not an ast.Attribute, so it is never checked against the blocked list. This vulnerability is fixed in 4.5.128.

Why it matters now

Exploitation Proof of concept CISA SSVC · not in CISA KEV
EPSS 0.00244 15th percentileScored 2026-11-07
Public exploit Yes 1 exploit referenceTagged by NVD
Fix Fixed PraisonAI (MervinPraison): 4.5.128PraisonAI (PyPI): 4.5.128

SSVC decision points

CISA ADP · SSVC 2.0.3

Exploitation
Poc
Automatable
No
Technical impact
Total

The decision (Track, Attend, Act) also depends on your mission and well-being impact; see CISA's SSVC guide.

Affected products

VendorProductAffected versionsFixed inStatusSource
MervinPraisonPraisonAIbefore 4.5.1284.5.128Patch availableCNA
—PraisonAI (PyPI)before 4.5.1284.5.128Patch availableGHSA-3c4r-6p77-xwr7
  • PraisonAI VendorMervinPraison Affected before 4.5.128 Fixed in 4.5.128 Patch available CNA
  • PraisonAI (PyPI) Vendor— Affected before 4.5.128 Fixed in 4.5.128 Patch available GHSA-3c4r-6p77-xwr7

CPE configurations NVD · 1

CPEVersionsRoleVendor
cpe:2.3:a:praison:praisonai:*:*:*:*:*:*:*:*before 4.5.128VulnerableMervinPraison
  • cpe:2.3:a:praison:praisonai:*:*:*:*:*:*:*:* Versions before 4.5.128 Vulnerable ·MervinPraison

Remediation

  • Fix · CNA PraisonAI (MervinPraison) Fixed in 4.5.128
  • Fix · GHSA-3c4r-6p77-xwr7 PraisonAI (PyPI) Fixed in 4.5.128 Advisory →

Timeline

  1. 2026-10-02 Threatist record created from CVE-2026-40158
  2. 2026-10-03 Alias added: GHSA-3c4r-6p77-xwr7

References

  • TI-2026-30083 Incomplete fix for CVE-2026-34935: Command Injection in MervinPraison/PraisonAI CVSS 3.1CRITICAL 9.8
  • TI-2026-29070 PraisonAI: Critical RCE via `type: job` workflow YAML CVSS 3.1CRITICAL 9.8
  • TI-2026-28940 PraisonAI has Server-Side Request Forgery via Unvalidated webhook_url in Jobs API CVSS 3.1CRITICAL 10.0
  • TI-2026-28768 PraisonAI Affected by Remote Code Execution via YAML Deserialization in Agent Definition Loading CVSS 3.1CRITICAL 9.8
  • TI-2026-27159 PraisonAI: OS Command Injection in MCPHandler.parse_mcp_command() CVSS 3.1CRITICAL 9.8
  • TI-2026-27158 PraisonAI: Second-Order SQL Injection in `get_all_user_threads` CVSS 3.1CRITICAL 9.8
See all 42 →

Sources