# 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.

- **Severity:** Not scored
- **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:** Yes
- **Published:** 15 Jan 2026

## 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:

[book.xlsx](https://github.com/PHPOffice/PhpSpreadsheet/files/15212797/book.xlsx)

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 | Ecosystem | 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.

## 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.

## Fix prompt for AI coding agents

```text
Check this codebase for GHSA-44jg-mv3h-wj6g and fix it if it is affected.

What it is: 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.
Exploitation: There is no known exploitation of GHSA-44jg-mv3h-wj6g in the wild and no public exploit code.

Affected packages and fixed versions:
- solspace/craft-freeform (Packagist): affected all versions; fixed in 4.1.23
- solspace/craft-freeform (Packagist): affected all versions; fixed in 4.1.23

Task:
1. Search the dependency manifests and lockfiles (for example package.json, package-lock.json, requirements.txt, poetry.lock, uv.lock, pom.xml, build.gradle, go.mod, Cargo.lock, Gemfile.lock) and any Dockerfiles for the affected packages, including transitive dependencies.
2. If an affected version is in use, upgrade it to the fixed version for its release line with the project's package manager, so the lockfile is regenerated. Prefer the smallest upgrade that fixes it.
3. If there is no fix, or the upgrade would break the build, do not guess: explain the risk and the safest workaround instead.
4. Run the tests and summarise what changed and why.
5. If nothing in the project is affected, say so and change nothing.

Reference: https://insights.sbomify.com/GHSA-44jg-mv3h-wj6g/ (Markdown: https://insights.sbomify.com/GHSA-44jg-mv3h-wj6g/index.md)
```

## Sources

- OSV: https://osv.dev/vulnerability/GHSA-44jg-mv3h-wj6g

---
From sbomify Insights: https://insights.sbomify.com/GHSA-44jg-mv3h-wj6g/
Summaries are generated and may contain mistakes; the official description above is the record.
