🇰🇷 한글 설명
zt-zip은 ZIP 아카이브 조작을 위한 편의 메서드를 제공하는 Java 라이브러리입니다. 1.18.1 이전 버전에서는 ZipUtil.unpack(...) 실행 시 '/' 또는 './'와 같이 추출 대상 디렉터리 자체로 해석되는 엔트리 이름에 대해 ZIP 엔트리에 저장된 권한이 출력 디렉터리에 적용될 수 있어, 제한적인 디렉터리 권한이 공격자가 지정한 권한으로 교체될 수 있습니다.
💡 쉬운 설명
신뢰할 수 없는 ZIP 파일의 압축을 풀 때, 압축 파일 안에 조작된 권한 정보가 들어 있으면 대상 폴더의 보안 설정이 바뀔 수 있습니다. 이 문제는 1.18.1 버전에서 수정되었습니다.
🇺🇸 원문 (English)
zt-zip is a Java library that provides convenience methods for ZIP archive manipulation. Prior to 1.18.1, ZipUtil.unpack(...) can apply stored ZIP-entry permissions to the extraction output directory when an entry name such as / or ./ resolves to that directory itself. Because the path traversal checks permit self-referencing entries that do not escape the destination, the unpacker's permission-handling path can replace restrictive output-directory permissions with attacker-supplied permissions. This affects applications that unpack untrusted ZIP files, and POSIX systems demonstrate the issue directly, while ZTFilePermissionsUtil.fetchDefaultStrategy provides fallback permission handling on other supported systems. This issue is fixed in version 1.18.1.
📍 영향받는 시스템
zt-zip 1.18.1 미만 버전을 사용하는 Java 애플리케이션 (특히 POSIX 시스템)
⚔️ 공격 벡터
조작된 ZIP 파일의 엔트리 이름을 '/' 또는 './'로 설정하여 추출 디렉터리의 권한을 공격자가 원하는 값으로 변경
🛡️ 대응 방법
zt-zip을 1.18.1 이상으로 업그레이드하고, 신뢰되지 않은 ZIP 파일은 격리된 환경에서 처리
🔧 검증 코드
출력된 버전이 1.18.1 미만이면 취약한 것이며, 1.18.1 이상이면 수정된 버전입니다. 아무 결과도 없으면 zt-zip이 설치되지 않은 것입니다.
find / -name 'zt-zip*.jar' 2>/dev/null -exec sh -c 'unzip -p "$1" META-INF/MANIFEST.MF 2>/dev/null | grep -i version' _ {} \;