6.5medium
phpMyFAQ vulnerable to stored XSS on attachments filename
- Severity
- 6.5medium CVSS:3.1 by GitHub_M
- Exploit likelihood
- 0.88% (higher than 60% of CVEs; EPSS, by FIRST)
- Published
- Last changed
- Assigned by
- GitHub_M
- Also known as
- GHSA-7m8g-fprr-47fx
Description
phpMyFAQ is an open source FAQ web application for PHP 8.1+ and MySQL, PostgreSQL and other databases. Unsafe echo of filename in phpMyFAQ\phpmyfaq\admin\attachments.php leads to allowed execution of JavaScript code in client side (XSS). This vulnerability has been patched in version 3.2.5.
Affected
| Product or package | Versions | Reported by |
|---|---|---|
| thorsten phpMyFAQ | < 3.2.5 | CVE List |
| phpmyfaq/phpmyfaq (Packagist) | before 3.2.5 | GitHub Advisory Database |
| phpmyfaq phpmyfaq | before 3.2.5 | NVD |
All scores
| GitHub_M | 6.5medium CVSS:3.1 | CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:N/A:L |
| GitHub | 6.5medium CVSS:3.1 | CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:N/A:L |
| NVD | 6.1medium CVSS:3.1 | CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N |
Classification
What each source says
CVE List
phpMyFAQ is an open source FAQ web application for PHP 8.1+ and MySQL, PostgreSQL and other databases. Unsafe echo of filename in phpMyFAQ\phpmyfaq\admin\attachments.php leads to allowed execution of JavaScript code in client side (XSS). This vulnerability has been patched in version 3.2.5.
GitHub Advisory Database
Summary
Unsafe echo of filename in phpMyFAQ\phpmyfaq\admin\attachments.php leading to allow execute JavaScript code in client side (XSS)
Details
On that snippet code of rendering the file attachments from user tables
<?php foreach ($crumbs as $item) : ?>
<tr id="attachment_<?= $item->id ?>" title="<?= $item->thema ?>">
<td><?= $item->id ?></td>
<td><?= $item->filename ?></td>
<td><?= $item->record_lang ?></td>
<td><?= Utils::formatBytes($item->filesize) ?></td>
<td><?= $item->mime_type ?></td>
<td>
The data directly rendering with short hand echo without any sanitation first, its recommend to use existing class of Strings::htmlentities on use phpMyFAQ\Strings;
<td><?= Strings::htmlentities($item->filename); ?></td>
<td><?= Strings::htmlentities($item->record_lang); ?></td>
<td><?= Utils::formatBytes($item->filesize) ?></td>
<td><?= Strings::htmlentities($item->mime_type); ?></td>
Propose fixing on that pull request https://github.com/thorsten/phpMyFAQ/pull/2827
PoC
- An attacker with permission will upload the attachments image on http://{base_url}/admin/?action=editentry
- On endpoint of ajax upload image POST /admin/index.php?action=ajax&ajax=att&ajaxaction=upload
- Change the originally name file on parameters filename to a XSS payload
- The XSS will trigger on attachment pages /admin/?action=attachments
Impact
This vulnerability will allow an attacker with a permissions of uploading an attachment to storing the payload of XSS on database specific table faqattachment columns filename.
The XSS payload could be rendering on page that listing the file on tables, and impact to others user that on the hierarchy.
The payload XSS have several attack scenario such like
- Stealing the cookies (isn’t possible since HttpOnly)
- Crashing the application with a looping javascript payload
NVD (es)
phpMyFAQ es una aplicación web de preguntas frecuentes de código abierto para PHP 8.1+ y MySQL, PostgreSQL y otras bases de datos. El eco inseguro del nombre de archivo en phpMyFAQ\phpmyfaq\admin\attachments.php conduce a la ejecución permitida de código JavaScript en el lado del cliente (XSS). Esta vulnerabilidad ha sido parcheada en la versión 3.2.5.
References
Sources
| Source | Record | Licence |
|---|---|---|
| CVE List | CVE-2024-24574 changed 2025-06-17 | CVE Terms of Use |
| GitHub Advisory Database | GHSA-7m8g-fprr-47fx changed 2026-09-10 | CC-BY-4.0 |
| NVD | CVE-2024-24574 changed 2026-06-17 | Public domain |