CVE-2026-40158

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.
Configurations

Configuration 1 (hide)

cpe:2.3:a:praison:praisonai:*:*:*:*:*:*:*:*

History

26 Oct 2026, 21:10

Type Values Removed Values Added
Summary
  • (es) PraisonAI es un sistema de equipos multiagente. Antes de la 4.5.128, el sandbox de Python basado en AST de PraisonAI puede ser eludido utilizando el trampoline type.__getattribute__, permitiendo la ejecución de código arbitrario al ejecutar código de agente no confiable. La función _execute_code_direct en praisonaiagents/tools/python_tools.py utiliza filtrado AST para bloquear atributos peligrosos de Python como __subclasses__, __globals__ y __bases__. Sin embargo, el filtro solo verifica nodos ast.Attribute, permitiendo una elusión. El sandbox se basa en el filtrado basado en AST del acceso a atributos, pero no tiene en cuenta la resolución dinámica de atributos a través de métodos incorporados como type.getattribute, lo que resulta en una aplicación incompleta de las restricciones de seguridad. La cadena ’__subclasses__’ es un ast.Constant, no un ast.Attribute, por lo que nunca se verifica contra la lista bloqueada. Esta vulnerabilidad está corregida en la 4.5.128.

Information

Published : 2026-04-10 17:17

Updated : 2026-10-26 21:10


NVD link : CVE-2026-40158

Mitre link : CVE-2026-40158

CVE.ORG link : CVE-2026-40158


JSON object : View

Products Affected

praison

  • praisonai
CWE
CWE-94

Improper Control of Generation of Code ('Code Injection')

CWE-693

Protection Mechanism Failure