VYPR
Moderate severityNVD Advisory· Published Dec 9, 2020· Updated Sep 16, 2024

Cross-site Scripting (XSS)

CVE-2020-7776

Description

This affects the package phpoffice/phpspreadsheet from 0.0.0. The library is vulnerable to XSS when creating an html output from an excel file by adding a comment on any cell. The root cause of this issue is within the HTML writer where user comments are concatenated as part of link and this is returned as HTML. A fix for this issue is available on commit 0ed5b800be2136bcb8fa9c1bdf59abc957a98845/master branch.

AI Insight

LLM-synthesized narrative grounded in this CVE's description and references.

PhpSpreadsheet HTML writer is vulnerable to stored XSS via cell comments, allowing script injection when converting Excel files to HTML.

Vulnerability

Overview

CVE-2020-7776 is a stored cross-site scripting (XSS) vulnerability in the PHPOffice PhpSpreadsheet library, affecting all versions prior to 1.16.0. The root cause lies in the HTML writer, which fails to sanitize user-controlled cell comments when generating HTML output from an Excel file. Comments are concatenated directly into the generated HTML without proper escaping, enabling an attacker to inject arbitrary JavaScript or HTML. [1][2][3]

Attack

Vector and Exploitation

An attacker can exploit this vulnerability by crafting an Excel file containing a malicious payload (e.g., `) within a cell comment. When this file is loaded and converted to HTML using the library's IOFactory::createWriter($spreadsheet, 'Html')` method, the injected script is embedded into the resulting HTML output. Any user who then views the generated HTML file in a browser will execute the attacker's script. No prior authentication is required; the attack only needs the victim to process a malicious Excel file through the affected library. [3]

Impact

Successful exploitation leads to stored XSS, which can be used to steal session cookies, redirect users to malicious sites, deface web content, or perform other actions within the context of the victim's browser session. Because the HTML output can be served to multiple users (e.g., in a web application that converts uploaded spreadsheets), the impact may extend to many victims. [1][2][3]

Mitigation

The vulnerability was fixed in commit 0ed5b800be2136bcb8fa9c1bdf59abc957a98845, and the patch is included in PhpSpreadsheet version 1.16.0 and later. Users should upgrade to the latest version of the library. No workaround is available if the HTML writer is used with untrusted Excel input. The vulnerability is publicly documented and proof-of-concept code exists. [1][3][4]

AI Insight generated on May 21, 2026. Synthesized from this CVE's description and the cited reference URLs; citations are validated against the source bundle.

Affected packages

Versions sourced from the GitHub Security Advisory.

PackageAffected versionsPatched versions
phpoffice/phpspreadsheetPackagist
< 1.16.01.16.0
phpoffice/phpexcelPackagist
<= 1.8.2

Affected products

3

Patches

0

No patches discovered yet.

Vulnerability mechanics

AI mechanics synthesis has not run for this CVE yet.

References

7

News mentions

0

No linked articles in our index yet.