🇰🇷 한글 설명
MaxKB 2.7.1 이하에서 LD_PRELOAD 기반 샌드박스가 불완전하여, 인증된 사용자가 env -i 명령으로 환경변수를 초기화하고 sandbox.so 훅을 제거할 수 있습니다. 이를 통해 제한 없는 원격 코드 실행(RCE)과 네트워크 접근이 가능합니다.
💡 쉬운 설명
MaxKB의 보안 차단 기능이 env 명령어를 통해 우회되어, 권한이 있는 사용자가 시스템을 자유롭게 제어할 수 있습니다. 버전 2.8.0으로 업그레이드하면 해결됩니다.
🇺🇸 원문 (English)
MaxKB is an open-source AI assistant for enterprise. In versions 2.7.1 and below, an incomplete sandbox protection mechanism allows an authenticated user with tool execution privileges to escape the LD_PRELOAD-based sandbox. By env command the attacker can clear the environment variables and drop the sandbox.so hook, leading to unrestricted Remote Code Execution (RCE) and network access. MaxKB restricts untrusted Python code execution via the Tool Debug API by injecting sandbox.so through the LD_PRELOAD environment variable. This intercepts sensitive C library functions (like execve, socket, open) to restrict network and file access. However, a patch allowed the /usr/bin/env utility to be executed by the sandboxed user. When an attacker is permitted to create subprocesses, they can execute the env -i python command. The -i flag instructs env to completely clear all environment variables before running the target program. This effectively drops the LD_PRELOAD environment variable. The newly spawned Python process will therefore execute natively without any sandbox hooks, bypassing all network and file system restrictions. This issue has been fixed in version 2.8.0.
📍 영향받는 시스템
MaxKB 2.7.1 이하
⚔️ 공격 벡터
인증된 도구 실행 권한을 가진 사용자가 env -i python 명령으로 LD_PRELOAD 환경변수 제거 후 샌드박스 우회
🛡️ 대응 방법
MaxKB를 2.8.0 이상으로 업그레이드
🔧 검증 코드
출력된 버전이 2.8.0 이상이면 패치됨, 2.7.1 이하면 취약
pip list 2>/dev/null | grep -i maxkb | awk '{print $2}'