# CVE-2025-23210: Bypass XSS sanitizer using the javascript protocol and special characters in phpoffice/phpspreadsheet

> Attackers can bypass XSS sanitization in PhpSpreadsheet using the javascript protocol and special characters, potentially executing malicious scripts.

- **Severity:** Medium 4.8 (`CVSS:4.0/AV:N/AC:L/AT:N/PR:L/UI:A/VC:L/VI:L/VA:N/SC:L/SI:L/SA:N`)
- **Exploited in the wild:** Not known
- **Login needed:** Any signed-in user
- **Attackable:** Over the internet
- **Victim action needed:** A user has to click or open something
- **Fix available:** Yes
- **Published:** 3 Feb 2025
- **Updated:** 4 Feb 2025
- **Also known as:** GHSA-r57h-547h-w24f

## What is CVE-2025-23210?

CVE-2025-23210 is a medium-severity cross-site scripting vulnerability in PHPOffice PhpSpreadsheet, published on 3 Feb 2025. Any signed-in user can exploit it over the network, and only if a user opens a file or follows a link.

### Official description

phpoffice/phpspreadsheet is a pure PHP library for reading and writing spreadsheet files. Affected versions have been found to have a Bypass of the Cross-site Scripting (XSS) sanitizer using the javascript protocol and special characters. This issue has been addressed in versions 3.9.0, 2.3.7, 2.1.8, and 1.29.9. Users are advised to upgrade. There are no known workarounds for this vulnerability.

Weakness: CWE-79 (Improper Neutralization of Input During Web Page Generation)

## Which versions are affected by CVE-2025-23210?

10 open source packages ship an affected version, including phpoffice/phpspreadsheet and phpoffice/phpexcel.


| Package | Ecosystem | Affected | Fixed in |
| --- | --- | --- | --- |
| `phpoffice/phpspreadsheet` | Packagist | All versions | 1.29.9 |
| `phpoffice/phpspreadsheet` | Packagist | All versions | 1.29.9 |
| `phpoffice/phpspreadsheet` | Packagist | From 2.0.0 | 2.1.8 |
| `phpoffice/phpspreadsheet` | Packagist | From 2.0.0 | 2.1.8 |
| `phpoffice/phpspreadsheet` | Packagist | From 2.2.0 | 2.3.7 |
| `phpoffice/phpspreadsheet` | Packagist | From 2.2.0 | 2.3.7 |
| `phpoffice/phpspreadsheet` | Packagist | From 3.0.0 | 3.9.0 |
| `phpoffice/phpspreadsheet` | Packagist | From 3.0.0 | 3.9.0 |
| `phpoffice/phpexcel` | Packagist | All versions to 1.8.2 | None |
| `phpoffice/phpexcel` | Packagist | All versions to 1.8.2 | None |

## How do I fix CVE-2025-23210?

Upgrade phpoffice/phpspreadsheet to a fixed version for your release line: 1.29.9, 2.1.8, 2.3.7 or 3.9.0.

## Is CVE-2025-23210 being exploited?

There is no known exploitation of CVE-2025-23210 in the wild and no public exploit code.

## Fix prompt for AI coding agents

```text
Check this codebase for CVE-2025-23210 and fix it if it is affected.

What it is: CVE-2025-23210 is a medium-severity cross-site scripting vulnerability in PHPOffice PhpSpreadsheet, published on 3 Feb 2025. Any signed-in user can exploit it over the network, and only if a user opens a file or follows a link.
Exploitation: There is no known exploitation of CVE-2025-23210 in the wild and no public exploit code.

Affected packages and fixed versions:
- phpoffice/phpspreadsheet (Packagist): affected all versions; fixed in 1.29.9
- phpoffice/phpspreadsheet (Packagist): affected all versions; fixed in 1.29.9
- phpoffice/phpspreadsheet (Packagist): affected from 2.0.0; fixed in 2.1.8
- phpoffice/phpspreadsheet (Packagist): affected from 2.0.0; fixed in 2.1.8
- phpoffice/phpspreadsheet (Packagist): affected from 2.2.0; fixed in 2.3.7
- phpoffice/phpspreadsheet (Packagist): affected from 2.2.0; fixed in 2.3.7
- phpoffice/phpspreadsheet (Packagist): affected from 3.0.0; fixed in 3.9.0
- phpoffice/phpspreadsheet (Packagist): affected from 3.0.0; fixed in 3.9.0
- phpoffice/phpexcel (Packagist): affected all versions up to 1.8.2; no fix listed
- phpoffice/phpexcel (Packagist): affected all versions up to 1.8.2; no fix listed

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/CVE-2025-23210/ (Markdown: https://insights.sbomify.com/CVE-2025-23210/index.md)
```

## Sources

- CVE record: https://www.cve.org/CVERecord?id=CVE-2025-23210
- NVD: https://nvd.nist.gov/vuln/detail/CVE-2025-23210
- OSV: https://osv.dev/vulnerability/CVE-2025-23210

---
From sbomify Insights: https://insights.sbomify.com/CVE-2025-23210/
Summaries are generated and may contain mistakes; the official description above is the record.
