GitHub Advisoryadvisory · Packagist

GHSA-7m8g-fprr-47fx phpMyFAQ vulnerable to stored XSS on attachments filename

MEDIUM Published 2024-02-05 Modified 2024-02-05 Official page ↗
Aliases
CVE-2024-24574
Ecosystem
Packagist
Packages
phpmyfaq/phpmyfaq
Severity
Moderate
CVSS vector
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:N/A:L
Weaknesses
CWE-79, CWE-80
Reviewed
2024-02-05

Affected packages

• Packagist phpmyfaq/phpmyfaq: < 3.2.5 → fixed in 3.2.5

Description

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 ``` id ?>" title="thema ?>"> id ?> filename ?> record_lang ?> filesize) ?> mime_type ?> ``` 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;` ``` filename); ?> record_lang); ?> filesize) ?> mime_type); ?> ``` 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 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 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

Related

Alias · CVE (1)

  • CVE-2024-24574 phpMyFAQ is an open source FAQ web application for PHP 8.1+ and MySQL, PostgreSQL and other databases. vulnerability

Weakness · CWE (2)

  • CWE-79 Improper Neutralization of Input During Web Page Generation weakness
  • CWE-80 Improper Neutralization of Script-Related HTML Tags in a Web Page weakness

References