CVE-2024-24574: Phpmyfaq/phpmyfaq Cross-Site Scripting Vulnerability
MODERATECVE-2024-24574 is a MODERATE (CVSS 6.5) cross-site scripting vulnerability (CWE-80: Improper Neutralization of Script-Related HTML Tags in a Web Page (Basic XSS)) affecting Phpmyfaq/phpmyfaq libraries in the Packagist ecosystem. The issue involves phpmyfaq vulnerable to stored xss on attachments filename. Remediation is available by upgrading affected packages to version 3.2.5.
CVE-2024-24574 at a Glance
Security Impact
CVSS: 6.5
The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:N/A:L).
How to Fix CVE-2024-24574
To remediate this vulnerability, upgrade all affected Phpmyfaq/phpmyfaq dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.
Upgrade phpmyfaq/phpmyfaq to 3.2.5
Run the following command in your project directory to verify that all resolved dependencies use the patched release:
inspect dependencies for phpmyfaq/phpmyfaq
How to Check if You Are Affected
To determine whether your application is affected by CVE-2024-24574, inspect your project dependencies for Phpmyfaq/phpmyfaq:
inspect dependencies for phpmyfaq/phpmyfaq
Analyze the terminal output to locate any version of Phpmyfaq/phpmyfaq in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 3.2.5), your application is affected.
Note: Verify declared build manifests and deployed runtime container environments.
Technical Details
Vulnerability Mechanism & Technical Analysis
This vulnerability is classified under CWE-80: Improper Neutralization of Script-Related HTML Tags in a Web Page (Basic XSS), where the product receives input from an upstream component, but it does not neutralize or incorrectly neutralizes special characters such as "<", ">", and "&" that could be interpreted as web-scripting elements when they are sent to a downstream component that processes web pages. In Phpmyfaq/phpmyfaq, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.
Source Advisory Statement
CVE-2024-24574 Affected Phpmyfaq/phpmyfaq Versions
1 component(s)| Product / Package | Ecosystem | Affected Versions | Fixed Version |
|---|---|---|---|
|
phpmyfaq/phpmyfaq
|
Packagist |
< 3.2.5
|
3.2.5
|
References
Frequently Asked Questions
What is CVE-2024-24574?
Which Phpmyfaq/phpmyfaq versions are affected?
What version fixes CVE-2024-24574?
Is phpmyfaq/phpmyfaq affected?
What is the CVSS score of CVE-2024-24574?
What CWE is associated with CVE-2024-24574?
How can I check Packagist dependencies for CVE-2024-24574?
Machine-readable OSV JSON
OSV v1.5 Schema
{
"schema_version" : "1.4.0",
"id" : "GHSA-7m8g-fprr-47fx",
"modified" : "2024-02-05T23:08:13Z",
"published" : "2024-02-05T20:22:05Z",
"aliases" : [ "CVE-2024-24574" ],
"summary" : "phpMyFAQ vulnerable to stored XSS on attachments filename",
"details" : "### Summary\nUnsafe echo of filename in phpMyFAQ\\phpmyfaq\\admin\\attachments.php leading to allow execute JavaScript code in client side (XSS)\n\n### Details\nOn that snippet code of rendering the file attachments from user tables\n\n```\n<?php foreach ($crumbs as $item) : ?>\n <tr id=\"attachment_<?= $item->id ?>\" title=\"<?= $item->thema ?>\">\n <td><?= $item->id ?></td>\n <td><?= $item->filename ?></td>\n <td><?= $item->record_lang ?></td>\n <td><?= Utils::formatBytes($item->filesize) ?></td>\n <td><?= $item->mime_type ?></td>\n <td>\n```\n\nThe data directly rendering with short hand echo without any sanitation first, its recommend to use existing class of `Strings::htmlentities` on use `phpMyFAQ\\Strings;`\n\n```\n<td><?= Strings::htmlentities($item->filename); ?></td>\n<td><?= Strings::htmlentities($item->record_lang); ?></td>\n<td><?= Utils::formatBytes($item->filesize) ?></td>\n<td><?= Strings::htmlentities($item->mime_type); ?></td>\n```\n\nPropose fixing on that pull request https://github.com/thorsten/phpMyFAQ/pull/2827\n\n### PoC\n1. An attacker with permission will upload the attachments image on [http://{base_url}/admin/?action=editentry](http://{base_url}/admin/?action=editentry)\n2. On endpoint of ajax upload image POST /admin/index.php?action=ajax&ajax=att&ajaxaction=upload \n3. Change the originally name file on parameters filename to a XSS payload \n4. The XSS will trigger on attachment pages /admin/?action=attachments\n\n- Trigger XSS\n\n\n- Payload XSS\n<img width=\"1000\" alt=\"image\" src=\"https://user-images.githubusercontent.com/37658579/301022571-d6cdd166-b1f9-4062-87c5-c8bbb308cd5d.png\">\n\n\n\n\n### Impact\n\nThis 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.`\n\nThe XSS payload could be rendering on page that listing the file on tables, and impact to others user that on the hierarchy. \n\nThe payload XSS have several attack scenario such like \n\n1. Stealing the cookies (isn’t possible since HttpOnly)\n2. Crashing the application with a looping javascript payload\n",
"severity" : [ {
"type" : "CVSS_V3",
"score" : "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:N/A:L"
} ],
"affected" : [ {
"package" : {
"ecosystem" : "Packagist",
"name" : "phpmyfaq/phpmyfaq"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "0"
}, {
"fixed" : "3.2.5"
} ]
} ]
} ],
"references" : [ {
"type" : "WEB",
"url" : "https://github.com/thorsten/phpMyFAQ/security/advisories/GHSA-7m8g-fprr-47fx"
}, {
"type" : "ADVISORY",
"url" : "https://nvd.nist.gov/vuln/detail/CVE-2024-24574"
}, {
"type" : "WEB",
"url" : "https://github.com/thorsten/phpMyFAQ/pull/2827"
}, {
"type" : "WEB",
"url" : "https://github.com/thorsten/phpMyFAQ/commit/5479b4a4603cce71aa7eb4437f1c201153a1f1f5"
}, {
"type" : "PACKAGE",
"url" : "https://github.com/thorsten/phpMyFAQ"
}, {
"type" : "WEB",
"url" : "https://www.phpmyfaq.de/security/advisory-2024-02-05"
} ],
"database_specific" : {
"cwe_ids" : [ "CWE-79", "CWE-80" ],
"severity" : "MODERATE",
"github_reviewed" : true,
"github_reviewed_at" : "2024-02-05T20:22:05Z",
"nvd_published_at" : "2024-02-05T21:15:12Z"
}
}