phpMyFAQ vulnerable to stored XSS on attachments filename
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
-
Trigger XSS

-
Payload XSS <img width="1000" alt="image" src="https://user-images.githubusercontent.com/37658579/301022571-d6cdd166-b1f9-4062-87c5-c8bbb308cd5d.png">
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
Czego dotyczy
Kliknij technologię, aby zobaczyć wszystkie dotyczące jej podatności.
| Platforma | Paczka | Podatne wersje | Poprawka w wersji |
|---|---|---|---|
| Paczka Composer | phpmyfaq/phpmyfaq | < 3.2.5 | 3.2.5 |
Odnośniki
- https://github.com/thorsten/phpMyFAQ/security/advisories/GHSA-7m8g-fprr-47fx
- https://nvd.nist.gov/vuln/detail/CVE-2024-24574
- https://github.com/thorsten/phpMyFAQ/pull/2827
- https://github.com/thorsten/phpMyFAQ/commit/5479b4a4603cce71aa7eb4437f1c201153a1f1f5
- https://github.com/thorsten/phpMyFAQ
- https://www.phpmyfaq.de/security/advisory-2024-02-05
- Wektor CVSS
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:N/A:L- Słabość (CWE)
CWE-79, CWE-80- Platforma
- Composer
- Paczka
phpmyfaq/phpmyfaq- Ujawniono
- 05.02.2024
- Aktualizacja
- 11.10.2026 10:22
Źródła i licencje
OSV / GitHub Advisory Database - GHSA-7m8g-fprr-47fx - CC BY 4.0
Historia podatności: phpmyfaq/phpmyfaq
Wszystkie opisane podatności tej paczki (Paczka Composer), od najnowszej. Widać, czy to jednorazowa wpadka, czy paczka, której trzeba pilnować.
- Wszystkich wpisów
- 47
- Pierwsza → ostatnia
- 10.2022 09.2026
- Bez poprawki
- 2
- Wykorzystywana w atakach
- 0
Rozkład istotności
- Krytyczna 2
- Wysoka 18
- Średnia 25
- Niska 2
Ujawnienia w latach
- 2022: 1
- 2023: 0
- 2024: 11
- 2025: 3
- 2026: 32
-
phpMyFAQ vulnerable to stored XSS on attachments filename ten wpis
Dowiedz się, które podatności dotyczą Twojej aplikacji
Po podłączeniu integracji DockRay i włączeniu raportowania oprogramowania DockRay porównuje zgłoszone wersje komponentów ze znanymi podatnościami i powiadamia o potwierdzonych dopasowaniach. Zakres zależy od obsługiwanej technologii i dostępnych biuletynów.