thorsten/phpmyfaq Unintended File Download Triggered by Embedded Frames
Date: 2024-12
Affected: composer/thorsten/phpmyfaq
Attack vector: other
Category: vulnerability-disclosure
Severity: Medium
CVE: CVE-2024-55889
CWE: CWE-451
CVSS: 4.9 (CVSS:3.1/AV:N/AC:L/PR:H/UI:N/S:U/C:N/I:H/A:N)

### Summary A vulnerability exists in the FAQ Record component 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). ![image](https://github.com/user-attachments/assets/74fee719-1eea-4bcb-9c7d-da0c5045c74b) ### PoC 1. create a new FAQ record and upload a "malicious" file - in my case, I uploaded an eicar file. take note of the uri, ie <p><iframe "index.php?action=attachment&amp;id=2" ![image](https://github.com/user-attachments/assets/06072ef6-9311-423a-a735-1d6a3274cde8) 3. in the FAQ record, insert a "source code" blob using the "< >" button 4. insert in the following snippet: <p><iframe src="index.php?action=attachment&amp;id=2"></iframe></p> and save FAQ record 5. once the edit page reloads, the malicious code will be downloaded onto the local machi


Mitigations:

Architectural layers (MAESTRO):