🇰🇷 한글 설명
XAgent의 workspace 파일 엔드포인트에서 경로 탐색(Path Traversal) 취약점이 발견되었습니다. 이 취약점을 통해 이메일 인증 없이 가입한 사용자나 기본 자격 증명을 가진 사용자가 상위 디렉토리 경로를 입력하여 호스트의 임의 파일을 읽을 수 있습니다. 공격자는 이를 통해 애플리케이션 비밀 정보, 데이터베이스 자격 증명 및 Docker 샌드박스 외부의 시스템 파일을 탈취할 수 있습니다.
💡 쉬운 설명
프로그램의 파일 읽기 기능에 허점이 있어, 공격자가 파일 이름에 특수 기호를 섞어 보내면 원래 보여주면 안 되는 중요한 시스템 파일까지 몰래 읽어갈 수 있는 문제입니다. 이를 통해 서버의 비밀번호나 중요한 데이터가 유출될 위험이 있습니다.
🇺🇸 원문 (English)
XAgent contains a path traversal vulnerability in the workspace file endpoint that allows self-registered or default-credential users to read arbitrary files on the host by supplying parent-directory segments in the `file_name` form field with no path containment check. Attackers can register an account without email verification, then submit crafted `file_name` values such as parent-directory traversal sequences to the `/workspace/file` handler to read host files including application secrets, database credentials, and system files outside the Docker sandbox.
📍 영향받는 시스템
XAgent (workspace file endpoint를 사용하는 버전)
⚔️ 공격 벡터
이메일 인증 없이 계정을 생성한 후, /workspace/file 핸들러의 file_name 필드에 상위 디렉토리 이동 경로(예: ../..)를 입력하여 공격
🛡️ 대응 방법
file_name 입력값에 대한 경로 포함 여부 검증(Path Containment Check) 로직을 구현하고, 입력값에서 상위 디렉토리 이동 문자열을 필터링해야 합니다.
🔧 검증 코드
명령어 실행 결과로 시스템의 passwd 파일 내용(예: root:x:...)이 출력된다면 취약점이 존재하는 상태입니다.
curl -s -X POST http://<target_ip>/workspace/file -d "file_name=../../../../etc/passwd" | grep -E 'root:x:'