🇰🇷 한글 설명
Rust의 zip 라이브러리 7.2.0부터 9.0.0 미만 버전에서 ZipArchive::extract 및 extract_unwrapped_root_dir이 심볼릭 링크 대상을 검증할 때 중간 링크를 실제로 resolve하지 않고 문자열 기반 prefix 비교만 수행합니다. 이로 인해 공격자가 추출 경로 바깥을 가리키는 중간 심볼릭 링크를 통해 임의 파일을 생성하거나 덮어쓸 수 있으며, Windows에서는 드라이브/UNC 접두사 처리 문제로 단일 링크만으로도 탈출이 가능할 수 있습니다.
💡 쉬운 설명
압축 파일을 풀 때 프로그램이 파일이 정해진 폴더 안에만 저장되는지 제대로 확인하지 못합니다. 악의적인 압축 파일을 열면 시스템의 다른 중요한 파일이 덮어쓰일 수 있습니다.
🇺🇸 원문 (English)
zip is a zip library for Rust that supports reading and writing simple ZIP files. From 7.2.0 until 9.0.0, ZipArchive::extract and ZipArchive::extract_unwrapped_root_dir use safe_prepare_path in src/read/zipfile.rs and simplified_components in src/path.rs to validate symbolic link targets with a lexical prefix comparison rather than resolving each intermediate link. An attacker who knows or can guess the absolute extraction destination can create a chain whose apparent target remains under the destination while an intermediate symlink resolves outside it, allowing attacker-controlled files to be created or overwritten with the extracting process's privileges. On Windows, discarded drive and UNC prefixes can permit a single-link escape when the process has SeCreateSymbolicLinkPrivilege, such as through administrator rights or Developer Mode. This regression is distinct from CVE-2025-29787. This issue is fixed in version 9.0.0.
📍 영향받는 시스템
Rust zip 라이브러리 7.2.0 이상 9.0.0 미만을 사용하는 모든 애플리케이션 (Linux, macOS, Windows)
⚔️ 공격 벡터
추출 대상 경로를 알거나 추측할 수 있는 공격자가 중간 심볼릭 링크 체인이 포함된 악성 ZIP 파일을 제작해 대상 프로세스가 압축을 해제하도록 유도
🛡️ 대응 방법
zip 라이브러리를 9.0.0 이상으로 업데이트하고, 신뢰할 수 없는 ZIP 파일은 격리된 샌드박스 환경에서 추출
🔧 검증 코드
출력된 zip 버전이 7.2.0 이상 9.0.0 미만이면 취약하며, 9.0.0 이상이면 패치가 적용된 것입니다. 출력이 없으면 해당 프로젝트에서 zip 크레이트를 사용하지 않는 것입니다.
cargo tree -i zip 2>/dev/null | grep -E 'zip v'
📊 CVSS Vector String
CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:N/I:H/A:H
💻 영향받는 소프트웨어
Storage Protect Snapshot for Windows