🔍 CVE-2026-59931

7.7
CVSS Score
HIGH
2026-07-28
2026-10-23 23:10
✅ 완료

🇰🇷 한글 설명

PhpSpreadsheet 라이브러리에서 WEBSERVICE() 도메인 화이트리스트를 HTTP 리다이렉트를 통해 우회할 수 있는 SSRF 취약점이 발견되었습니다. 공격자가 화이트리스트에 포함된 도메인으로 리다이렉트를 유도하면, 검증되지 않은 내부 주소나 클라우드 메타데이터 서버에 접근하여 데이터를 탈취할 수 있습니다.

💡 쉬운 설명

엑셀 파일을 처리하는 프로그램이 허용된 사이트만 방문하도록 설정되어 있지만, 중간에 다른 주소로 연결(리다이렉트)되는 것을 막지 못하는 허점이 있습니다. 이를 통해 해커가 내부 네트워크나 중요한 비밀 정보가 담긴 서버에 몰래 접속할 수 있습니다.

🇺🇸 원문 (English)

PhpSpreadsheet is a pure PHP library for reading and writing spreadsheet files. In versions 4.0.0 through 5.8.0, 3.3.0 through 3.10.6, 2.2.0 through 2.4.6, 2.0.0 through 2.1.17, and all releases up to and including 1.30.5, the WEBSERVICE() domain whitelist can be bypassed via an HTTP redirect (SSRF). In Calculation/Web/Service.php, the webService() method validates a URL's host against the whitelist set via Spreadsheet::setDomainWhiteList(), then fetches content with file_get_contents($url, false, $ctx); because PHP's HTTP stream wrapper follows 301/302 redirects automatically (up to 20 hops) and the redirect target is never re-validated, an attacker who can trigger a redirect from a whitelisted domain can reach arbitrary URLs, including internal addresses. An attacker able to upload XLSX files to an application that uses setDomainWhiteList() and getCalculatedValue() can achieve a full-read SSRF, returning up to 32,767 bytes of the response body as a cell's calculated value, which enables exfiltration of cloud metadata (AWS/GCP/Azure credentials via http://169.254.169.254/), access to internal-only services, and internal port scanning (the port is not validated). This issue has been fixed in versions 5.8.1, 3.10.7, 2.4.7, 2.1.18, and 1.30.6.

📍 영향받는 시스템

PhpSpreadsheet 4.0.0-5.8.0, 3.3.0-3.10.6, 2.2.0-2.4.6, 2.0.0-2.1.17, ~1.30.5

⚔️ 공격 벡터

조작된 XLSX 파일을 업로드하여 WEBSERVICE() 함수가 HTTP 리다이렉트를 통해 내부 네트워크로 접근하도록 유도

🛡️ 대응 방법

PhpSpreadsheet를 버전 5.8.1, 3.10.7, 2.4.7, 2.1.18 또는 1.30.6 이상으로 업데이트

🔧 검증 코드

출력된 버전이 취약한 범위(예: 5.8.0 이하)에 포함되는지 확인

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

📊 CVSS Vector String

CVSS Vector
CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:C/C:H/I:N/A:N