🇰🇷 한글 설명
Langroid 프레임워크의 TableChatAgent 및 VectorStore 기능에서 샌드박스 탈출을 통한 원격 코드 실행(RCE) 취약점이 발견되었습니다. eval() 함수 사용 시 locals를 빈 딕셔너리로 설정하더라도 __builtins__가 제거되지 않아, 공격자가 시스템 명령어를 실행할 수 있는 권한을 획득할 수 있습니다.
💡 쉬운 설명
AI가 코드를 실행할 때 안전한 울타리를 쳤다고 생각했지만, 실제로는 울타리 문이 열려 있는 상태입니다. 이를 통해 해커가 AI에게 명령을 내려 컴퓨터를 마음대로 조종할 수 있습니다.
🇺🇸 원문 (English)
Langroid is a framework for building large-language-model-powered applications. Versions prior to 0.65.2 are vulnerable to a critical Sandbox Escape leading to Remote Code Execution (RCE) in its `TableChatAgent` and `VectorStore` capabilities. When these agents evaluate LLM-generated tool messages with `full_eval=True`, they attempt to sandbox the execution by explicitly setting `locals` to an empty dictionary `{}` inside Python's `eval()` function. However, this relies on an incomplete understanding of Python's execution model. Because `__builtins__` is not explicitly scrubbed from the `globals` dictionary mapping, Python implicitly injects all built-ins during execution, granting full access to functions like `__import__('os').system()`. Since `TableChatAgent.pandas_eval()` executes external LLM outputs natively, this bypass permits any attacker providing prompt payload to achieve unauthenticated RCE on the host system. Version 0.65.2 patches the issue.
📍 영향받는 시스템
Langroid versions prior to 0.65.2
⚔️ 공격 벡터
LLM이 생성한 도구 메시지에 악의적인 Python 코드를 포함시켜 eval() 함수를 통해 실행
🛡️ 대응 방법
Langroid 버전을 0.65.2 이상으로 업데이트
🔧 검증 코드
출력된 Version이 0.65.2 미만이면 취약한 상태이며, 0.65.2 이상이면 안전합니다.
pip show langroid | grep Version