{"id":"CVE-2024-45292","aliases":["CVE-2024-45292","GHSA-r8w8-74ww-j4wh"],"related":[],"kind":"vulnerability","state":"published","title":"PhpSpreadsheet HTML writer is vulnerable to Cross-Site Scripting via JavaScript hyperlinks","summary":"PHPSpreadsheet is a pure PHP library for reading and writing spreadsheet files. `\\PhpOffice\\PhpSpreadsheet\\Writer\\Html` does not sanitize \"javascript:\" URLs from hyperlink `href` attributes, resulting in a Cross-Site Scripting vulnerability. This issue has been addressed in release versions 1.29.2, 2.1.1, and 2.3.0. All users are advised to upgrade. There are no known workarounds for this vulnerability.","summarySource":"cvelist","descriptions":[{"lang":"en","text":"PHPSpreadsheet is a pure PHP library for reading and writing spreadsheet files. `\\PhpOffice\\PhpSpreadsheet\\Writer\\Html` does not sanitize \"javascript:\" URLs from hyperlink `href` attributes, resulting in a Cross-Site Scripting vulnerability. This issue has been addressed in release versions 1.29.2, 2.1.1, and 2.3.0. All users are advised to upgrade. There are no known workarounds for this vulnerability.","source":"cvelist"},{"lang":"en","text":"### Summary\n`\\PhpOffice\\PhpSpreadsheet\\Writer\\Html` does not sanitize \"javascript:\" URLs from hyperlink `href` attributes, resulting in a Cross-Site Scripting vulnerability.\n\n### PoC\n\nExample target script:\n\n```\n<?php\n\nrequire 'vendor/autoload.php';\n\n$reader = \\PhpOffice\\PhpSpreadsheet\\IOFactory::createReader(\"Xlsx\");\n$spreadsheet = $reader->load(__DIR__ . '/book.xlsx');\n\n$writer = new \\PhpOffice\\PhpSpreadsheet\\Writer\\Html($spreadsheet);\nprint($writer->generateHTMLAll());\n```\n\nSave this file in the same directory:\n[book.xlsx](https://github.com/PHPOffice/PhpSpreadsheet/files/15099763/book.xlsx)\n\nOpen index.php in a web browser and click on both links. The first demonstrates the vulnerability in a regular hyperlink and the second in a HYPERLINK() formula.","format":"markdown","source":"ghsa"},{"lang":"es","text":"PHPSpreadsheet es una librería PHP pura para leer y escribir archivos de hojas de cálculo. `\\PhpOffice\\PhpSpreadsheet\\Writer\\Html` no elimina las URL \"javascript:\" de los atributos de hipervínculo `href`, lo que genera una vulnerabilidad de cross-site scripting. Este problema se ha solucionado en las versiones de lanzamiento 1.29.2, 2.1.1 y 2.3.0. Se recomienda a todos los usuarios que actualicen la versión. No existen workarounds conocidas para esta vulnerabilidad.","source":"nvd"}],"published":"2024-10-07T15:58:25.000Z","modified":"2026-06-17T07:53:57.900Z","severity":{"scorer":"GitHub_M","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:L/UI:R/S:C/C:L/I:L/A:N","score":5.4,"rating":"MEDIUM"},"severities":[{"scorer":"GitHub_M","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:L/UI:R/S:C/C:L/I:L/A:N","score":5.4,"rating":"MEDIUM"},{"scorer":"GitHub","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:L/UI:R/S:C/C:L/I:L/A:N","score":5.4,"rating":"MEDIUM"},{"scorer":"GitHub","scheme":"CVSS:4.0","vector":"CVSS:4.0/AV:N/AC:L/AT:N/PR:L/UI:A/VC:N/VI:N/VA:N/SC:L/SI:L/SA:N","rating":"MEDIUM"},{"scorer":"NVD","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:L/UI:R/S:C/C:L/I:L/A:N","score":5.4,"rating":"MEDIUM"}],"cwes":["CWE-79"],"affected":[{"ranges":[{"version":"< 1.29.2","status":"affected"},{"version":">= 2.0.0, < 2.1.1","status":"affected"},{"version":">= 2.2.0, < 2.3.0","status":"affected"}],"vendor":"PHPOffice","product":"PhpSpreadsheet","source":"cvelist"},{"ranges":[{"type":"custom","introduced":"0","fixed":"1.29.2","status":"affected"},{"type":"custom","introduced":"2.0.0","fixed":"2.1.1","status":"affected"},{"type":"custom","introduced":"2.2.0","fixed":"2.3.0","status":"affected"}],"vendor":"phpoffice","product":"phpspreadsheet","cpe":"cpe:2.3:a:phpoffice:phpspreadsheet:*:*:*:*:*:*:*:*","source":"cvelist"},{"ranges":[{"type":"ecosystem","introduced":"2.2.0","status":"affected","fixed":"2.3.0"}],"ecosystem":"Packagist","package":"phpoffice/phpspreadsheet","purl":"pkg:composer/phpoffice/phpspreadsheet","source":"ghsa"},{"ranges":[{"type":"ecosystem","introduced":"0","status":"affected","fixed":"1.29.2"}],"ecosystem":"Packagist","package":"phpoffice/phpspreadsheet","purl":"pkg:composer/phpoffice/phpspreadsheet","source":"ghsa"},{"ranges":[{"type":"ecosystem","introduced":"2.0.0","status":"affected","fixed":"2.1.1"}],"ecosystem":"Packagist","package":"phpoffice/phpspreadsheet","purl":"pkg:composer/phpoffice/phpspreadsheet","source":"ghsa"},{"ranges":[{"type":"ecosystem","introduced":"0","status":"affected","lastAffected":"1.8.2"}],"ecosystem":"Packagist","package":"phpoffice/phpexcel","purl":"pkg:composer/phpoffice/phpexcel","source":"ghsa"},{"ranges":[{"status":"affected","fixed":"1.29.2"},{"status":"affected","introduced":"2.0.0","fixed":"2.1.1"},{"status":"affected","introduced":"2.2.0","fixed":"2.3.0"}],"vendor":"phpoffice","product":"phpspreadsheet","cpe":"cpe:2.3:a:phpoffice:phpspreadsheet:*:*:*:*:*:*:*:*","source":"nvd"}],"references":[{"url":"https://github.com/PHPOffice/PhpSpreadsheet/security/advisories/GHSA-r8w8-74ww-j4wh","tags":["exploit","vendor-advisory","web","x-refsource-confirm"],"sources":["cvelist","ghsa","nvd"]},{"url":"https://nvd.nist.gov/vuln/detail/CVE-2024-45292","tags":["advisory"],"sources":["ghsa"]},{"url":"https://github.com/PHPOffice/PhpSpreadsheet/commit/392dd08c5569b623060784e1333454d64df1f03d","tags":["web"],"sources":["ghsa"]},{"url":"https://github.com/PHPOffice/PhpSpreadsheet/commit/8b9b378ecdc603234a34aab3b293d2cdc8e9210e","tags":["web"],"sources":["ghsa"]},{"url":"https://github.com/PHPOffice/PhpSpreadsheet/commit/f0b70ed1086348904b27772b264e1605ba6c1d6d","tags":["web"],"sources":["ghsa"]},{"url":"https://github.com/PHPOffice/PhpSpreadsheet","tags":["package"],"sources":["ghsa"]}],"credits":[],"assigner":"GitHub_M","ssvc":{"scorer":"CISA-ADP","exploitation":"poc","automatable":"no","technicalImpact":"partial","date":"2024-10-07T20:25:34.226Z"},"sources":[{"source":"cvelist","name":"CVE List","id":"CVE-2024-45292","url":"https://www.cve.org/CVERecord?id=CVE-2024-45292","licence":"CVE Terms of Use","modified":"2024-10-07T20:26:37.224Z"},{"source":"ghsa","name":"GitHub Advisory Database","id":"GHSA-r8w8-74ww-j4wh","url":"https://github.com/advisories/GHSA-r8w8-74ww-j4wh","licence":"CC-BY-4.0","modified":"2025-03-06T18:37:32.953Z"},{"source":"nvd","name":"NVD","id":"CVE-2024-45292","url":"https://nvd.nist.gov/vuln/detail/CVE-2024-45292","licence":"Public domain","modified":"2026-06-17T07:53:57.900Z"}],"updatedAt":"2026-11-25T22:58:46.139Z","epss":{"score":0.00344,"percentile":0.29924,"date":"2026-12-01T12:00:22.000Z"}}