GHSA-44jg-mv3h-wj6g solspace/craft-freeform Vulnerable to XSS in `PhpSpreadsheet` HTML Writer Due to Unsanitized Styling Data
An XSS vulnerability in PhpSpreadsheet's HTML writer allows attackers to inject JavaScript via unsanitized styling data, potentially leading to session takeover.
- Exploited in the wild
- Not known
- Login needed
- Not needed
- Attackable
- Over the internet
- Victim action needed
- A user has to click or open something
- Fix
- Available
What is GHSA-44jg-mv3h-wj6g?
GHSA-44jg-mv3h-wj6g is a cross-site scripting vulnerability in solspace/craft-freeform, published on 15 Jan 2026. An attacker can exploit it over the internet without logging in, and only if a user opens a file or follows a link.
Official description
Summary
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.
\PhpOffice\PhpSpreadsheet\Writer\Html doesn't sanitize spreadsheet styling information such as font names, allowing an attacker to inject arbitrary JavaScript on the page.
Details
Give all details on the vulnerability. Pointing to the incriminated source code is very helpful for the maintainer.
See https://github.com/advisories/GHSA-wgmf-q9vr-vww6
PoC
Complete instructions, including specific configuration details, to reproduce the vulnerability.
Example target script:
<?php
require 'vendor/autoload.php';
$reader = \PhpOffice\PhpSpreadsheet\IOFactory::createReader("Xlsx");
$spreadsheet = $reader->load(__DIR__ . '/book.xlsx');
$writer = new \PhpOffice\PhpSpreadsheet\Writer\Html($spreadsheet);
print($writer->generateHTMLAll());
Save this file in the same directory:
Open index.php in a web browser. An alert should be displayed.
Impact
What kind of vulnerability is it? Who is impacted?
Full takeover of the session of users viewing spreadsheet files as HTML.
Which versions are affected by GHSA-44jg-mv3h-wj6g?
2 open source packages ship an affected version, including solspace/craft-freeform.
| Package | Affected | Fixed in |
|---|---|---|
solspace/craft-freeform Packagist | All versions | 4.1.23 |
solspace/craft-freeform Packagist | All versions | 4.1.23 |
How do I fix GHSA-44jg-mv3h-wj6g?
Upgrade solspace/craft-freeform to 4.1.23 or later.
Escape output for the context it lands in and set a strict Content Security Policy. Upgrading the affected component is the real fix. More about Cross-site scripting.
Is GHSA-44jg-mv3h-wj6g being exploited?
There is no known exploitation of GHSA-44jg-mv3h-wj6g in the wild and no public exploit code.