🇰🇷 한글 설명
PhpSpreadsheet 라이브러리의 XmlScanner::scan 함수가 ISO-2022 이스케이프 시퀀스를 제대로 탐지하지 못해 발생하는 보안 취약점입니다. 공격자가 조작된 XLSX 파일을 통해 XML 외부 엔티티(XXE) 공격을 수행하여 서비스 거부(DoS), 로컬 파일 접근 또는 SSRF를 유발할 수 있습니다.
💡 쉬운 설명
엑셀 파일을 읽는 프로그램이 특수한 암호화 문자가 섞인 파일을 제대로 검사하지 못하는 문제입니다. 이를 통해 해커가 서버의 파일을 훔쳐보거나 서버를 마비시킬 수 있습니다.
🇺🇸 원문 (English)
PhpSpreadsheet is a pure PHP library for reading and writing spreadsheet files. Prior to 1.30.7, 2.1.19, 2.4.8, 3.10.8, and 5.10.0, XmlScanner::scan in src/PhpSpreadsheet/Reader/Security/XmlScanner.php uses a DOCTYPE detection pattern that accounts for NUL-byte interleaving but not ISO-2022 escape sequences in XLSX XML parts. The escape sequences prevent the scanner from matching the declaration, and XML charset normalization then removes the escape bytes before parsing, exposing a valid DOCTYPE and entity definitions. Processing an attacker-controlled XLSX can therefore cause entity-expansion denial of service on supported PHP versions and can permit local file access or SSRF on PHP before 8.0 or when LIBXML_NOENT is enabled. This issue is fixed in versions 1.30.7, 2.1.19, 2.4.8, 3.10.8, and 5.10.0.
📍 영향받는 시스템
PhpSpreadsheet 버전 1.30.7, 2.1.19, 2.4.8, 3.10.8, 5.10.0 미만 버전
⚔️ 공격 벡터
조작된 ISO-2022 이스케이프 시퀀스가 포함된 XLSX 파일을 업로드하여 XML 파싱 과정에서 XXE 공격 수행
🛡️ 대응 방법
PhpSpreadsheet를 최신 보안 패치가 적용된 버전(1.30.7, 2.1.19, 2.4.8, 3.10.8, 5.10.0 이상)으로 업데이트
🔧 검증 코드
출력된 버전 번호가 취약한 버전 범위에 해당하는지 확인합니다.
composer show phpoffice/phpspreadsheet | grep 'versions'