🇰🇷 한글 설명
PhpWeasyPrint 라이브러리에서 대소문자 구분 방식의 블랙리스트 필터링 미비로 인해 발생하는 보안 취약점입니다. 공격자가 phar:// 스트림 래퍼의 대소문자를 변조하여 필터링을 우회하면, 조작된 PHAR 아카이브의 메타데이터가 역직렬화되어 원격 코드 실행(RCE)이 가능해집니다.
💡 쉬운 설명
PDF를 만드는 프로그램이 파일 이름을 검사할 때 대소문자를 꼼꼼하게 확인하지 않아 발생하는 문제입니다. 이를 이용해 해커가 특수한 파일을 보내면 컴퓨터를 원격으로 조종할 수 있습니다.
🇺🇸 원문 (English)
PhpWeasyPrint is a PHP library allowing PDF generation from a URL or an HTML page. Prior to version 2.6.0, `pontedilana/php-weasyprint` guarded the output filename against the `phar://` stream wrapper with a case-sensitive blacklist. PHP stream wrappers are case-insensitive, so `PHAR://`, `Phar://`, etc. bypass the check and reach `fileExists()` (`file_exists()`) in `prepareOutput()`. On PHP 7 (which the library still supports — PHP 7.4+), this triggers deserialization of a crafted PHAR archive's metadata, leading to remote code execution. This is the patch-bypass of CVE-2023-28115. The same issue and fix were handled upstream in KnpLabs/snappy (GHSA-92rv-4j2h-8mjj). PhpWeasyPrint version 2.6.0 contains a patch for the issue.
📍 영향받는 시스템
PhpWeasyPrint 2.6.0 미만 버전 (PHP 7.4 이상 환경 포함)
⚔️ 공격 벡터
대소문자가 섞인 phar:// 스트림 래퍼를 이용한 필터링 우회 및 PHAR 역직렬화 공격
🛡️ 대응 방법
PhpWeasyPrint를 최신 버전인 2.6.0 이상으로 업데이트하십시오.
🔧 검증 코드
출력된 버전이 2.6.0 미만이면 취약한 상태이며, 2.6.0 이상이면 안전합니다.
composer show pontedilana/php-weasyprint | grep 'versions'