🔍 CVE-2026-40158

8.6
CVSS Score
HIGH
2026-04-10
2026-10-26 21:10
✅ 완료

🇰🇷 한글 설명

PraisonAI의 AST 기반 Python 샌드박스가 type.__getattribute__ 트램폴린을 이용해 우회 가능하며, 신뢰할 수 없는 에이전트 코드 실행 시 임의 코드 실행이 가능합니다. 취약점은 ast.Constant인 문자열 '__subclasses__'가 AST 필터 검사를 회피하여 __subclasses__, __globals__ 등 위험한 속성에 접근할 수 있다는 것입니다.

💡 쉬운 설명

PraisonAI는 AI 에이전트 코드를 안전하게 실행하기 위해 보안 필터를 두었으나, 특정 트릭으로 이 필터를 우회할 수 있습니다. 공격자가 이를 이용하면 시스템을 완전히 제어하는 악성 코드를 실행할 수 있습니다.

🇺🇸 원문 (English)

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.

📍 영향받는 시스템

PraisonAI 4.5.128 이전 모든 버전

⚔️ 공격 벡터

type.__getattribute__를 사용한 동적 속성 접근으로 AST 노드 필터링 우회 후 제한된 속성(__subclasses__, __globals__, __bases__) 접근

🛡️ 대응 방법

PraisonAI를 4.5.128 이상으로 즉시 업그레이드

🔧 검증 코드

Version이 4.5.128 이상이면 패치됨, 이하면 즉시 업그레이드 필요

Shell / Script
pip show praisonaiagents 2>/dev/null | grep -E 'Version|version'

📊 CVSS Vector String

CVSS Vector
CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:C/C:H/I:H/A:H

💻 영향받는 소프트웨어

Python