🇰🇷 한글 설명
xlang-ai OpenAgents의 파일 업로드 기능(backend/api/file.py)에서 경로 조회(Path Traversal) 취약점이 발견되었습니다. 공격자는 이를 악용하여 지정된 디렉토리 밖의 임의 파일에 접근할 수 있습니다. 프로젝트는 롤링 릴리스를 사용하며 현재 공식 업데이트가 없는 상태입니다.
💡 쉬운 설명
파일을 업로드할 때 '../' 같은 특수 문자를 사용하면 의도된 폴더가 아닌 다른 폴더의 파일까지 접근할 수 있는 보안 결함입니다. 이는 공격자가 시스템의 민감한 파일을 빼내거나 수정할 수 있게 해줍니다.
🇺🇸 원문 (English)
A vulnerability was found in xlang-ai OpenAgents up to ff2e46440699af1324eb25655b622c4a131265bb and classified as critical. Affected by this issue is the function create_upload_file of the file backend/api/file.py. The manipulation leads to path traversal. The exploit has been disclosed to the public and may be used. Continious delivery with rolling releases is used by this product. Therefore, no version details of affected nor updated releases are available. The reported GitHub issue was closed automatically with the label "not planned" by a bot.
📍 영향받는 시스템
xlang-ai OpenAgents (commit ff2e46440699af1324eb25655b622c4a131265bb 이전 모든 버전)
⚔️ 공격 벡터
create_upload_file API에 경로 조회 문자열(../, ../../ 또는 절대 경로)을 포함한 파일명을 전송하여 임의 디렉토리 파일 접근
🛡️ 대응 방법
OpenAgents를 최신 버전으로 업그레이드하고 입력 파일명에 대한 경로 정규화 및 샌드박스 검증 로직 구현
🔧 검증 코드
create_upload_file 함수를 확인하여 경로 정규화(normpath) 또는 화이트리스트 검증 로직이 없으면 취약한 상태이며, 경로 조회 문자가 필터링되지 않으면 노출됨
grep -r 'def create_upload_file' . 2>/dev/null && python3 -c "import os; print(os.path.normpath('../../etc/passwd'))"