CVE-2024-27300: Phpmyfaq/phpmyfaq Cross-Site Scripting Vulnerability

MODERATE
Advisory Identifier: GHSA-q7g6-xfh2-vhpx
CVSS 5.5
CWE-79
Published
Advisory Summary

CVE-2024-27300 is a MODERATE (CVSS 5.5) cross-site scripting vulnerability (CWE-79: Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting')) affecting Phpmyfaq/phpmyfaq libraries in the Packagist ecosystem. The issue involves phpmyfaq stored cross-site scripting at user email. Remediation is available by upgrading affected packages to version 3.2.6.

CVE-2024-27300 at a Glance

CVE Identifier CVE-2024-27300
GHSA Identifier GHSA-q7g6-xfh2-vhpx
Severity MODERATE
CVSS v3.1 Base Score 5.5
CWE Classification CWE-79: Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting')
Affected Product Phpmyfaq/phpmyfaq
Package Ecosystem Packagist
Published Date
Last Updated

Security Impact

CVSS: 5.5

The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:N/AC:L/PR:L/UI:R/S:U/C:L/I:L/A:L).

Attack Vector Network (AV:N)
Attack Complexity Low (AC:L)
Privileges Required Low (PR:L)
User Interaction Required (UI:R)
Scope Unchanged (S:U)
Confidentiality Low (C:L)
Integrity Low (I:L)
Availability Low (A:L)

How to Fix CVE-2024-27300

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.

phpmyfaq/phpmyfaq fixed: 3.2.6
Upgrade phpmyfaq/phpmyfaq to 3.2.6
Verify Direct and Transitive Dependencies

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-27300, 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.6), 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-79: Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting'), where the product does not neutralize or incorrectly neutralizes user-controllable input before it is placed in output that is used as a web page that is served to other users. 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

### Summary The `email` field in phpMyFAQ's user control panel page is vulnerable to stored XSS attacks due to the inadequacy of PHP's `FILTER_VALIDATE_EMAIL` function, which only validates the email format, not its content. This vulnerability enables an attacker to execute arbitrary client-side JavaScript within the context of another user's phpMyFAQ session. ### Details Despite using PHP's `FILTER_VALIDATE_EMAIL` function, the email field does not adequately validate the content of the email address. This means that malicious input, such as JavaScript code, can be accepted and stored in the database without being detected. When the stored data is retrieved and displayed on web pages, it is not properly sanitized to remove or neutralize any potentially harmful content, such as JavaScript code which leads to Stored XSS. ### PoC 1. Login as any user, go to the user control panel, change email to any valid email and intercept the request. 2. Modify the request’s email parameter to the following payload: `"><svg/onload=confirm('XSS')>"@x.y` ![image](https://github.com/thorsten/phpMyFAQ/assets/63487456/1c5a5431-773a-4e26-95ba-e2563f681ca1) 3. Send the request and see that the XSS is triggered in the user control panel page. ![image](https://github.com/thorsten/phpMyFAQ/assets/63487456/b0328fcc-3c03-4997-8121-1f5e7cf89178) 4. Also affects any user who browse to "../admin/?action=user&user_action=listallusers" ![image](https://github.com/thorsten/phpMyFAQ/assets/63487456/3af1add8-ea64-4350-a77e-d14da6084d4c) ### Impact This allows an attacker to execute arbitrary client side JavaScript within the context of another user's phpMyFAQ session.

CVE-2024-27300 Affected Phpmyfaq/phpmyfaq Versions

1 component(s)
Fixed Versions:
3.2.6
Product / Package Ecosystem Affected Versions Fixed Version
phpmyfaq/phpmyfaq
Packagist
≥ 3.2.5
< 3.2.6
All 1 versions
3.2.5
3.2.6

References

Frequently Asked Questions

What is CVE-2024-27300?
CVE-2024-27300 is a security vulnerability in Phpmyfaq/phpmyfaq involving phpMyFAQ stored Cross-site Scripting at user email under CWE-79: Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting').
Which Phpmyfaq/phpmyfaq versions are affected?
Affected versions include releases prior to 3.2.6 across affected packages: phpmyfaq/phpmyfaq.
What version fixes CVE-2024-27300?
Upgrading to 3.2.6 (or the latest patched release for your respective branch) resolves the vulnerability.
Is phpmyfaq/phpmyfaq affected?
Yes, phpmyfaq/phpmyfaq is affected in releases prior to 3.2.6. Upgrade your dependency to 3.2.6 or later.
What is the CVSS score of CVE-2024-27300?
CVE-2024-27300 has a CVSS v3.1 base score of 5.5 (MODERATE) with vector string CVSS:3.1/AV:N/AC:L/PR:L/UI:R/S:U/C:L/I:L/A:L.
What CWE is associated with CVE-2024-27300?
CVE-2024-27300 is classified under CWE-79: Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting') (The product does not neutralize or incorrectly neutralizes user-controllable input before it is placed in output that is used as a web page that is served to other users.).
How can I check Packagist dependencies for CVE-2024-27300?
Run the dependency tree command: 'inspect dependencies for phpmyfaq/phpmyfaq'. This command lists direct and transitive dependencies in your build configuration so you can verify if a vulnerable version is resolved.
Machine-readable OSV JSON OSV v1.5 Schema
Normalized schema output
{
  "schema_version" : "1.4.0",
  "id" : "GHSA-q7g6-xfh2-vhpx",
  "modified" : "2024-03-25T22:28:21Z",
  "published" : "2024-03-25T19:46:28Z",
  "aliases" : [ "CVE-2024-27300" ],
  "summary" : "phpMyFAQ stored Cross-site Scripting at user email",
  "details" : "### Summary\nThe `email` field in phpMyFAQ's user control panel page is vulnerable to stored XSS attacks due to the inadequacy of PHP's `FILTER_VALIDATE_EMAIL` function, which only validates the email format, not its content. This vulnerability enables an attacker to execute arbitrary client-side JavaScript within the context of another user's phpMyFAQ session.\n\n### Details\nDespite using PHP's `FILTER_VALIDATE_EMAIL` function, the email field does not adequately validate the content of the email address. This means that malicious input, such as JavaScript code, can be accepted and stored in the database without being detected. When the stored data is retrieved and displayed on web pages, it is not properly sanitized to remove or neutralize any potentially harmful content, such as JavaScript code which leads to Stored XSS.\n\n### PoC\n1.  Login as any user, go to the user control panel, change email to any valid email and intercept the request.\n\n2.  Modify the request’s email parameter to the following payload:  `\"><svg/onload=confirm('XSS')>\"@x.y`\n![image](https://github.com/thorsten/phpMyFAQ/assets/63487456/1c5a5431-773a-4e26-95ba-e2563f681ca1)\n\n\n3. Send the request and see that the XSS is triggered in the user control panel page.\n![image](https://github.com/thorsten/phpMyFAQ/assets/63487456/b0328fcc-3c03-4997-8121-1f5e7cf89178)\n\n\n4. Also affects any user who browse to \"../admin/?action=user&user_action=listallusers\"\n![image](https://github.com/thorsten/phpMyFAQ/assets/63487456/3af1add8-ea64-4350-a77e-d14da6084d4c)\n\n\n### Impact\nThis allows an attacker to execute arbitrary client side JavaScript within the context of another user's phpMyFAQ session.\n",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:N/AC:L/PR:L/UI:R/S:U/C:L/I:L/A:L"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "Packagist",
      "name" : "phpmyfaq/phpmyfaq"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "3.2.5"
      }, {
        "fixed" : "3.2.6"
      } ]
    } ],
    "versions" : [ "3.2.5" ]
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/thorsten/phpMyFAQ/security/advisories/GHSA-q7g6-xfh2-vhpx"
  }, {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2024-27300"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/thorsten/phpMyFAQ/commit/09336b0ff0e0a04aa0c97c5975651af4769d2459"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/thorsten/phpMyFAQ/commit/de90315c9bd4ead5fe6ba5586f6b016843aa8209"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/thorsten/phpMyFAQ"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-79" ],
    "severity" : "MODERATE",
    "github_reviewed" : true,
    "github_reviewed_at" : "2024-03-25T19:46:28Z",
    "nvd_published_at" : "2024-03-25T19:15:57Z"
  }
}