Unauthorized Reflected XSS Vulnerability in PhpSpreadsheet 3.6.0

phpoffice/phpspreadsheet Updated 02 Oct 2025

Summary

03/01/2025
Yes i
High
7.1

CVE-2024-56365: PhpSpreadsheet allows unauthorized Reflected XSS in the constructor of the Downloader class. Affects phpoffice/phpspreadsheet across 4 version ranges.

< 1.29.7 >= 2.0.0, < 2.1.6 >= 2.2.0, < 2.3.5 >= 3.0.0, < 3.7.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 Devnack Mobile apps built by Devnack Design, build and launch iOS and Android apps with a senior product team. From idea to store release Start a project

Background

PhpSpreadsheet is a popular open-source library used for reading and writing spreadsheet files in various formats, including Excel. It provides a range of functionalities for data manipulation and is widely utilized in PHP applications. However, version 3.6.0 of PhpSpreadsheet contains a critical vulnerability that allows unauthorized users to execute arbitrary JavaScript code through reflected cross-site scripting (XSS) attacks.

Vulnerability Detail

The vulnerability arises from the improper handling of user input in the constructor of the Downloader class within the PhpSpreadsheet library. Specifically, the download.php script processes GET parameters without adequate sanitization, allowing attackers to inject malicious scripts. This can lead to the execution of arbitrary JavaScript in the browser of any user accessing the affected script, potentially compromising sensitive information and user sessions.

How To Fix

Fixed versions by release line

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

  • < 1.29.7 1.29.7
    composer require phpoffice/phpspreadsheet:1.29.7
  • >= 2.0.0, < 2.1.6 2.1.6
    composer require phpoffice/phpspreadsheet:2.1.6
  • >= 2.2.0, < 2.3.5 2.3.5
    composer require phpoffice/phpspreadsheet:2.3.5
  • >= 3.0.0, < 3.7.0 3.7.0
    composer require phpoffice/phpspreadsheet:3.7.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, developers can implement input sanitization for the name and type parameters in the download.php script. For example, you can use PHP's `

htmlspecialchars()` function to encode special characters: `$_GET['name'] = htmlspecialchars($_GET['name'], ENT_QUOTES, 'UTF-8');

` This will help prevent the execution of malicious scripts until the package is updated.

Conclusion

The unauthorized reflected XSS vulnerability in PhpSpreadsheet version 3.6.0 poses a significant risk to applications using this library. It is crucial for developers to update to version 3.7.0 or later to protect against potential attacks. Implementing input sanitization can serve as a temporary measure until the update is applied.

See every vulnerability recorded for phpoffice/phpspreadsheet →

Share this vulnerability

FAQ

The CVSS score of this vulnerability is 7.1, indicating a high severity level.

You can use Vulert, which monitors open-source vulnerabilities in real-time. Visit Vulert's playground at Vulert Scanner to check if your application is affected without requiring any signup.

The potential impacts include unauthorized execution of JavaScript code, which can lead to data theft, session hijacking, and other malicious activities affecting users.

Yes, you can implement input sanitization in your application to reduce the risk of exploitation until you can update to the patched version.

The vulnerability was discovered by Aleksey Solovev 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.7 1.29.7
    composer require phpoffice/phpspreadsheet:1.29.7
  • >= 2.0.0, < 2.1.6 2.1.6
    composer require phpoffice/phpspreadsheet:2.1.6
  • >= 2.2.0, < 2.3.5 2.3.5
    composer require phpoffice/phpspreadsheet:2.3.5
  • >= 3.0.0, < 3.7.0 3.7.0
    composer require phpoffice/phpspreadsheet:3.7.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