{"id":"CVE-2024-45046","published":"2024-08-28T20:41:23Z","modified":"2024-08-29T13:11:25Z","title":"PhpSpreadsheet HTML writer is vulnerable to Cross-Site Scripting via style information","vendor":"PHPOffice","product":"PhpSpreadsheet","tier":"tail","description":{"text":"PHPSpreadsheet is a pure PHP library for reading and writing spreadsheet files. In affected versions `\\PhpOffice\\PhpSpreadsheet\\Writer\\Html` doesn't sanitize spreadsheet styling information such as font names, allowing an attacker to inject arbitrary JavaScript on the page. As a result an attacker may used a crafted spreadsheet to fully takeover a session of a user viewing spreadsheet files as HTML. This issue has been addressed in release version 2.1.0. All users are advised to upgrade. There are no known workarounds for this vulnerability.","provenance":"source","from":"CVE.org"},"cvss":{"score":5.4,"severity":"MEDIUM","version":"3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:L/UI:R/S:C/C:L/I:L/A:N","provenance":"source","from":"CVE.org CNA"},"epss":{"score":0.00676,"percentile":0.47335,"provenance":"source"},"cwes":[{"id":"CWE-79","name":"Improper Neutralization of Input During Web Page Generation"}],"references":[{"url":"https://github.com/PHPOffice/PhpSpreadsheet/security/advisories/GHSA-wgmf-q9vr-vww6","tags":["x_refsource_CONFIRM"]},{"url":"https://github.com/PHPOffice/PhpSpreadsheet/pull/3957","tags":["x_refsource_MISC"]},{"url":"https://github.com/PHPOffice/PhpSpreadsheet/commit/f7cf378faed2e11cf4825bf8bafea4922ae44667","tags":["x_refsource_MISC"]}],"priority":{"score":13.2,"factors":[{"name":"EPSS percentile","points":9.47},{"name":"CVSS severity","points":3.78}]},"vendorSlug":"phpoffice","affectedVersions":[{"vendor":"PHPOffice","product":"PhpSpreadsheet","versions":["< 2.1.0"]}],"ssvc":{"exploitation":"poc","automatable":"no","technicalImpact":"partial","timestamp":"2024-08-29T13:10:53.744014Z","from":"CISA ADP","provenance":"source"},"affected":[{"ecosystem":"Packagist","package":"phpoffice/phpspreadsheet","vulnerableRanges":[">=2.0.0, <2.1.0","<1.29.1"],"patched":["2.1.0","1.29.1"],"from":["GHSA-wgmf-q9vr-vww6"],"provenance":"source"},{"ecosystem":"Packagist","package":"phpoffice/phpexcel","vulnerableRanges":["<=1.8.2"],"patched":[],"from":["GHSA-wgmf-q9vr-vww6"],"provenance":"source"}],"summary":{"text":"PhpSpreadsheet's HTML writer (PhpOffice\\PhpSpreadsheet\\Writer\\Html) fails to sanitise spreadsheet styling information such as font names, so content is injected unescaped into the generated page. An attacker who can get a user to open a crafted spreadsheet, with a low-privilege account and user interaction required, can run arbitrary JavaScript in that user's browser session when the file is viewed as HTML.","provenance":"ai","model":"claude-haiku-5-5","generatedAt":"2026-11-20T21:59:18Z"},"euvd":{"id":"EUVD-2024-2677","exploited":false,"provenance":"source"},"lineage":{"familyId":"fam-phpoffice-phpspreadsheet-cve-2018-19277","parents":[{"from":"CVE-2020-7776","to":"CVE-2024-45046","relation":"related","confidence":"medium","kind":"lineage","evidence":[{"kind":"same-code","provenance":"machine","files":["src/PhpSpreadsheet/Writer/Html.php"],"commits":["https://github.com/PHPOffice/PhpSpreadsheet/commit/0ed5b800be2136bcb8fa9c1bdf59abc957a98845","https://github.com/PHPOffice/PhpSpreadsheet/commit/f7cf378faed2e11cf4825bf8bafea4922ae44667"],"basis":"shared function","functions":["writeComment"]}]}],"children":[{"from":"CVE-2024-45046","to":"CVE-2024-45293","relation":"related","confidence":"medium","kind":"lineage","evidence":[{"kind":"same-code","provenance":"machine","files":["src/PhpSpreadsheet/Writer/Html.php"],"commits":["https://github.com/PHPOffice/PhpSpreadsheet/commit/f7cf378faed2e11cf4825bf8bafea4922ae44667","https://github.com/PHPOffice/PhpSpreadsheet/commit/3bcd51826b7f089d1641e756c83030c30c3bdb0c","https://github.com/PHPOffice/PhpSpreadsheet/commit/7d6cb09f6e8204f65e6dd5a0490f7f45f44bb331"],"basis":"shared function","functions":["createCSSStyleFont"]}]}]}}