CVE-2024-24574
mediumpriority · track · 24EPSS 0.009 · 59 %ileEUUSEPSS · scored 2026-10-27
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.
cvss
Technical severity, 0–10. One row per scoring source.
base score 0–10 · higher = more severe · hover a vector to decode
ssvc
A stakeholder decision — act, attend, or track — from exploitation and impact.
weaknesses
The CWE weakness classes this flaw belongs to.
affected products (4)
Products and version ranges known to be affected.
advisories (1)
Vendor and ecosystem advisories describing this.
- GHSA-7m8g-fprr-47fxphpMyFAQ vulnerable to stored XSS on attachments filename2024-02-05ghsa · osvUS
### 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 1. An attacker with permission will upload the attachments image on [http://{base_url}/admin/?action=editentry](http://{base_url}/admin/?action=editentry) 2. On endpoint of ajax upload image POST /admin/index.php?action=ajax&ajax=att&ajaxaction=upload 3. Change the originally name file on parameters filename to a XSS payload 4. 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 1. Stealing the cookies (isn’t possible since HttpOnly) 2. Crashing the application with a looping javascript payload
also known as (3)
Other names and identifiers for this entity.
sources
Which sources assert this record, and when.
references (10)
External citations — patches, advisories, analysis.
- https://cxsecurity.com/cveshow/CVE-2024-24574/cnnvd
- https://github.com/thorsten/phpMyFAQ/commit/5479b4a4603cce71aa7eb4437f1c201153a1f1f5cnnvd
- https://github.com/thorsten/phpMyFAQ/pull/2827cnnvd
- https://github.com/thorsten/phpMyFAQ/security/advisories/GHSA-7m8g-fprr-47fxcnnvd
- https://github.com/thorsten/phpMyFAQ/commit/5479b4a4603cce71aa7eb4437f1c201153a1f1f5enisa_euvd
- https://github.com/thorsten/phpMyFAQ/pull/2827enisa_euvd
- https://github.com/thorsten/phpMyFAQ/security/advisories/GHSA-7m8g-fprr-47fxenisa_euvd
- https://github.com/thorsten/phpMyFAQ/commit/5479b4a4603cce71aa7eb4437f1c201153a1f1f5Patchnvd
Attackers weaponise vulnerabilities like this against internet-exposed services. See what is exposed on your perimeter with a free passive scan.
Free scan