Vulnerabilities

CVE-2024-45291

High 8.8 CVSS 3.1

Description

PHPSpreadsheet is a pure PHP library for reading and writing spreadsheet files. It's possible for an attacker to construct an XLSX file that links images from arbitrary paths. When embedding images has been enabled in HTML writer with `$writer->setEmbedImages(true);` those files will be included in the output as `data:` URLs, regardless of the file's type. Also URLs can be used for embedding, resulting in a Server-Side Request Forgery vulnerability. When embedding images has been enabled, an attacker can read arbitrary files on the server and perform arbitrary HTTP GET requests. Note that any PHP protocol wrappers can be used, meaning that if for example the `expect://` wrapper is enabled, also remote code execution is possible. This issue has been addressed in release versions 1.29.2, 2.1.1, and 2.3.0. All users are advised to upgrade. there are no known workarounds for this vulnerability.

Description as published by the source, in English.

Key facts

Published
2024-10-07
Last modified
2026-06-17
Assigned by
security-advisories@github.com
CVSS vector
CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H
Scored by
nvd@nist.gov (NVD Primary)
Probability of exploitation
0.8 % higher than 53 % of all known vulnerabilities
EPSS, next 30 days, model v2026.06.15
Fix available
Not registered in the sources

Affected products

Vendor Product Versions Status
phpoffice phpexcel (Packagist) ≤ 1.8.2 Affected
phpoffice phpspreadsheet (Packagist) < 1.29.2 Affected
Phpoffice Phpspreadsheet < 1.29.2 Affected
phpoffice phpspreadsheet (Packagist) ≥ 2.0.0, < 2.1.1 Affected
Phpoffice Phpspreadsheet ≥ 2.0.0, < 2.1.1 Affected
phpoffice phpspreadsheet (Packagist) ≥ 2.2.0, < 2.3.0 Affected
Phpoffice Phpspreadsheet ≥ 2.2.0, < 2.3.0 Affected

Weakness type

  • CWE-22: Improper Limitation of a Pathname to a Restricted Directory

    The product uses external input to construct a pathname that is intended to identify a file or directory that is located underneath a restricted parent directory, but the product does not properly neutralize special ele…

  • CWE-36: Absolute Path Traversal

    The product uses external input to construct a pathname that should be within a restricted directory, but it does not properly neutralize absolute path sequences such as "/abs/path" that can resolve to a location that i…

  • CWE-918: Server-Side Request Forgery

    The web server receives a URL or similar request from an upstream component and retrieves the contents of this URL, but it does not sufficiently ensure that the request is being sent to the expected destination.

References

Does this affect you?

A vulnerability matters only if you run the product, in an affected version, somewhere an attacker can reach.

Check your asset list Browse all vulnerabilities