🇰🇷 한글 설명
CodeIgniter 4.7.3 미만 버전에서 파일 업로드 검증 규칙인 ext_in이 클라이언트가 제공한 확장자가 아닌 MIME 타입 기반의 추측된 확장자를 확인하는 취약점이 발견되었습니다. 공격자가 GIF 형태의 콘텐츠를 포함한 PHP 파일을 업로드할 경우, 검증을 우회하여 웹 디렉토리에 실행 가능한 파일을 저장하고 임의의 코드를 실행할 수 있습니다.
💡 쉬운 설명
파일을 올릴 때 이름이 .php인지 확인하는 대신 파일 내용만 보고 .gif라고 착각하여 보안 검사를 통과시키는 문제입니다. 이를 통해 해커가 악성 코드가 담긴 파일을 서버에 몰래 저장하고 실행할 수 있습니다.
🇺🇸 원문 (English)
CodeIgniter is a PHP full-stack web framework. Prior to 4.7.3, the ext_in upload validation rule in system/Validation/StrictRules/FileRules.php checked the MIME-derived guessed extension instead of the client-provided filename extension. As a result, an uploaded file named shell.php containing GIF-like content could pass validation such as uploaded[avatar]|is_image[avatar]|mime_in[avatar,image/gif]|ext_in[avatar,gif] because the detected MIME type maps to gif, even though the uploaded filename extension is php. Applications are impacted if they accept user-controlled uploads, rely on ext_in to validate the uploaded filename extension, save uploaded files using the original client filename with $file->move($path), store uploads in a web-accessible directory, and allow PHP or other executable files to run from that directory. In those conditions, this may lead to arbitrary code execution. This issue is fixed in version 4.7.3.
📍 영향받는 시스템
CodeIgniter 4.7.3 미만 모든 버전
⚔️ 공격 벡터
MIME 타입 기반의 검증 우회를 통한 악성 PHP 파일 업로드 및 원격 코드 실행(RCE)
🛡️ 대응 방법
CodeIgniter를 최신 버전인 4.7.3 이상으로 업데이트하십시오.
🔧 검증 코드
출력된 버전 정보가 4.7.3 미만인 경우 해당 취약점에 노출된 상태입니다.
composer show codeigniter4/framework | grep versions