🇰🇷 한글 설명
OneDev 4.0.3 미만 버전에서 발생하는 'Zip Slip' 취약점으로, KubernetesResource REST 엔드포인트가 압축을 해제할 때 경로 검증을 수행하지 않습니다. 공격자가 조작된 tar 파일을 전송하면 파일 시스템을 벗어나 임의의 파일을 덮어쓸 수 있는 위험이 있습니다. 이 문제는 TarUtils 라이브러리 자체의 결함으로 인해 해당 라이브러리를 사용하는 다른 프로젝트에도 영향을 줄 수 있습니다.
💡 쉬운 설명
압축 파일을 풀 때 파일 이름에 '상위 폴더로 이동'하는 명령이 숨겨져 있으면, 원래 저장되어야 할 위치가 아닌 시스템의 중요한 파일을 마음대로 바꿀 수 있는 문제입니다. 해커가 이 방법을 사용하면 서버의 중요한 설정 파일을 망가뜨리거나 악성 코드를 심을 수 있습니다.
🇺🇸 원문 (English)
OneDev is an all-in-one devops platform. In OneDev before version 4.0.3 there is a critical "zip slip" vulnerability. This issue may lead to arbitrary file write. The KubernetesResource REST endpoint untars user controlled data from the request body using TarUtils. TarUtils is a custom library method leveraging Apache Commons Compress. During the untar process, there are no checks in place to prevent an untarred file from traversing the file system and overriding an existing file. For a successful exploitation, the attacker requires a valid __JobToken__ which may not be possible to get without using any of the other reported vulnerabilities. But this should be considered a vulnerability in `io.onedev.commons.utils.TarUtils` since it lives in a different artifact and can affect other projects using it. This issue was addressed in 4.0.3 by validating paths in tar archive to only allow them to be in specified folder when extracted.
📍 영향받는 시스템
OneDev 4.0.3 미만 버전 및 io.onedev.commons.utils.TarUtils 라이브러리를 사용하는 시스템
⚔️ 공격 벡터
유효한 __JobToken__을 사용하여 조작된 경로가 포함된 tar 데이터를 KubernetesResource REST 엔드포인트로 전송
🛡️ 대응 방법
OneDev를 4.0.3 이상 버전으로 업데이트하여 압축 해제 시 경로 검증 로직을 적용해야 합니다.
🔧 검증 코드
출력 결과에 4.0.3 이상의 버전 번호가 포함되어 있으면 취약점이 해결된 상태입니다.
curl -s http://<onedev-host>/api/version | grep -E '4.0.3'