Skip to main content
VulnerabilityPublished

CVE-2026-40296: PHPOffice PhpSpreadsheet · Cross-site Scripting

Affects PHPOffice PhpSpreadsheetSource CVE Database V5

0
Compare

Not known to be exploited · CVSS 5.4 Medium · fixed in 5.7.0 : update PHPOffice PhpSpreadsheet when convenient.

Data as of 29 Oct 2026, 19:04 UTC

CVSS 3.1 base score
5.4Medium
How severe the flaw is on the 0–10 CVSS scale.
EPSS
0.2% chance of exploitation in 30 days – higher than 13% of CVEsExploit Prediction Scoring System: the likelihood attackers will use this flaw soon.
Patch
Available – fixed in 5.7.0
CVSS:3.1/AV:N/AC:L/PR:L/UI:R/S:C/C:L/I:L/A:N

Exploitation evidence

  1. Disclosed: evidence found.

    CVE published 6 May 2026

  2. Detectable: no evidence on record.

    No public nuclei template indexed

  3. Weaponized: no evidence on record.

    No public exploit code indexed in Metasploit or Exploit-DB

  4. Exploited in the wild: no evidence on record.

    Not in CISA KEV and no source reports exploitation

  5. Observed by OffSeq Mirage: no evidence on record.

    No attack traffic recorded by OffSeq Mirage sensors

A missing step is not evidence of safety. Sources: cve.org (opens in a new tab), the Metasploit, Exploit-DB and nuclei-templates index as of 29 Oct 2026.

What to do

Affected software

ProductAffectedFixed in
PHPOfficePhpSpreadsheetAffected
  • >=4.0.0 <=5.6.0
  • >=3.3.0 <=3.10.4
  • >=2.2.0 <=2.4.4
  • >=2.0.0 <=2.1.15
  • <=1.30.3
Fixed in–
Packagistphpoffice/phpspreadsheetpkg:composer/phpoffice/phpspreadsheetOther threatsAffected
  • <=1.30.3
Fixed in–

Check your own hosts for these packages with threat-finder (opens in a new tab), our free open-source scanner.

AI-suggested

Fixed versions are available starting at PhpSpreadsheet 5.7.0 and corresponding updates in earlier branches (3.10.5, 2.4.5, 2.1.16, 1.30.4). Users should upgrade to these versions to remediate the vulnerability. Patch status is not explicitly confirmed in the provided data; therefore, users should consult the official vendor advisory for the latest remediation guidance and confirm patch availability before deployment.

Description

PhpSpreadsheet is a pure PHP library for reading and writing spreadsheet files. The HTML writer skips htmlspecialchars escaping when a cell's formatted value differs from the original value. When a cell has a custom number format containing the text placeholder @ along with any additional literal characters (for example ". @", "@ ", or "x@"), the formatter replaces @ with the cell value and adds the extra characters, causing the formatted value to differ from the original and bypassing HTML escaping entirely. An attacker who can control the cell value and number format of an uploaded spreadsheet that is later converted to HTML and displayed to other users can achieve stored cross-site scripting. This issue is fixed in versions 5.7.0, 3.10.5, 2.4.5, 2.1.16, and 1.30.4.

References

Community reviews

Loading reviews…