CVE-2024-56412
PHP vulnerability analysis and mitigation

Overview

PhpSpreadsheet, a PHP library for reading and writing spreadsheet files, was found to contain a cross-site scripting (XSS) vulnerability identified as CVE-2024-56412. The vulnerability affects versions prior to 3.7.0, 2.3.5, 2.1.6, and 1.29.7, where attackers could bypass the cross-site scripting sanitizer using the javascript protocol and special characters. The vulnerability was discovered by Aleksey Solovev from Positive Technologies and disclosed on January 3, 2025 (GitHub Advisory, NVD).

Technical details

The vulnerability exists in the PhpOffice\PhpSpreadsheet\Writer\Html class, specifically in the generateRow method. An attacker can exploit this by using special characters that allow the library to process the javascript protocol and generate an HTML link. The vulnerability has been assigned a CVSS v3.1 base score of 5.4 (MEDIUM) and a CVSS v4.0 score of 4.8 (MEDIUM). The attack vector is network-based, with low attack complexity and requires low privileges with user interaction (GitHub Advisory).

Impact

When successfully exploited, the vulnerability allows attackers to execute arbitrary JavaScript code in the browser. This occurs when a user views a specially crafted Excel file that has been processed by the library. The vulnerability specifically impacts the HTML generation functionality when processing spreadsheet files (GitHub Advisory).

Mitigation and workarounds

The vulnerability has been patched in versions 3.7.0, 2.3.5, 2.1.6, and 1.29.7. The fix includes additional sanitization of special characters in strings. Users are advised to upgrade to these patched versions to protect against potential XSS attacks (GitHub Advisory, NVD).

Additional resources


SourceThis report was generated using AI

Related PHP vulnerabilities:

CVE ID

Severity

Score

Technologies

Component name

CISA KEV exploit

Has fix

Published date

GHSA-898v-775g-777cCRITICAL9.4
  • PHPPHP
  • neuron-core/neuron-ai
NoYesDec 09, 2025
GHSA-5j8p-438x-rgg5CRITICAL9.3
  • PHPPHP
  • onelogin/php-saml
NoYesDec 09, 2025
GHSA-j8g6-5gqc-mq36HIGH8.2
  • PHPPHP
  • neuron-core/neuron-ai
NoYesDec 09, 2025
GHSA-pvcv-q3q7-266gHIGH8.1
  • PHPPHP
  • filament/filament
NoYesDec 09, 2025
GHSA-6w82-v552-wjw2HIGH7.1
  • PHPPHP
  • shopware/shopware
NoYesDec 09, 2025

Free Vulnerability Assessment

Benchmark your Cloud Security Posture

Evaluate your cloud security practices across 9 security domains to benchmark your risk level and identify gaps in your defenses.

Request assessment

Get a personalized demo

Ready to see Wiz in action?

"Best User Experience I have ever seen, provides full visibility to cloud workloads."
David EstlickCISO
"Wiz provides a single pane of glass to see what is going on in our cloud environments."
Adam FletcherChief Security Officer
"We know that if Wiz identifies something as critical, it actually is."
Greg PoniatowskiHead of Threat and Vulnerability Management