Cross-site Scripting (XSS) Affecting phpoffice/phpexcel package, versions >=0.0.0


Severity

Recommended
0.0
medium
0
10

CVSS assessment made by Snyk's Security Team. Learn more

Threat Intelligence

Exploit Maturity
Proof of Concept
EPSS
0.05% (20th percentile)

Do your applications use this vulnerable package?

In a few clicks we can analyze your entire application and see what components are vulnerable in your application, and suggest you quick fixes.

Test your applications

Snyk Learn

Learn about Cross-site Scripting (XSS) vulnerabilities in an interactive lesson.

Start learning
  • Snyk IDSNYK-PHP-PHPOFFICEPHPEXCEL-9299810
  • published7 Mar 2025
  • disclosed7 Oct 2024
  • creditMatthew Rollings

Introduced: 7 Oct 2024

CVE-2024-45060  (opens in a new tab)
CWE-79  (opens in a new tab)

How to fix?

There is no fixed version for phpoffice/phpexcel.

Overview

Affected versions of this package are vulnerable to Cross-site Scripting (XSS) through the discriminantFormula and r1Formula processes due to improper user input sanitization. An attacker can execute arbitrary JavaScript code by injecting malicious input into the POST parameters used in these formulas.

Note:

This is only exploitable if the sample script 45_Quadratic_equation_solver.php is accessible and used in a web environment. These sample scripts are not included if the package is used from Composer, but only if the entire git repository is included.

PoC

  1. Access 45_Quadratic_equation_solver.php in a browser

  2. Enter any valid values for for b and c, and enter the following for a

1) & ("1)),1)&char(60)&char(105)&char(109)&char(103)&char(32)&char(115)&char(114)&char(99)&char(61)&char(120)&char(32)&char(111)&char(110)&char(101)&char(114)&char(114)&char(111)&char(114)&char(61)&char(97)&char(108)&char(101)&char(114)&char(116)&char(40)&char(41)&char(62)&POWER(((1") &n("1")&(1
  1. Press submit and observe that JavaScript is executed.

CVSS Base Scores

version 4.0
version 3.1