Register for the AI for Security Summit: Join Figma, Perplexity & Wiz

CVE-2025-22131
PHP vulnerability analysis and mitigation

Overview

PhpSpreadsheet, a PHP library for reading and writing spreadsheet files, contains a Cross-Site Scripting (XSS) vulnerability discovered in January 2025. The vulnerability exists in the code that translates XLSX files into HTML representation and specifically affects the generateNavigation() function. The vulnerability impacts multiple versions including 3.0.0-3.8.0, 1.x before 1.29.8, 2.0.0-2.1.7, and 2.2.0-2.3.6 (GitHub Advisory).

Technical details

The vulnerability occurs in the navigation menu generation when handling multiple sheets in an XLSX file. Sheet names are not properly sanitized before being included in the HTML output, allowing for potential JavaScript code execution. The vulnerability has been assigned a CVSS v4 score of 5.1 (Moderate), with the following metrics: Network attack vector, Low attack complexity, No attack requirements, No privileges required, and Active user interaction required (GitHub Advisory).

Impact

The XSS vulnerability can lead to various security issues ranging from minor annoyances to complete account compromise. Potential impacts include session cookie disclosure (if HttpOnly flag is not set), user redirection to malicious sites, content modification including fake login page injection, automatic malicious file downloads, and unauthorized access to user's geolocation or camera (GitHub Advisory).

Exploitability

The vulnerability requires an attacker to create a malicious XLSX file with specially crafted sheet names containing JavaScript code. When this file is processed and displayed through the HTML generation feature, the malicious code can execute in the context of the user's browser (GitHub Advisory).

Mitigation and workarounds

The vulnerability has been patched in versions 3.8.0, 1.29.8, 2.1.7, and 2.3.6. Users should upgrade to these or later versions to mitigate the vulnerability. The fix involves properly sanitizing sheet names using htmlspecialchars() before including them in the HTML output (GitHub Advisory).

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

CVE-2026-56829HIGH8.1
  • PHP logoPHP
  • shopper/framework
NoYesSep 15, 2026
CVE-2026-56827HIGH8.1
  • PHP logoPHP
  • shopper/framework
NoYesSep 15, 2026
CVE-2026-84997HIGH7.5
  • PHP logoPHP
  • composer://react/http
NoYesSep 16, 2026
CVE-2026-56831MEDIUM6.5
  • PHP logoPHP
  • shopper/framework
NoYesSep 15, 2026
CVE-2026-56830MEDIUM6.5
  • PHP logoPHP
  • shopper/framework
NoYesSep 15, 2026

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