CVE-2020-7776:
Cross-site scripting in phpoffice/phpspreadsheet
6.4
CVSS ScoreBasic Information
CVE ID
GHSA ID
EPSS Score
-
CWE
Published
5/6/2021
Updated
3/6/2025
KEV Status
No
Technology
PHP
Technical Details
CVSS Vector
CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:C/C:L/I:L/A:N
Package Name | Ecosystem | Vulnerable Versions | First Patched Version |
---|---|---|---|
phpoffice/phpspreadsheet | composer | < 1.16.0 | 1.16.0 |
phpoffice/phpexcel | composer | <= 1.8.2 |
Vulnerability Intelligence
Miggo AI
Root Cause Analysis
The vulnerability stemmed from how cell comments were handled in HTML output generation. The commit 0ed5b800be2136bcb8fa9c1bdf59abc957a98845 shows the fix involved adding HTML escaping (htmlspecialchars) to comment text in writeCommentTag. Prior to this fix, the function directly output user-supplied comments without sanitization, making it susceptible to XSS when comments contained malicious scripts. The affected code path is clearly shown in the HTML writer's comment handling logic.