🇰🇷 한글 설명
PraisonAI의 execute_code() 함수에서 샌드박스의 AST 차단 목록이 불완전하여, 예외 객체의 속성 체인(__traceback__, tb_frame, f_back, f_builtins)을 통해 실제 Python 내장 함수 딕셔너리에 접근 가능합니다. 이를 이용해 exec 함수를 획득하고 모든 보안 계층을 우회한 임의의 코드 실행이 가능합니다.
💡 쉬운 설명
PraisonAI의 코드 실행 기능이 충분히 안전하지 않아서 공격자가 예외 처리를 이용해 제한된 영역을 탈출할 수 있습니다. 탈출 후 공격자는 서버에서 제한 없이 어떤 명령이든 실행할 수 있게 됩니다.
🇺🇸 원문 (English)
PraisonAI is a multi-agent teams system. Prior to 1.5.115, execute_code() in praisonaiagents.tools.python_tools defaults to sandbox_mode="sandbox", which runs user code in a subprocess wrapped with a restricted __builtins__ dict and an AST-based blocklist. The AST blocklist embedded inside the subprocess wrapper (blocked_attrs of python_tools.py) contains only 11 attribute names — a strict subset of the 30+ names blocked in the direct-execution path. The four attributes that form a frame-traversal chain out of the sandbox are all absent from the subprocess list (__traceback__, tb_frame, f_back, and f_builtins). Chaining these attributes through a caught exception exposes the real Python builtins dict of the subprocess wrapper frame, from which exec can be retrieved and called under a non-blocked variable name — bypassing every remaining security layer. This vulnerability is fixed in 1.5.115.
📍 영향받는 시스템
PraisonAI < 1.5.115
⚔️ 공격 벡터
예외 객체의 프레임 순회 속성(__traceback__, tb_frame, f_back, f_builtins)을 체이닝하여 샌드박스 래퍼의 실제 builtins 딕셔너리에 접근, exec 함수 호출
🛡️ 대응 방법
PraisonAI를 1.5.115 이상으로 업데이트
🔧 검증 코드
출력된 Version이 1.5.115 이상이면 안전, 미만이면 취약 상태
pip show praisonai 2>/dev/null | grep Version