🇰🇷 한글 설명
Auto-GPT v0.4.3 미만 버전에서 발생하며, execute_python_code 명령어가 파일 이름의 basename 인자를 적절히 검증하지 않아 경로 탐색 취약점이 존재합니다. 공격자는 이를 통해 작업 디렉토리 외부의 .py 파일을 덮어쓸 수 있으며, 결과적으로 호스트 시스템에서 임의 코드를 실행할 수 있습니다.
💡 쉬운 설명
프로그램이 파일을 저장할 때 이름에 '상위 폴더로 이동'하는 명령을 섞어 넣으면, 원래 허용되지 않은 중요한 시스템 파일까지 마음대로 바꿀 수 있는 문제입니다. 이를 통해 해커가 컴퓨터의 제어권을 완전히 뺏을 수 있습니다.
🇺🇸 원문 (English)
Auto-GPT is an experimental open-source application showcasing the capabilities of the GPT-4 language model. When Auto-GPT is executed directly on the host system via the provided run.sh or run.bat files, custom Python code execution is sandboxed using a temporary dedicated docker container which should not have access to any files outside of the Auto-GPT workspace directory.
Before v0.4.3, the `execute_python_code` command (introduced in v0.4.1) does not sanitize the `basename` arg before writing LLM-supplied code to a file with an LLM-supplied name. This allows for a path traversal attack that can overwrite any .py file outside the workspace directory by specifying a `basename` such as `../../../main.py`. This can further be abused to achieve arbitrary code execution on the host running Auto-GPT by e.g. overwriting autogpt/main.py which will be executed outside of the docker environment meant to sandbox custom python code execution the next time Auto-GPT is started. The issue has been patched in version 0.4.3. As a workaround, the risk introduced by this vulnerability can be remediated by running Auto-GPT in a virtual machine, or another environment in which damage to files or corruption of the program is not a critical problem.
📍 영향받는 시스템
Auto-GPT versions prior to v0.4.3
⚔️ 공격 벡터
Path Traversal을 이용한 basename 인자 조작을 통한 임의 파일 덮어쓰기
🛡️ 대응 방법
Auto-GPT를 v0.4.3 이상 버전으로 업데이트하거나, 가상 머신(VM) 환경에서 실행하십시오.
🔧 검증 코드
명령어 결과로 v0.4.0, v0.4.1, v0.4.2 중 하나가 출력되면 취약한 버전입니다.
git describe --tags 2>/dev/null | grep -E 'v0\.4\.[0-2]'