🇰🇷 한글 설명
Runtipi는 Docker 기반의 개인 홈서버 오케스트레이터로 단일 서버에서 여러 서비스를 관리합니다. 버전 3.7.0 이상에서는 인증된 사용자가 호스트 서버에서 임의의 시스템 명령을 실행할 수 있습니다. 백업 파일 이름에 셸 메타 문자를 삽입하여 BackupManager가 파일 이름을 제대로 정리하지 못하기 때문입니다.
💡 쉬운 설명
Runtipi의 백업 기능에서 파일 이름을 제대로 확인하지 않아 공격자가 시스템 명령을 실행할 수 있습니다. 버전 3.7.0 이상에서 발생합니다. 버전 4.7.0에서 문제가 해결되었습니다.
🇺🇸 원문 (English)
Runtipi is a Docker-based, personal homeserver orchestrator that facilitates multiple services on a single server. Versions 3.7.0 and above allow an authenticated user to execute arbitrary system commands on the host server by injecting shell metacharacters into backup filenames. The BackupManager fails to sanitize the filenames of uploaded backups. The system persists user-uploaded files directly to the host filesystem using the raw originalname provided in the request. This allows an attacker to stage a file containing shell metacharacters (e.g., $(id).tar.gz) at a predictable path, which is later referenced during the restore process. The successful storage of the file is what allows the subsequent restore command to reference and execute it. This issue has been fixed in version 4.7.0.
📍 영향받는 시스템
Runtipi 버전 3.7.0 이상
⚔️ 공격 벡터
백업 파일 이름에 셸 메타 문자 삽입
🛡️ 대응 방법
버전 4.7.0으로 업그레이드
🔧 검증 코드
로컬에서 Runtipi 컨테이너가 실행 중이어야 하며, docker 명령어를 사용할 수 있는 권한이 필요합니다. 코드를 실행하면 Runtipi 버전을 확인하여 취약 여부를 판단합니다.
python -c "import subprocess; output = subprocess.check_output(['docker', 'exec', '-it', 'runtipi', 'runtipi', '--version']).decode('utf-8'); if '3.7.0' <= output.strip() < '4.7.0': print('{"result": "취약", "reason": "Runtipi 버전이 3.7.0 이상 4.7.0 미만"}'); else: print('{"result": "양호", "reason": "Runtipi 버전이 4.7.0 이상"}')"