🇰🇷 한글 설명
SABnzbd 5.1.0Beta3 이전 버전의 orphan 작업 관리 기능에서 사용자가 제어하는 value 파라미터에 대한 경로 검증이 없어, 절대 경로를 사용하면 download_dir 기준 경로가 무시됩니다. 유효한 API 키를 가진 공격자는 mode=status&name=delete_orphan 요청으로 remove_all()의 shutil.rmtree()를 통해 SABnzbd 프로세스가 쓰기 가능한 파일과 디렉터리를 재귀적으로 삭제할 수 있습니다.
💡 쉬운 설명
인증된 사용자가 SABnzbd의 특정 API 요청을 조작해 프로그램이 접근 가능한 임의의 파일과 폴더를 삭제할 수 있는 취약점입니다. 설정 파일, 큐 데이터, 다운로드 파일이 삭제될 수 있으며 수정은 5.1.0Beta3 버전에서 이루어졌습니다.
🇺🇸 원문 (English)
SABnzbd is an open source automated Usenet download tool. Prior to 5.1.0Beta3, orphan-job management in `sabnzbd/api.py` accepts the user-controlled `value` parameter without path confinement before `os.path.join()` with `download_dir`. An absolute path discards that base directory. An attacker with a valid API key can invoke `mode=status` with `name=delete_orphan` to reach `_api_delete_orphan` and `remove_all()` in `sabnzbd/filesystem.py`, which uses `shutil.rmtree()` for recursive deletion. The advisory also identifies `_api_add_orphan` and `_api_delete_all_orphan` as affected by the path-validation issue, while its concrete arbitrary-deletion trace is through `_api_delete_orphan`. The API key is stored in plaintext in `sabnzbd.ini`. The attacker can delete files or directories writable by the SABnzbd process, including configuration, queue data, and downloads, but system files outside the regular user's ownership are not affected. This issue is fixed in version 5.1.0Beta3.
📍 영향받는 시스템
SABnzbd 5.1.0Beta3 미만 버전
⚔️ 공격 벡터
유효한 API 키를 가진 공격자가 절대 경로를 value 파라미터로 전달하는 조작된 API 요청(mode=status, name=delete_orphan)을 보내 임의 디렉터리를 재귀 삭제
🛡️ 대응 방법
SABnzbd를 5.1.0Beta3 이상으로 업데이트하고, API 키를 주기적으로 재발급하며 네트워크 접근을 신뢰된 클라이언트로 제한
🔧 검증 코드
출력된 버전이 5.1.0Beta3 미만이면 취약한 것이며, 5.1.0Beta3 이상이면 수정된 버전입니다.
grep -i '^version' /path/to/sabnzbd/sabnzbd/version.py 2>/dev/null || python3 -c "import sabnzbd; print(sabnzbd.__version__)" 2>/dev/null