🇰🇷 한글 설명
애니메이션 정리 전문 미디어 서버인 ShokoServer의 특정 API 엔드포인트에서 인증 없이 임의 파일 읽기가 가능한 취약점이 발견되었습니다. `/api/Image/WithPath` 엔드포인트의 `serverImagePath` 파라미터가 적절히 검증되지 않아 공격자가 서버 내 민감한 파일에 접근할 수 있습니다. 특히 관리자 권한으로 설치된 경우 피해 규모가 더 커질 수 있습니다.
💡 쉬운 설명
해커가 아이디나 비밀번호 없이도 서버에 저장된 중요한 문서나 파일을 몰래 읽어갈 수 있는 보안 구멍이 발견되었습니다. 이 문제는 서버가 파일 경로를 제대로 확인하지 않고 그대로 열어버리기 때문에 발생합니다.
🇺🇸 원문 (English)
ShokoServer is a media server which specializes in organizing anime. In affected versions the `/api/Image/WithPath` endpoint is accessible without authentication and is supposed to return default server images. The endpoint accepts the parameter `serverImagePath`, which is not sanitized in any way before being passed to `System.IO.File.OpenRead`, which results in an arbitrary file read. This issue may lead to an arbitrary file read which is exacerbated in the windows installer which installs the ShokoServer as administrator. Any unauthenticated attacker may be able to access sensitive information and read files stored on the server. The `/api/Image/WithPath` endpoint has been removed in commit `6c57ba0f0` which will be included in subsequent releases. Users should limit access to the `/api/Image/WithPath` endpoint or manually patch their installations until a patched release is made. This issue was discovered by the GitHub Security lab and is also indexed as GHSL-2023-191.
📍 영향받는 시스템
ShokoServer (패치 전 버전, `/api/Image/WithPath` 엔드포인트가 존재하는 버전)
⚔️ 공격 벡터
인증되지 않은 공격자가 조작된 `serverImagePath` 파라미터를 포함한 HTTP 요청을 `/api/Image/WithPath` 엔드포인트로 전송
🛡️ 대응 방법
최신 보안 패치가 적용된 버전으로 업데이트하거나, 패치 전까지 해당 API 엔드포인트에 대한 접근을 차단하십시오.
🔧 검증 코드
명령어 실행 결과 HTTP 상태 코드가 200이 나오면 취약한 상태이며, 404 또는 403이 나오면 안전하거나 차단된 상태입니다.
curl -s -o /dev/null -w "%{http_code}" "http://<TARGET_IP>:<PORT>/api/Image/WithPath?serverImagePath=C:\\Windows\\win.ini"