Advisory Database
  • Advisories
  • Dependency Scanning
  1. composer
  2. ›
  3. phpoffice/phpspreadsheet
  4. ›
  5. CVE-2026-40296

CVE-2026-40296: PhpSpreadsheet has XSS via number format code with @ text placeholder bypasses htmlspecialchars in HTML writer

April 28, 2026 (updated May 8, 2026)

It was discovered that there is a way to bypass HTML escaping in the HTML writer using custom number format codes.

References

  • github.com/PHPOffice/PhpSpreadsheet
  • github.com/PHPOffice/PhpSpreadsheet/security/advisories/GHSA-hrmw-qprp-wgmc
  • github.com/advisories/GHSA-hrmw-qprp-wgmc
  • nvd.nist.gov/vuln/detail/CVE-2026-40296

Code Behaviors & Features

Detect and mitigate CVE-2026-40296 with GitLab Dependency Scanning

Secure your software supply chain by verifying that all open source dependencies used in your projects contain no disclosed vulnerabilities. Learn more about Dependency Scanning →

Affected versions

All versions before 1.30.4, all versions starting from 2.0.0 before 2.1.16, all versions starting from 2.2.0 before 2.4.5, all versions starting from 3.3.0 before 3.10.5, all versions starting from 4.0.0 before 5.7.0

Fixed versions

  • 5.7.0
  • 3.10.5
  • 2.4.5
  • 2.1.16
  • 1.30.4

Solution

Upgrade to versions 1.30.4, 2.1.16, 2.4.5, 3.10.5, 5.7.0 or above.

Impact 5.4 MEDIUM

CVSS:3.1/AV:N/AC:L/PR:L/UI:R/S:C/C:L/I:L/A:N

Learn more about CVSS

Weakness

  • CWE-79: Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting')

Source file

packagist/phpoffice/phpspreadsheet/CVE-2026-40296.yml

Spotted a mistake? Edit the file on GitLab.

  • Site Repo
  • About GitLab
  • Terms
  • Privacy Statement
  • Contact

Page generated Sat, 09 May 2026 12:18:55 +0000.