Unauthenticated Cross-Site-Scripting (XSS) in sample file in PHPSpreadsheet
PHPSpreadsheet is a pure PHP library for reading and writing spreadsheet files. One of the sample scripts in PhpSpreadsheet is susceptible to a cross-site scripting (XSS) vulnerability due to improper handling of input where a number is expected leading to formula injection. The code in in `45_Quadratic_equation_solver.php` concatenates the user supplied parameters directly into spreadsheet formulas. This allows an attacker to take control over the formula and output unsanitized data into the page, resulting in JavaScript execution. This issue has been addressed in release versions 1.29.2, 2.1.1, and 2.3.0. All users are advised to upgrade. There are no known workarounds for this vulnerability.
- Products
- Not specified
- Affected versions
- Not specified
- Fixed versions
- Not specified
- CVEs
- CVE-2024-45060
- Confirmed fixed CVEs
- Not specified
- Updated in this feed
- 5 Nov 2026, 03:35 UTC · Revision 1
Source evidence
Unauthenticated Cross-Site-Scripting (XSS) in sample file in PHPSpreadsheet
core-osv · Original sourcePublished 7 Oct 2024, 20:15 UTC
PHPSpreadsheet is a pure PHP library for reading and writing spreadsheet files. One of the sample scripts in PhpSpreadsheet is susceptible to a cross-site scripting (XSS) vulnerability due to improper handling of input where a number is expected leading to formula injection. The code in in `45_Quadratic_equation_solver.php` concatenates the user supplied parameters directly into spreadsheet formulas. This allows an attacker to take control over the formula and output unsanitized data into the page, resulting in JavaScript execution. This issue has been addressed in release versions 1.29.2, 2.1.1, and 2.3.0. All users are advised to upgrade. There are no known workarounds for this vulnerability.
osv:CVE-2024-45060
Complete source record
{
"id": "5af894cabb280d69d6efb1da2e528c518384407951b4626e02aaed10e30cbb99",
"url": "https://osv.dev/vulnerability/CVE-2024-45060",
"method": "structured",
"payload": {
"kind": "advisory",
"title": "Unauthenticated Cross-Site-Scripting (XSS) in sample file in PHPSpreadsheet",
"summary": "PHPSpreadsheet is a pure PHP library for reading and writing spreadsheet files. One of the sample scripts in PhpSpreadsheet is susceptible to a cross-site scripting (XSS) vulnerability due to improper handling of input where a number is expected leading to formula injection. The code in in `45_Quadratic_equation_solver.php` concatenates the user supplied parameters directly into spreadsheet formulas. This allows an attacker to take control over the formula and output unsanitized data into the page, resulting in JavaScript execution. This issue has been addressed in release versions 1.29.2, 2.1.1, and 2.3.0. All users are advised to upgrade. There are no known workarounds for this vulnerability.",
"evidence": "osv:CVE-2024-45060",
"products": [],
"severity": "high",
"structured": {
"id": "CVE-2024-45060",
"aliases": [
"CVE-2024-45060",
"GHSA-v66g-p9x6-v98p"
],
"metrics": [
{
"type": "CVSS_V3",
"score": "CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:L/I:H/A:N"
}
],
"affected": [
{
"ranges": [
{
"repo": "https://github.com/phpoffice/phpspreadsheet",
"type": "GIT",
"events": [
{
"introduced": "0"
},
{
"fixed": "3a5a818d7d3e4b5bd2e56fb9de44dbded6eae07f"
},
{
"introduced": "4a77798f835119754961a97714f135826a323caa"
},
{
"fixed": "4e58d8ae1502d7f22af9e4cfeb2d645e243dec4e"
},
{
"introduced": "b0993b7e4d9c860133365d115b176bc6e0f57022"
},
{
"fixed": "c972c146ddd5e8350ea839355b9bb0ce6a8fa33e"
}
],
"database_specific": {
"extracted_events": [
{
"cpe": "cpe:2.3:a:phpoffice:phpspreadsheet:*:*:*:*:*:*:*:*",
"range": [
{
"introduced": "0"
},
{
"fixed": "1.29.2"
}
],
"source": "CPE_RANGE"
},
{
"cpe": "cpe:2.3:a:phpoffice:phpspreadsheet:*:*:*:*:*:*:*:*",
"range": [
{
"introduced": "2.0.0"
},
{
"fixed": "2.1.1"
}
],
"source": "CPE_RANGE"
},
{
"cpe": "cpe:2.3:a:phpoffice:phpspreadsheet:*:*:*:*:*:*:*:*",
"range": [
{
"introduced": "2.2.0"
},
{
"fixed": "2.3.0"
}
],
"source": "CPE_RANGE"
}
]
}
}
],
"versions": [
"2.1.0",
"1.29.1",
"2.2.2",
"1.29.0",
"2.2.1",
"2.2.0",
"2.0.0",
"1.28.0",
"1.27.0",
"1.25.2",
"1.25.1",
"1.25.0",
"1.24.1",
"1.24.0",
"1.23.0",
"1.22.0",
"1.21.0",
"1.20.0",
"1.19.0",
"1.18.0",
"1.17.1",
"1.17.0",
"1.16.0",
"1.15.0",
"1.14.1",
"1.14.0",
"1.13.0",
"1.12.0",
"1.11.0",
"1.10.1",
"1.10.0",
"1.8.2",
"1.8.1",
"1.8.0",
"1.7.0",
"1.6.0",
"1.5.0",
"1.4.1",
"1.4.0",
"1.3.1",
"1.3.0",
"1.2.1",
"1.2.0",
"1.1.0",
"1.0.0",
"1.0.0-beta2",
"phpexcel-last-cherry-picked-commit",
"phpexcel-last-release-1.8.1"
],
"database_specific": {
"source": "https://storage.googleapis.com/cve-osv-conversion/osv-output/CVE-2024-45060.json"
}
}
],
"modified": "2026-10-28T02:30:42.377038571Z",
"provider": "osv",
"references": [
"https://github.com/PHPOffice/PhpSpreadsheet/blob/d50b8b5de7e30439fb57eae7df9ea90e79fa0f2d/samples/Basic/45_Quadratic_equation_solver.php#L56",
"https://github.com/CVEProject/cvelistV5/tree/main/cves/2024/45xxx/CVE-2024-45060.json",
"https://github.com/PHPOffice/PhpSpreadsheet/security/advisories/GHSA-v66g-p9x6-v98p",
"https://nvd.nist.gov/vuln/detail/CVE-2024-45060"
],
"provider_metadata": {
"cwe_ids": [
"CWE-79"
],
"cna_assigner": "GitHub_M",
"osv_generated_from": "https://github.com/CVEProject/cvelistV5/tree/main/cves/2024/45xxx/CVE-2024-45060.json"
}
},
"related_cves": [
{
"value": "CVE-2024-45060",
"evidence": "/id"
}
],
"security_relevant": true,
"severity_evidence": "/severity/0/score"
},
"source_id": "core-osv",
"document_id": 509853,
"published_at": "2024-10-07T20:15:35.087+00:00"
}