🇰🇷 한글 설명
Hytale Modding Wiki 1.2.0 이하 버전의 quickUpload() 엔드포인트에서 파일 MIME 타입 검증과 저장 파일명 생성이 독립적으로 처리되어, 허용된 MIME 타입을 가진 파일을 .php 확장자로 업로드할 수 있습니다. 업로드된 파일이 공개 디스크에 저장되고 URL로 직접 접근 가능하여 원격 코드 실행(RCE)이 가능합니다.
💡 쉬운 설명
파일 업로드 기능이 파일 내용은 확인하지만 파일명은 확인하지 않아서, 위험한 .php 파일을 업로드할 수 있습니다. 이를 통해 서버에서 악의적인 코드를 실행할 수 있습니다.
🇺🇸 원문 (English)
The Hytale Modding Wiki is a free service for Hytale mods to host their documentation & wikis. In version 1.2.0 and prior, the quickUpload() endpoint validates uploaded files by checking their MIME type (via PHP's finfo, which inspects file contents) but constructs the stored filename using the client-supplied file extension from getClientOriginalExtension(). These two checks are independent: an attacker can upload a file whose content passes the MIME allowlist while using a .php extension. The file is stored on the public disk and is directly accessible via URL, allowing server-side code execution. At time of publication no known patches exist.
📍 영향받는 시스템
Hytale Modding Wiki 버전 1.2.0 이하
⚔️ 공격 벡터
유효한 MIME 타입을 가진 파일의 클라이언트 확장자를 .php로 변경하여 quickUpload() 엔드포인트에 업로드
🛡️ 대응 방법
공식 패치를 적용하거나, 저장된 파일의 실행 권한 제거 및 웹 서버에서 업로드 디렉토리의 PHP 실행 비활성화
🔧 검증 코드
응답에서 버전이 1.2.0 이하이면 취약함, 1.2.1 이상이면 패치됨
curl -s http://target-url/ | grep -oP '(?<=version["\s:]+)[\d.]+'