CVE-2025-23210: PhpSpreadsheet XSS Sanitizer Bypass via JavaScript Protocol

phpoffice/phpspreadsheet Updated 02 Oct 2025

Summary

03/02/2025
Yes i
Moderate
5.4

CVE-2025-23210: PhpSpreadsheet allows bypassing of XSS sanitizer using the javascript protocol and special characters. Affects phpoffice/phpspreadsheet across 4 version ranges.

< 1.29.9 >= 2.0.0, < 2.1.8 >= 2.2.0, < 2.3.7 >= 3.0.0, < 3.9.0

Fixed in 4 releases; the minimum fixed version depends on the release line you run. How to fix ↓

Free scan

Check if this vulnerability affects your application

Upload a manifest or SBOM and we'll show whether you're affected, plus every other risky package in the same scan.

Check my app free

No signup required · Results in about 60 seconds

Upload your dependency manifest or SBOM

Drag & drop your file here or

Java Javascript PHP Python Go Rust Ruby Dart C/C++ Elixir CycloneDX SPDX

Upload a supported dependency manifest or SBOM. No installation or source-code access required.

See supported files and SBOM formats
SBOM sbom.json · bom.json · bom.xml · *.spdx.json · *.cdx.json · *.cdx.xml
Java pom.xml · gradle.lockfile · buildscript-gradle.lockfile
Javascript package-lock.json · yarn.lock · pnpm-lock.yaml
PHP composer.lock
Python poetry.lock · requirements.txt · Pipfile.lock
Go go.mod
Rust Cargo.lock
Ruby Gemfile.lock
Dart pubspec.lock
C/C++ conan.lock
Elixir mix.lock
Enter your work email to receive your report link.

Verify your email to view the full report and start 30 days of continuous monitoring. No credit card required.

Sponsored MarkAI Find prospects already talking about the problem you solve AI watches the communities your customers use to find qualified prospects, then alerts you when a conversation is worth joining. See MarkAI

Background

PhpSpreadsheet is a popular open-source library for reading and writing spreadsheet files in various formats, including Excel. It allows developers to create, modify, and read spreadsheet documents programmatically. However, the library has a vulnerability that allows attackers to bypass the XSS sanitizer, potentially leading to the execution of arbitrary JavaScript code in users' browsers.

Vulnerability Detail

The vulnerability arises from the improper neutralization of input during web page generation, specifically in the generateRow method of the PhpOffice\PhpSpreadsheet\Writer\Html class. An attacker can exploit this by crafting a specially formatted XML file that includes special characters before the JavaScript protocol. This manipulation allows the library to generate an HTML link that executes embedded JavaScript when clicked, leading to potential security risks such as data theft or unauthorized actions on behalf of the user.

How To Fix

Fixed versions by release line

The minimum fixed version depends on the release line you run.

  • < 1.29.9 1.29.9
    composer require phpoffice/phpspreadsheet:1.29.9
  • >= 2.0.0, < 2.1.8 2.1.8
    composer require phpoffice/phpspreadsheet:2.1.8
  • >= 2.2.0, < 2.3.7 2.3.7
    composer require phpoffice/phpspreadsheet:2.3.7
  • >= 3.0.0, < 3.9.0 3.9.0
    composer require phpoffice/phpspreadsheet:3.9.0

Tip — Not sure which release line you're on? Vulert can find the fix for the version you are using. Scan free →

Workaround

As a temporary workaround, you can implement additional sanitization of special characters in the input strings before processing them with PhpSpreadsheet. This can help mitigate the risk of XSS attacks until the library is updated.

Conclusion

The CVE-2025-23210 vulnerability in PhpSpreadsheet allows attackers to bypass XSS sanitization, leading to potential execution of malicious JavaScript in users' browsers. It is crucial to update to the latest patched versions of the library to mitigate this risk. Additionally, implementing input sanitization can provide a temporary solution until an update is applied.

See every vulnerability recorded for phpoffice/phpspreadsheet →

Share this vulnerability

FAQ

The CVSS score of this vulnerability is 5.4, indicating a moderate level of risk.

You can use Vulert, which monitors and alerts for open-source vulnerabilities in real-time. You can check your application using the Vulert playground at Vulert Scanner without any signup.

The potential impacts include the execution of arbitrary JavaScript code in the user's browser, which could lead to data theft, session hijacking, or other malicious activities.

Yes, implementing additional sanitization of special characters in input strings can help mitigate the risk until you can update to a secure version.

The vulnerability was discovered by Igor Sak-Sakovskiy from Positive Technologies.

Related vulnerabilities

Recent vulnerabilities recorded for phpoffice/phpspreadsheet.

How To Fix

Fixed versions by release line

The minimum fixed version depends on the release line you run.

  • < 1.29.9 1.29.9
    composer require phpoffice/phpspreadsheet:1.29.9
  • >= 2.0.0, < 2.1.8 2.1.8
    composer require phpoffice/phpspreadsheet:2.1.8
  • >= 2.2.0, < 2.3.7 2.3.7
    composer require phpoffice/phpspreadsheet:2.3.7
  • >= 3.0.0, < 3.9.0 3.9.0
    composer require phpoffice/phpspreadsheet:3.9.0

Tip — Not sure which release line you're on? Vulert can find the fix for the version you are using. Scan free →

Subscribe to Vulert on Telegram
Daily digest of new CVEs, critical and high severity, affected packages and fixes — plus a weekly roundup.
Join the channel →
Help improve this record
Report an issue or send feedback