🔍 CVE-2026-45034

0.0
CVSS Score
UNKNOWN
2026-06-22
2026-10-25 23:10
✅ 완료

🇰🇷 한글 설명

PhpSpreadsheet 라이브러리에서 특정 형식의 파일 경로(예: phar:///...)를 처리할 때 보안 검사를 우회하여 스트림 래퍼를 실행할 수 있는 취약점입니다. PHP 7.x 환경에서는 phar 메타데이터의 자동 역직렬화를 통해 원격 코드 실행(RCE)이 가능하며, PHP 8.x에서는 파일 읽기 권한 탈취로 이어질 수 있습니다. 이 문제는 1.30.5 버전에서 수정되었습니다.

💡 쉬운 설명

엑셀 파일을 읽는 프로그램이 특수하게 조작된 파일 경로를 만나면 보안 검사를 건너뛰고 해커가 심어놓은 악성 코드를 실행할 수 있는 문제입니다. 이를 통해 해커가 컴퓨터를 원격으로 조종할 위험이 있습니다.

🇺🇸 원문 (English)

PhpSpreadsheet is a pure PHP library for reading and writing spreadsheet files. Prior to 1.30.5, CVE-2026-34084 was patched by the helper File::prohibitWrappers. The helper calls parse_url($filename, PHP_URL_SCHEME) and then checks is_string($scheme) && strlen($scheme) > 1 to reject stream wrappers such as phar://, php://, data:// or expect://. The check is not equivalent to "does the path contain a wrapper". When the input has the form phar:///path/file.phar/inner with three or more slashes after the scheme, parse_url returns boolean false instead of returning the scheme string. The is_string($scheme) branch is therefore skipped, the helper returns without throwing, and the caller proceeds. PHP's stream layer, however, still treats phar:///... as a valid phar wrapper and opens the underlying phar file. The result is that IOFactory::load($attackerPath) walks past the patch and still touches the phar wrapper. On PHP 7.x, simply reaching the phar wrapper via is_file is enough for PHP to automatically deserialize the phar metadata, which in turn invokes the magic methods __wakeup and __destruct of an attacker controlled object and gives full RCE. On PHP 8.x, automatic metadata deserialization for plain file ops was removed, so the chain at the PhpSpreadsheet layer reduces to a phar wrapper file read primitive, and RCE only resurfaces if the downstream consumer ever calls Phar::getMetadata. This vulnerability is fixed in 1.30.5.

📍 영향받는 시스템

PhpSpreadsheet 1.30.5 미만 버전

⚔️ 공격 벡터

조작된 phar:// 스트림 래퍼가 포함된 파일 경로를 IOFactory::load() 함수에 전달

🛡️ 대응 방법

PhpSpreadsheet를 최신 버전인 1.30.5 이상으로 업데이트

🔧 검증 코드

출력된 버전이 1.30.5 미만이면 취약한 상태이며, 1.30.5 이상이면 안전합니다.

Shell / Script
composer show phpoffice/phpspreadsheet | grep 'versions'

💻 영향받는 소프트웨어

PHP