🇰🇷 한글 설명
Node.js용 adm-zip 라이브러리 0.6.1 미만 버전에서 발생하는 취약점으로, 압축 해제 시 setuid/setgid/sticky 비트를 필터링하지 않고 그대로 적용합니다. 공격자가 조작된 ZIP 파일을 통해 권한이 상승된 실행 파일을 생성할 수 있으며, 루트 권한으로 압축을 해제할 경우 일반 사용자가 루트 권한으로 코드를 실행할 수 있습니다.
💡 쉬운 설명
압축 파일 안에 숨겨진 특수 권한 설정이 해제될 때 제대로 검사되지 않아 발생하는 문제입니다. 이를 통해 해커가 만든 프로그램이 컴퓨터의 관리자 권한을 몰래 획득할 수 있습니다.
🇺🇸 원문 (English)
adm-zip is a JavaScript library for creating and extracting ZIP archives in Node.js. Prior to 0.6.1, adm-zip applies the Unix permission bits stored in a zip entry directly to the extracted file via `fs.chmodSync()` when `keepOriginalPermission=true` is passed to `extractAllTo()`/`extractEntryTo()` — and it never filters the setuid/setgid/sticky bits out of those bits. A zip crafted by an attacker can therefore produce an extracted binary with mode `04755`. When extraction runs as root (the default posture in Docker builds, CI runners, and privileged install steps — the exact environments where this flag is used), the resulting root-owned setuid file is executed later by a lesser-privileged user, turning the attacker's code into a root execution. Version 0.6.1 fixes the issue.
📍 영향받는 시스템
adm-zip versions prior to 0.6.1
⚔️ 공격 벡터
특수하게 제작된 ZIP 파일을 사용하여 권한이 상승된(setuid) 파일을 생성하고 실행 유도
🛡️ 대응 방법
adm-zip 라이브러리를 0.6.1 버전 이상으로 업데이트
🔧 검증 코드
출력된 adm-zip의 버전이 0.6.1 미만인지 확인