{"id":"CVE-2024-45293","published":"2024-10-07T20:03:27Z","modified":"2024-10-07T20:25:10Z","title":"XML External Entity Reference (XXE) in PHPSpreadsheet's XLSX reader","vendor":"PHPOffice","product":"PhpSpreadsheet","tier":"tail","description":{"text":"PHPSpreadsheet is a pure PHP library for reading and writing spreadsheet files. The security scanner responsible for preventing XXE attacks in the XLSX reader can be bypassed by slightly modifying the XML structure, utilizing white-spaces. On servers that allow users to upload their own Excel (XLSX) sheets, Server files and sensitive information can be disclosed by providing a crafted sheet. The security scan function in src/PhpSpreadsheet/Reader/Security/XmlScanner.php contains a flawed XML encoding check to retrieve the input file's XML encoding in the toUtf8 function. The function searches for the XML encoding through a defined regex which looks for `encoding=\"*\"` and/or `encoding='*'`, if not found, it defaults to the UTF-8 encoding which bypasses the conversion logic. This logic can be used to pass a UTF-7 encoded XXE payload, by utilizing a whitespace before or after the = in the attribute definition. Sensitive information disclosure through the XXE on sites that allow users to upload their own excel spreadsheets, and parse them using PHPSpreadsheet's Excel parser. This issue has been addressed in release versions 1.29.1, 2.1.1, and 2.3.0. All users are advised to upgrade. There are no known workarounds for this vulnerability.","provenance":"source","from":"CVE.org"},"cvss":{"score":7.5,"severity":"HIGH","version":"3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N","provenance":"source","from":"CVE.org CNA"},"epss":{"score":0.02776,"percentile":0.86704,"provenance":"source"},"cwes":[{"id":"CWE-611","name":"Improper Restriction of XML External Entity Reference"}],"references":[{"url":"https://github.com/PHPOffice/PhpSpreadsheet/security/advisories/GHSA-6hwr-6v2f-3m88","tags":["x_refsource_CONFIRM"]}],"priority":{"score":27.6,"factors":[{"name":"EPSS percentile","points":17.34},{"name":"Public exploit code","points":5.0},{"name":"CVSS severity","points":5.25}]},"exploitSources":{"nuclei":[{"id":"CVE-2024-45293","name":"TablePress < 2.4.3 - XXE Injection","severity":"high","path":"http/cves/2024/CVE-2024-45293.yaml","url":"https://github.com/projectdiscovery/nuclei-templates/blob/main/http/cves/2024/CVE-2024-45293.yaml"}],"provenance":"source"},"vendorSlug":"phpoffice","affectedVersions":[{"vendor":"PHPOffice","product":"PhpSpreadsheet","versions":[">= 2.2.0, < 2.3.0","< 1.29.1",">= 2.0.0, < 2.1.1"]}],"ssvc":{"exploitation":"poc","automatable":"yes","technicalImpact":"partial","timestamp":"2024-10-07T20:23:44.790245Z","from":"CISA ADP","provenance":"source"},"affected":[{"ecosystem":"Packagist","package":"phpoffice/phpspreadsheet","vulnerableRanges":[">=2.2.0, <2.3.0","<1.29.1",">=2.0.0, <2.1.1"],"patched":["2.3.0","1.29.1","2.1.1"],"from":["GHSA-6hwr-6v2f-3m88"],"provenance":"source"},{"ecosystem":"Packagist","package":"phpoffice/phpexcel","vulnerableRanges":["<=1.8.2"],"patched":[],"from":["GHSA-6hwr-6v2f-3m88"],"provenance":"source"}],"summary":{"text":"A flaw in the XML security scanner of PhpSpreadsheet, a PHP library for reading and writing spreadsheet files, allows the XXE protection in its XLSX reader (src/PhpSpreadsheet/Reader/Security/XmlScanner.php) to be bypassed by adding whitespace around the attribute \"=\" so that the encoding check falls back to UTF-8 and a UTF-7 encoded payload is parsed. An unauthenticated remote attacker who can get a crafted XLSX file uploaded to a server that parses spreadsheets with this library can disclose server files and sensitive information, with no user interaction required.","provenance":"ai","model":"claude-haiku-5-5","generatedAt":"2026-11-20T06:42:11Z"},"euvd":{"id":"EUVD-2024-2967","exploited":false,"provenance":"source"},"lineage":{"familyId":"fam-phpoffice-phpspreadsheet-cve-2018-19277","parents":[{"from":"CVE-2024-45046","to":"CVE-2024-45293","relation":"related","confidence":"medium","kind":"lineage","evidence":[{"kind":"same-code","provenance":"machine","files":["src/PhpSpreadsheet/Writer/Html.php"],"commits":["https://github.com/PHPOffice/PhpSpreadsheet/commit/f7cf378faed2e11cf4825bf8bafea4922ae44667","https://github.com/PHPOffice/PhpSpreadsheet/commit/3bcd51826b7f089d1641e756c83030c30c3bdb0c","https://github.com/PHPOffice/PhpSpreadsheet/commit/7d6cb09f6e8204f65e6dd5a0490f7f45f44bb331"],"basis":"shared function","functions":["createCSSStyleFont"]}]},{"from":"CVE-2024-45048","to":"CVE-2024-45293","relation":"related","confidence":"medium","kind":"lineage","evidence":[{"kind":"same-code","provenance":"machine","files":["src/PhpSpreadsheet/Reader/Security/XmlScanner.php"],"commits":["https://github.com/PHPOffice/PhpSpreadsheet/commit/bea2d4b30f24bcc8a7712e208d1359e603b45dda","https://github.com/PHPOffice/PhpSpreadsheet/commit/3bcd51826b7f089d1641e756c83030c30c3bdb0c","https://github.com/PHPOffice/PhpSpreadsheet/commit/7d6cb09f6e8204f65e6dd5a0490f7f45f44bb331"],"basis":"shared function","functions":["forceString","toUtf8"]}]}],"children":[{"from":"CVE-2024-45293","to":"CVE-2026-108357","relation":"related","confidence":"medium","kind":"lineage","evidence":[{"kind":"same-code","provenance":"machine","files":["src/PhpSpreadsheet/Reader/Security/XmlScanner.php"],"commits":["https://github.com/PHPOffice/PhpSpreadsheet/commit/3bcd51826b7f089d1641e756c83030c30c3bdb0c","https://github.com/PHPOffice/PhpSpreadsheet/commit/7d6cb09f6e8204f65e6dd5a0490f7f45f44bb331","https://github.com/PHPOffice/PhpSpreadsheet/commit/89f455c133e1a7e2d4abfadc43ce29eb7450d781"],"basis":"shared function","functions":["toUtf8"]}]},{"from":"CVE-2024-45293","to":"CVE-2026-108358","relation":"related","confidence":"medium","kind":"lineage","evidence":[{"kind":"same-code","provenance":"machine","files":["src/PhpSpreadsheet/Reader/Security/XmlScanner.php"],"commits":["https://github.com/PHPOffice/PhpSpreadsheet/commit/3bcd51826b7f089d1641e756c83030c30c3bdb0c","https://github.com/PHPOffice/PhpSpreadsheet/commit/7d6cb09f6e8204f65e6dd5a0490f7f45f44bb331","https://github.com/PHPOffice/PhpSpreadsheet/commit/299993894dce37aa3b64aa23e9a3f4bb77ab0e66","https://github.com/PHPOffice/PhpSpreadsheet/commit/89f455c133e1a7e2d4abfadc43ce29eb7450d781"],"basis":"shared function","functions":["toUtf8"]}]},{"from":"CVE-2024-45293","to":"CVE-2026-108359","relation":"related","confidence":"medium","kind":"lineage","evidence":[{"kind":"same-code","provenance":"machine","files":["src/PhpSpreadsheet/Reader/Security/XmlScanner.php"],"commits":["https://github.com/PHPOffice/PhpSpreadsheet/commit/3bcd51826b7f089d1641e756c83030c30c3bdb0c","https://github.com/PHPOffice/PhpSpreadsheet/commit/7d6cb09f6e8204f65e6dd5a0490f7f45f44bb331","https://github.com/PHPOffice/PhpSpreadsheet/commit/299993894dce37aa3b64aa23e9a3f4bb77ab0e66","https://github.com/PHPOffice/PhpSpreadsheet/commit/2de29384aa11223ee08136c0e6a9e9981bc1a2eb"],"basis":"shared function","functions":["toUtf8"]}]},{"from":"CVE-2024-45293","to":"CVE-2026-108360","relation":"related","confidence":"medium","kind":"lineage","evidence":[{"kind":"same-code","provenance":"machine","files":["src/PhpSpreadsheet/Reader/Security/XmlScanner.php"],"commits":["https://github.com/PHPOffice/PhpSpreadsheet/commit/3bcd51826b7f089d1641e756c83030c30c3bdb0c","https://github.com/PHPOffice/PhpSpreadsheet/commit/7d6cb09f6e8204f65e6dd5a0490f7f45f44bb331","https://github.com/PHPOffice/PhpSpreadsheet/commit/299993894dce37aa3b64aa23e9a3f4bb77ab0e66","https://github.com/PHPOffice/PhpSpreadsheet/commit/94590951d76a250a5fc1ecf69a0b3f7439a9af49"],"basis":"shared function","functions":["toUtf8"]}]}]}}