PhpSpreadsheet vulnerable to XSS in HTML writer via custom number format codes
- Published
- Last modified
- Where the record stands: published, rejected by its publisher, or superseded by another id.What do these mean? →
- published
- Whether CISA lists it in its Known Exploited Vulnerabilities catalog: proof that attackers are using it.What do these mean? →
- Not listed in CISA KEV
- Fix
- Fixed in 5.7.0, 3.10.5, 2.4.5, 2.1.16, 1.30.4
- Whether working attack code is public (Exploit-DB, Metasploit, Nuclei or GitHub). Public code makes attacks easier.What do these mean? →
- None on Exploit-DB, Metasploit or GitHub
- Exploitation: poc
- Automatable: no
- Technical impact: partial
Summary
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.
Timeline
- CVE published
- CISA SSVC assessment
Exploitation: poc · Automatable: no · Technical impact: partial
- Record last updated
Affected versions
- PHPOffice PhpSpreadsheet
From 4.0.0 · through 5.6.0; From 3.3.0 · through 3.10.4; From 2.2.0 · through 2.4.4; From 2.0.0 · through 2.1.15; through 1.30.3
- phpoffice/phpspreadsheetPackagist
From 4.0.0 · fixed in 5.7.0
- phpoffice/phpspreadsheetPackagist
From 3.3.0 · fixed in 3.10.5
- phpoffice/phpspreadsheetPackagist
From 2.2.0 · fixed in 2.4.5
- phpoffice/phpspreadsheetPackagist
From 2.0.0 · fixed in 2.1.16
- phpoffice/phpspreadsheetPackagist
fixed in 1.30.4