Skip to content
Fencer Intel
low —

GHSA-44jg-mv3h-wj6g json

solspace/craft-freeform Vulnerable to XSS in `PhpSpreadsheet` HTML Writer Due to Unsanitized Styling Data

published 9mo ago modified 9mo ago

cvss
—
not scored
cisa kev
Not listed
not in CISA's catalog
epss
—
no score, EPSS covers CVEs only
public exploits
0
none known

Summary

### Summary _Short summary of the problem. Make the impact and severity as clear as possible. For example: An unsafe deserialization vulnerability allows any unauthenticated user to execute arbitrary code on the server._

\PhpOffice\PhpSpreadsheet\Writer\Html doesn't sanitize spreadsheet styling information such as font names, allowing an attacker to inject arbitrary JavaScript on the page.

### Details _Give all details on the vulnerability. Pointing to the incriminated source code is very helpful for the maintainer._

See https://github.com/advisories/GHSA-wgmf-q9vr-vww6

### PoC _Complete instructions, including specific configuration details, to reproduce the vulnerability._

Example target script:

``` <?php

require 'vendor/autoload.php';

$reader = \PhpOffice\PhpSpreadsheet\IOFactory::createReader("Xlsx"); $spreadsheet = $reader->load(__DIR__ . '/book.xlsx');

$writer = new \PhpOffice\PhpSpreadsheet\Writer\Html($spreadsheet); print($writer->generateHTMLAll()); ```

Save this file in the same directory:

[book.xlsx](https://github.com/PHPOffice/PhpSpreadsheet/files/15212797/book.xlsx)

Open index.php in a web browser. An alert should be displayed.

### Impact _What kind of vulnerability is it? Who is impacted?_

Full takeover of the session of users viewing spreadsheet files as HTML.

Patch / fix

  • packagist solspace/craft-freeform 4.1.23

Is GHSA-44jg-mv3h-wj6g in your dependencies? Fencer shows which of your repositories are affected as soon as an advisory lands, and opens the fix as a pull request.

Check with Fencer

Affected packages

ecosystem package affected fixed in
packagist solspace/craft-freeform
<4.1.23
4.1.23

Classification

Weakness
  • CWE-79 Improper Neutralization of Input During Web Page Generation

References

Sources

Fencer Intel keeps one entry per vulnerability: the CVE id wins, then GHSA, and records that alias each other are merged, except that two CVEs always keep separate entries. The same data is available as JSON.