{"id":"GHSA-44jg-mv3h-wj6g","aliases":["GHSA-44jg-mv3h-wj6g"],"related":[],"kind":"vulnerability","state":"published","title":"solspace/craft-freeform Vulnerable to XSS in `PhpSpreadsheet` HTML Writer Due to Unsanitized Styling Data","summary":"### Summary\n_Short summary of the problem. Make the impact and severity as clear as possible. For example: An unsafe deserialization vulnerability allows any unauthenticated user to execute arbitrary code on the server._\n\n\\PhpOffice\\PhpSpreadsheet\\Writer\\Html doesn't sanitize spreadsheet styling information such as font names, allowing an attacker to inject arbitrary JavaScript on the page.\n\n### Details\n_Give all details on the vulnerability. Pointing to the incriminated source code is very helpful for the maintainer._\n\nSee https://github.com/advisories/GHSA-wgmf-q9vr-vww6\n\n### PoC\n_Complete instructions, including specific configuration details, to reproduce the vulnerability._\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\n[book.xlsx](https://github.com/PHPOffice/PhpSpreadsheet/files/15212797/book.xlsx)\n\nOpen index.php in a web browser. An alert should be displayed.\n\n### Impact\n_What kind of vulnerability is it? Who is impacted?_\n\nFull takeover of the session of users viewing spreadsheet files as HTML.","summaryFormat":"markdown","summarySource":"ghsa","descriptions":[{"lang":"en","text":"### Summary\n_Short summary of the problem. Make the impact and severity as clear as possible. For example: An unsafe deserialization vulnerability allows any unauthenticated user to execute arbitrary code on the server._\n\n\\PhpOffice\\PhpSpreadsheet\\Writer\\Html doesn't sanitize spreadsheet styling information such as font names, allowing an attacker to inject arbitrary JavaScript on the page.\n\n### Details\n_Give all details on the vulnerability. Pointing to the incriminated source code is very helpful for the maintainer._\n\nSee https://github.com/advisories/GHSA-wgmf-q9vr-vww6\n\n### PoC\n_Complete instructions, including specific configuration details, to reproduce the vulnerability._\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\n[book.xlsx](https://github.com/PHPOffice/PhpSpreadsheet/files/15212797/book.xlsx)\n\nOpen index.php in a web browser. An alert should be displayed.\n\n### Impact\n_What kind of vulnerability is it? Who is impacted?_\n\nFull takeover of the session of users viewing spreadsheet files as HTML.","format":"markdown","source":"ghsa"}],"published":"2026-01-15T22:40:42.000Z","modified":"2026-02-03T03:17:27.874Z","severity":{"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/E:P","rating":"LOW"},"severities":[{"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/E:P","rating":"LOW"}],"cwes":["CWE-79"],"affected":[{"ranges":[{"type":"ecosystem","introduced":"0","status":"affected","fixed":"4.1.23"}],"ecosystem":"Packagist","package":"solspace/craft-freeform","purl":"pkg:composer/solspace/craft-freeform","source":"ghsa"}],"references":[{"url":"https://github.com/PHPOffice/PhpSpreadsheet/security/advisories/GHSA-wgmf-q9vr-vww6","tags":["web"],"sources":["ghsa"]},{"url":"https://github.com/solspace/craft-freeform/security/advisories/GHSA-44jg-mv3h-wj6g","tags":["web"],"sources":["ghsa"]},{"url":"https://github.com/solspace/craft-freeform","tags":["package"],"sources":["ghsa"]},{"url":"https://github.com/solspace/craft-freeform/releases/tag/v4.1.23","tags":["web"],"sources":["ghsa"]}],"credits":[],"sources":[{"source":"ghsa","name":"GitHub Advisory Database","id":"GHSA-44jg-mv3h-wj6g","url":"https://github.com/advisories/GHSA-44jg-mv3h-wj6g","licence":"CC-BY-4.0","modified":"2026-02-03T03:17:27.874Z"}],"updatedAt":"2026-11-25T22:56:30.981Z"}