Skip to content
Laskyr

phpoffice/phpspreadsheet security advisory

CVE-2026-35453: PhpSpreadsheet has XSS via NumberFormat @ Text Substitution in HTML Writer

CVE-2026-35453 is a medium-severity XSS vulnerability in the PHP package phpoffice/phpspreadsheet (CVSS 5.4), published 5 May 2026. The advisory does not name a fixed version. Exploiting it needs a low-privilege user account.

medium 5.4 published 2026-05-05 · updated 2026-07-24

The advisory does not name a fixed version

This XSS issue affects phpoffice/phpspreadsheet in 5 release lines: <= 1.30.3; >= 2.0.0, <= 2.1.15; >= 2.2.0, <= 2.4.4; >= 3.3.0, <= 3.10.4; >= 4.0.0, <= 5.6.0. The newest release (5.10.0) is outside the affected range.

Affected versions
<= 1.30.3
>= 2.0.0, <= 2.1.15
>= 2.2.0, <= 2.4.4
>= 3.3.0, <= 3.10.4
>= 4.0.0, <= 5.6.0
Fixed in
not stated
Newest release
5.10.0
Severity
Medium · CVSS 5.4
Type
Cross-site scripting (XSS)
CWE-79
Exploited in the wild
Not on the CISA KEV list
checked 2026-11-04

Is your phpoffice/phpspreadsheet version affected?

Run composer show phpoffice/phpspreadsheet in your project, then enter the version. We check it against this and every other known phpoffice/phpspreadsheet advisory.

Who can exploit CVE-2026-35453

CVSS vector (scored by NVD): CVSS:3.1/AV:N/AC:L/PR:L/UI:R/S:C/C:L/I:L/A:N

Your app is only exposed if it uses the affected part of phpoffice/phpspreadsheet. The advisory below says which part that is. If you are not sure, upgrade anyway: it costs less than finding out.

How to fix CVE-2026-35453 in phpoffice/phpspreadsheet

  1. Find the installed version: composer show phpoffice/phpspreadsheet. If you never required it yourself, composer why phpoffice/phpspreadsheet shows which package pulls it in.
  2. Update it: composer update phpoffice/phpspreadsheet --with-all-dependencies.
  3. If Composer will not go that high, your composer.json constraint is holding it back. Widen it (for example "phpoffice/phpspreadsheet": "^5.10.0" if you can take that version), or upgrade the package that requires it.
  4. Run composer audit. It reads the same advisory data and should no longer list CVE-2026-35453.
  5. Commit composer.lock and deploy it. On the server, run composer install --no-dev from the lock file, not composer update.

If you cannot upgrade yet

General hardening for XSS issues while the upgrade waits. None of it replaces the fix.

The CVE-2026-35453 advisory

PhpSpreadsheet is a library for reading and writing spreadsheet files. In versions 1.30.3 and earlier, 2.0.0 through 2.1.15, 2.2.0 through 2.4.4, 3.3.0 through 3.10.4, and 4.0.0 through 5.6.0, the HTML Writer skips htmlspecialchars() output escaping when a cell uses a custom number format containing the @ text placeholder with additional literal text (e.g., @ "items"). The escaping is only applied when the formatted output strictly equals the original cell value. When the format code contains @ with quoted literal text, the formatter substitutes the raw cell value into the format string and returns early without invoking the escaping callback. An attacker who can control cell content in a spreadsheet processed by the HTML Writer can inject arbitrary HTML and JavaScript into the generated output. This issue has been fixed in versions 1.30.4, 2.1.16, 2.4.5, 3.10.5, and 5.7.0.

Description from the CVE record, published by GitHub (the CVE Numbering Authority), via the NVD entry for CVE-2026-35453. Advisory title: “PhpSpreadsheet has XSS via NumberFormat @ Text Substitution in HTML Writer”.

References

Other phpoffice/phpspreadsheet advisories

Related

Need help patching or upgrading? Laskyr does PHP and Laravel security fixes and upgrades. Tell us what you run and we reply with a plan and a price.

Ask about a fix

Where this data comes from

First hour checklist

If the site was just hacked, read the emergency kit before you delete files. The page is free. Email is optional.

Read the emergency kit