CVE-2024–55889 — phpMyFAQ Triggering Unintended File Downloads
Unintended File Download Triggered by Embedded Frames
Summary
A vulnerability exists in the FAQ Record component of https://github.com/thorsten/phpMyFAQ v3.2.10 where a privileged attacker can trigger a file download on a victim’s machine upon page visit by embedding it in an <iframe> element without user interaction or explicit consent.
Details
In http://localhost/admin/index.php?action=editentry&id=20&lang=en, where a FAQ record is either created or edited, an attacker can insert an iframe, as “source code”, pointing to a prior “malicious” attachment that the attacker has uploaded via FAQ “new attachment” upload, such that any page visits to this FAQ will trigger an automated download (from the edit screen, download is automated; from the faq page view as a normal user, depending on the browser, a pop up confirmation may be presented before the actual download. Firebox browser, for instance, does not require any interactions).
PoC
- create a new FAQ record and upload a “malicious” file — in my case, I uploaded an eicar file. Take note of the uri, ie “index.php?action=attachment&id=2”
- in the FAQ record, insert a “source code” blob using the “< >” button
- insert in the following snippet and save FAQ record:
<p><iframe src="index.php?action=attachment&id=2"></iframe></p>
Once the edit page reloads, the malicious code will be downloaded onto the local machine without user interaction:
Weakness
CWE-451
CVSS v3
4.9
Impact
Malicious code or binaries could be dropped on visitors’ machines when visiting the FAQ platform. Take a worm or ransomware for instance.
Reference
https://github.com/thorsten/phpMyFAQ/security/advisories/GHSA-m3r7-8gw7-qwvc