From a98c03dcf23f0e89256b8637c1d30816b40aae6a Mon Sep 17 00:00:00 2001
From: "advisory-database[bot]"
<45398580+advisory-database[bot]@users.noreply.github.com>
Date: Mon, 3 Feb 2025 15:41:08 +0000
Subject: [PATCH] Publish GHSA-r57h-547h-w24f
---
.../GHSA-r57h-547h-w24f.json | 122 ++++++++++++++++++
1 file changed, 122 insertions(+)
create mode 100644 advisories/github-reviewed/2025/02/GHSA-r57h-547h-w24f/GHSA-r57h-547h-w24f.json
diff --git a/advisories/github-reviewed/2025/02/GHSA-r57h-547h-w24f/GHSA-r57h-547h-w24f.json b/advisories/github-reviewed/2025/02/GHSA-r57h-547h-w24f/GHSA-r57h-547h-w24f.json
new file mode 100644
index 00000000000..405862cf84a
--- /dev/null
+++ b/advisories/github-reviewed/2025/02/GHSA-r57h-547h-w24f/GHSA-r57h-547h-w24f.json
@@ -0,0 +1,122 @@
+{
+ "schema_version": "1.4.0",
+ "id": "GHSA-r57h-547h-w24f",
+ "modified": "2025-02-03T15:39:31Z",
+ "published": "2025-02-03T15:39:31Z",
+ "aliases": [
+ "CVE-2025-23210"
+ ],
+ "summary": "PhpSpreadsheet allows bypassing of XSS sanitizer using the javascript protocol and special characters",
+ "details": "**Product:** PhpSpreadsheet\n**Version:** 3.8.0\n**CWE-ID:** CWE-79: Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting')\n**CVSS vector v.3.1:** 5.4 (AV:N/AC:L/PR:L/UI:R/S:C/C:L/I:L/A:N)\n**CVSS vector v.4.0:** 4.8 (AV:N/AC:L/AT:N/PR:L/UI:A/VC:L/VI:L/VA:N/SC:L/SI:L/SA:N)\n**Description:** an attacker can use special characters, so that the library processes the javascript protocol with special characters and generates an HTML link\n**Impact:** executing arbitrary JavaScript code in the browser\n**Vulnerable component:** class `PhpOffice\\PhpSpreadsheet\\Writer\\Html`, method `generateRow`\n**Exploitation conditions:** a user viewing a specially generated xml file\n**Mitigation:** additional sanitization of special characters in a string\n**Researcher: Igor Sak-Sakovskiy (Positive Technologies)**\n\n# Research\n\nThe researcher discovered zero-day vulnerability Bypass XSS sanitizer using the javascript protocol and special characters in Phpspreadsheet.\nThe following code is written on the server, which translates the XML file into an HTML representation and displays it in the response.\n\n*Listing 4. Source code on the server*\n\n```\nload($inputFileName); \n \n$writer = new \\PhpOffice\\PhpSpreadsheet\\Writer\\Html($spreadsheet); \nprint($writer->generateHTMLAll());\n```\nThe contents of the xml file - `./doc/file.xml`\n\n*Listing 5. The contents of the xml file*\n```\n \n \n \n \n author \n author \n 2015-06-05T18:19:34Z \n 2024-12-25T10:16:07Z \n 16.00 \n \n \n \n \n \n 11020 \n 19420 \n 32767 \n 32767 \n False \n False \n \n \n \n \n \n \n \n \n \n \n \n 1 \n \n \n 3 \n 6 \n \n \n False \n False \n \n \n\n```\n\nDue to the load with a special character in front of the javascript protocol, the execution flow hits line 1595, not 1593.\n \n*Figure 4. Generating a link bypassing a regular expression*\n\n\nIn the response from the server, you can see which special character is located in front of the javascript protocol after conversion.\n \n*Figure 5. Response from the server with a special character*\n\n\nWhen viewing the rendered result, a link becomes visible in the browser, and when clicked, the embedded JavaScript code will be executed.\n\n*Figure 6. Executing JavaScript code*\n
\n_____________________________________________\n\n## Credit\n\nIgor Sak-Sakovskiy (Positive Technologies)\n",
+ "severity": [
+ {
+ "type": "CVSS_V3",
+ "score": "CVSS:3.1/AV:N/AC:L/PR:L/UI:R/S:C/C:L/I:L/A:N"
+ },
+ {
+ "type": "CVSS_V4",
+ "score": "CVSS:4.0/AV:N/AC:L/AT:N/PR:L/UI:A/VC:L/VI:L/VA:N/SC:L/SI:L/SA:N"
+ }
+ ],
+ "affected": [
+ {
+ "package": {
+ "ecosystem": "Packagist",
+ "name": "phpoffice/phpspreadsheet"
+ },
+ "ranges": [
+ {
+ "type": "ECOSYSTEM",
+ "events": [
+ {
+ "introduced": "3.0.0"
+ },
+ {
+ "fixed": "3.9.0"
+ }
+ ]
+ }
+ ]
+ },
+ {
+ "package": {
+ "ecosystem": "Packagist",
+ "name": "phpoffice/phpspreadsheet"
+ },
+ "ranges": [
+ {
+ "type": "ECOSYSTEM",
+ "events": [
+ {
+ "introduced": "0"
+ },
+ {
+ "fixed": "1.29.9"
+ }
+ ]
+ }
+ ]
+ },
+ {
+ "package": {
+ "ecosystem": "Packagist",
+ "name": "phpoffice/phpspreadsheet"
+ },
+ "ranges": [
+ {
+ "type": "ECOSYSTEM",
+ "events": [
+ {
+ "introduced": "2.2.0"
+ },
+ {
+ "fixed": "2.3.7"
+ }
+ ]
+ }
+ ]
+ },
+ {
+ "package": {
+ "ecosystem": "Packagist",
+ "name": "phpoffice/phpspreadsheet"
+ },
+ "ranges": [
+ {
+ "type": "ECOSYSTEM",
+ "events": [
+ {
+ "introduced": "2.0.0"
+ },
+ {
+ "fixed": "2.1.8"
+ }
+ ]
+ }
+ ]
+ }
+ ],
+ "references": [
+ {
+ "type": "WEB",
+ "url": "https://github.com/PHPOffice/PhpSpreadsheet/security/advisories/GHSA-r57h-547h-w24f"
+ },
+ {
+ "type": "WEB",
+ "url": "https://github.com/PHPOffice/PhpSpreadsheet/commit/cde2926a9e2baf146783f8fd1771bbed7d1dc7b3"
+ },
+ {
+ "type": "PACKAGE",
+ "url": "https://github.com/PHPOffice/PhpSpreadsheet"
+ }
+ ],
+ "database_specific": {
+ "cwe_ids": [
+ "CWE-79"
+ ],
+ "severity": "MODERATE",
+ "github_reviewed": true,
+ "github_reviewed_at": "2025-02-03T15:39:31Z",
+ "nvd_published_at": null
+ }
+}
\ No newline at end of file