🔍 CVE-2026-40296

5.4
CVSS Score
MEDIUM
2026-05-06
2026-10-26 19:10
✅ 완료

🇰🇷 한글 설명

PhpSpreadsheet의 HTML 작성자가 셀의 포맷된 값이 원래 값과 다를 때 htmlspecialchars 이스케이핑을 건너뜁니다. @ 플레이스홀더와 추가 문자가 있는 사용자 정의 숫자 형식(예: '. @', '@ ', 'x@')으로 셀을 포맷할 때 포맷터가 @ 대신 셀 값을 삽입하여 HTML 이스케이핑이 완전히 우회됩니다. 공격자가 스프레드시트의 셀 값과 숫자 형식을 제어하면 HTML로 변환되어 다른 사용자에게 표시될 때 저장된 XSS를 달성할 수 있습니다.

💡 쉬운 설명

PhpSpreadsheet에서 특수하게 포맷된 엑셀 파일을 웹페이지로 변환할 때 악의적인 코드가 실행될 수 있습니다. 공격자가 엑셀 셀을 조작하면 다른 사용자의 브라우저에서 자동으로 실행될 수 있습니다.

🇺🇸 원문 (English)

PhpSpreadsheet is a pure PHP library for reading and writing spreadsheet files. The HTML writer skips htmlspecialchars escaping when a cell's formatted value differs from the original value. When a cell has a custom number format containing the text placeholder @ along with any additional literal characters (for example ". @", "@ ", or "x@"), the formatter replaces @ with the cell value and adds the extra characters, causing the formatted value to differ from the original and bypassing HTML escaping entirely. An attacker who can control the cell value and number format of an uploaded spreadsheet that is later converted to HTML and displayed to other users can achieve stored cross-site scripting. This issue is fixed in versions 5.7.0, 3.10.5, 2.4.5, 2.1.16, and 1.30.4.

📍 영향받는 시스템

PhpSpreadsheet 버전 5.7.0 미만, 3.10.5 미만, 2.4.5 미만, 2.1.16 미만, 1.30.4 미만

⚔️ 공격 벡터

공격자가 스프레드시트 업로드 시 @ 포함 사용자 정의 숫자 형식과 악성 셀 값을 조합하여 HTML 변환 시 XSS 페이로드 삽입

🛡️ 대응 방법

PhpSpreadsheet를 패치 버전(5.7.0, 3.10.5, 2.4.5, 2.1.16, 1.30.4 이상)으로 업그레이드

🔧 검증 코드

설치된 PhpSpreadsheet 버전이 출력되면 영향받는 버전과 비교하여 패치 필요 여부 판단

Shell / Script
grep -A 1 'phpoffice/phpspreadsheet' composer.lock 2>/dev/null | grep version

📊 CVSS Vector String

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

💻 영향받는 소프트웨어

PHP