Security Advisories

phpMyFAQ vulnerable to stored XSS on attachments filename

CVECVE-2024-24574 SeverityMEDIUM ProductphpMyFAQ VendorphpMyFAQ Published2024-02-06
CVSSCVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:N/A:L

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;

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.

References

Zoomed image