CVE-2024-45291
Path traversal and Server-Side Request Forgery in HTML writer when embedding images is enabled in PHPSpreadsheet
Also known as GHSA-w9xv-qf98-ccq4
Mitigation
- Upgrade phpoffice/phpspreadsheet to one of 2.3.0, 1.29.2, 2.1.1 (or later in the same release line).
Who should check
- Projects that depend on Packagist package phpoffice/phpspreadsheet (>= 2.2.0, < 2.3.0)
- Projects that depend on Packagist package phpoffice/phpexcel (<= 1.8.2)
- Anyone running PHPOffice PhpSpreadsheet < 1.29.2; >= 2.0.0, < 2.1.1; >= 2.2.0, < 2.3.0
Vulnerability facts
- Affected
- phpoffice/phpspreadsheet >= 2.2.0, < 2.3.0; phpoffice/phpexcel <= 1.8.2
- Fixed in
- 2.3.0, 1.29.2, 2.1.1
- Exploited in the wild
- Not in CISA KEV
- Public exploit / PoC
- None known
- Remote exploitation
- Remote, login needed
- CVSS
- 6.3 (v3.1, CNA)CVSS:3.1/AV:N/AC:H/PR:L/UI:N/S:C/C:H/I:N/A:NOpen in CVSS calculator
Show all 8 CVSS metrics
- Attack vector: Network
- Attack complexity: High
- Privileges required: Low
- User interaction: None
- Scope: Changed (impact reaches other components)
- Confidentiality impact: High
- Integrity impact: None
- Availability impact: None
- EPSS
- 1.14% chance of exploitation in 30 days (percentile 66, 2026-11-26)
- CWE
- CWE-36, CWE-918
- Modified
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.
Affected and fixed versions
| Package / product | Affected | Fixed | Source |
|---|---|---|---|
| Packagist phpoffice/phpspreadsheet | >= 2.2.0, < 2.3.0 | 2.3.0, 1.29.2, 2.1.1 | osv |
| Packagist phpoffice/phpexcel | <= 1.8.2 | — | osv |
| PHPOffice PhpSpreadsheet | < 1.29.2; >= 2.0.0, < 2.1.1; >= 2.2.0, < 2.3.0 | — | cvelist |
Check your systems with an agent
Paste this into Claude Code, Cursor or another coding agent. It only reads; it changes nothing.
Check whether anything I run is affected by CVE-2024-45291. Work read-only: do not install, upgrade, delete or change anything. Details: https://flawdb.com/CVE-2024-45291.md Affected: phpoffice/phpspreadsheet >= 2.2.0, < 2.3.0; phpoffice/phpexcel <= 1.8.2 Fixed in: 2.3.0, 1.29.2, 2.1.1 Steps: 1. Search this machine and project for phpoffice/phpspreadsheet (Packagist), phpoffice/phpexcel (Packagist), PHPOffice PhpSpreadsheet: dependency manifests and lockfiles, installed packages, container images and running services. 2. For each match, note the installed version and whether it is inside the affected range. 3. Report a table: location, installed version, affected (yes / no / unsure), evidence. If affected, say which fixed version or mitigation from the details link applies, but don't apply it.
References
Vendor advisories
Patches
FAQ
Is CVE-2024-45291 being exploited?
There is no confirmed exploitation: CVE-2024-45291 is not in the CISA Known Exploited Vulnerabilities catalog. No public exploit code is known. EPSS estimates a 1.14% chance of exploitation in the next 30 days (as of 2026-11-26).
How serious is CVE-2024-45291?
Medium: CVSS 6.3 (v3.1, scored by CNA). Remote, login needed. The attack needs conditions outside the attacker's control, which makes it harder.
Which versions are affected by CVE-2024-45291?
phpoffice/phpspreadsheet >= 2.2.0, < 2.3.0; phpoffice/phpexcel <= 1.8.2.
Is there a fix for CVE-2024-45291?
Yes. Fixed in 2.3.0, 1.29.2, 2.1.1. Upgrade phpoffice/phpspreadsheet to one of 2.3.0, 1.29.2, 2.1.1 (or later in the same release line).
How do I check if I'm affected by CVE-2024-45291?
Find where you use the affected software (dependency lockfiles, installed packages, container images, servers) and compare the installed version with the affected range above. The agent prompt on this page does this read-only.