🇰🇷 한글 설명
Portainer Community Edition의 백업 복원 기능에서 filepath.Clean과 filepath.Join의 조합이 디렉토리 트래버설을 방지하지 못해, 악의적인 .tar.gz 아카이브를 통해 서버 파일시스템의 임의의 위치에 파일을 작성할 수 있습니다. 2.33.0부터 2.33.8 이전 버전에서 영향을 받으며, 2.33.8에서 수정되었습니다.
💡 쉬운 설명
Portainer의 백업 파일 압축 해제 기능이 안전하지 않아서, 공격자가 조작된 백업 파일을 업로드하면 서버 전체에 악성 파일을 설치할 수 있습니다. 버전을 업그레이드하면 해결됩니다.
🇺🇸 원문 (English)
Portainer Community Edition is a lightweight service delivery platform for containerized applications that can be used to manage Docker, Swarm, Kubernetes and ACI environments. From 2.33.0 to before 2.33.8, Portainer's backup restore feature accepts a .tar.gz archive and extracts it to a target directory on the server. The extraction function (ExtractTarGz in api/archive/targz.go) constructed output paths using filepath.Clean(filepath.Join(outputDirPath, header.Name)). This combination does not prevent directory traversal — a tar entry named ../../etc/cron.d/evil resolves to a path outside the extraction root, so a crafted archive can write files to arbitrary locations on the server filesystem. This vulnerability is fixed in 2.33.8.
📍 영향받는 시스템
Portainer Community Edition 2.33.0 ~ 2.33.7
⚔️ 공격 벡터
조작된 .tar.gz 백업 파일을 Portainer 웹 UI를 통해 업로드하여 디렉토리 트래버설로 임의 경로에 파일 작성
🛡️ 대응 방법
Portainer를 2.33.8 이상으로 즉시 업그레이드
🔧 검증 코드
현재 설치된 Portainer 이미지의 태그에서 2.33.0~2.33.7 버전이 검출되면 취약, 그 외는 안전 또는 미설치
docker images portainer/portainer-ce --format '{{.Tag}}' | grep -E '^2\.33\.[0-7]$' && echo 'Vulnerable' || echo 'Safe or not installed'