An attacker with admin privileges can upload an attachment containing JS code without extension and the application will render it as HTML which allows for XSS attacks.
When attachments are uploaded without an extension, the application renders it as HTML by default. Therefore allowing attackers to upload .html files containing javascript code to perform XSS attacks. The direct file path to the uploaded attachment is also easily obtainable as it is made up of substrings of the file's MD5 hashes.
Admin users can upload attachments containing XSS payloads in files without extensions to bypass the .html extension check.
Since the path of the uploaded file is built entirely on the file’s MD5 hash and the attachment directory, it is possible for an attacker to know the direct path of the uploaded file.
E.g file MD5 hash: 38fff51cb7248a06d6142c6bdf846831
URL will be: http://127.0.0.1/phpmyfaq/attachments/38fff/51cb7/248a0/6d6142c6bdf846831
Even though the attachment was uploaded without a file extension, it is still rendered as .html, hence triggering the XSS payload.
This allows an attacker to execute arbitrary client side JavaScript within the context of another user's phpMyFAQ session.
{ "nvd_published_at": "2024-03-25T21:15:47Z", "cwe_ids": [ "CWE-79" ], "severity": "MODERATE", "github_reviewed": true, "github_reviewed_at": "2024-03-25T19:45:12Z" }