🇰🇷 한글 설명
OpenMage LTS의 커스텀 옵션 파일 업로드 기능에서 불완전한 확장자 차단 목록(php, exe만 차단)을 사용하여, .phtml, .phar, .php3 등 대체 PHP 실행 확장자로 우회 가능합니다. 공개 접근 가능한 media/custom_options/quote/ 디렉토리에 저장된 파일은 서버 실행 제한이 없어 원격 코드 실행을 초래합니다.
💡 쉬운 설명
온라인 쇼핑몰 시스템에서 파일 업로드 시 위험한 파일 차단이 불완전하여, 다른 이름의 프로그램 파일을 업로드해 악의적 코드를 실행할 수 있습니다. 버전 20.17.0 이상으로 업데이트하면 해결됩니다.
🇺🇸 원문 (English)
Magento Long Term Support (LTS) is an unofficial, community-driven project provides an alternative to the Magento Community Edition e-commerce platform with a high level of backward compatibility. Prior to version 20.17.0, the product custom option file upload in OpenMage LTS uses an incomplete blocklist (`forbidden_extensions = php,exe`) to prevent dangerous file uploads. This blocklist can be trivially bypassed by using alternative PHP-executable extensions such as `.phtml`, `.phar`, `.php3`, `.php4`, `.php5`, `.php7`, and `.pht`. Files are stored in the publicly accessible `media/custom_options/quote/` directory, which lacks server-side execution restrictions for some configurations, enabling Remote Code Execution if this directory is not explicitly denied script execution. Version 20.17.0 patches the issue.
📍 영향받는 시스템
OpenMage LTS 20.17.0 이전 모든 버전
⚔️ 공격 벡터
.phtml, .phar, .php3, .php4, .php5, .php7, .pht 등 우회 확장자로 PHP 파일 업로드 후 media/custom_options/quote/ 디렉토리에서 직접 실행
🛡️ 대응 방법
OpenMage LTS를 20.17.0 이상으로 업그레이드하거나, 해당 디렉토리의 스크립트 실행을 웹서버 설정에서 명시적으로 차단
🔧 검증 코드
설치된 OpenMage LTS 버전이 20.17.0 미만이면 'vulnerable', 20.17.0 이상이면 'patched' 출력
composer show openmage/magento-lts 2>/dev/null | grep Version | grep -oE '[0-9]+\.[0-9]+\.[0-9]+' | awk '{if($1<"20.17.0")print "vulnerable"; else print "patched"}'