CVE-2026-46367: phpMyFAQ has stored XSS via Utils :parseUrl() Vulnerability

HIGH
Advisory Identifier: GHSA-9525-27vj-c8r8
CVSS 7.6
CWE-116 CWE-79
Published
Advisory Summary

CVE-2026-46367 is a HIGH (CVSS 7.6) :parseurl() vulnerability (CWE-116: Improper Encoding or Escaping of Output) affecting phpMyFAQ has stored XSS via Utils libraries in the Packagist ecosystem. The issue involves :parseurl() in comment rendering. Remediation is available by upgrading affected packages to version 4.1.2.

CVE-2026-46367 at a Glance

CVE Identifier CVE-2026-46367
GHSA Identifier GHSA-9525-27vj-c8r8
Severity HIGH
CVSS v3.1 Base Score 7.6
CWE Classification CWE-116: Improper Encoding or Escaping of Output
Affected Product phpMyFAQ has stored XSS via Utils
Package Ecosystem Packagist
Published Date
Last Updated

Security Impact

CVSS: 7.6

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:C/C:H/I:L/A:N).

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

How to Fix CVE-2026-46367

To remediate this vulnerability, upgrade all affected phpMyFAQ has stored XSS via Utils dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.

thorsten/phpmyfaq fixed: 4.1.2
Upgrade thorsten/phpmyfaq to 4.1.2
phpmyfaq/phpmyfaq fixed: 4.1.2
Upgrade phpmyfaq/phpmyfaq to 4.1.2
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 thorsten/phpmyfaq

How to Check if You Are Affected

To determine whether your application is affected by CVE-2026-46367, inspect your project dependencies for phpMyFAQ has stored XSS via Utils:

inspect dependencies for thorsten/phpmyfaq

Analyze the terminal output to locate any version of phpMyFAQ has stored XSS via Utils in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 4.1.2), 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-116: Improper Encoding or Escaping of Output, where the product prepares a structured message for communication with another component, but encoding or escaping of the data is either missing or done incorrectly. as a result, the intended structure of the message is not preserved. In phpMyFAQ has stored XSS via Utils, 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 A stored XSS vulnerability in the comment rendering pipeline allows an authenticated user to inject JavaScript that executes for every visitor of an affected FAQ or News page. An attacker with a registered account can steal admin session cookies and take over the application. ### Details `Utils::parseUrl()` (`phpmyfaq/src/phpMyFAQ/Utils.php`, line 281) converts URLs in comment text into clickable `<a>` tags at render time: $pattern = '/(https?:\/\/[^\s]+)/i'; $replacement = '<a href="$1">$1</a>'; return preg_replace($pattern, $replacement, $string); The regex `[^\s]+` matches `"` and `<`, and the URL is inserted into the href attribute with no htmlspecialchars() call. A URL with a literal `"` closes the attribute early and allows injecting event handlers like onmouseover. This only reaches the sink when `main.enableCommentEditor` is enabled. In that path, comment text goes through `sanitizeHtmlComment()` instead of `FILTER_SANITIZE_SPECIAL_CHARS` — which encodes `"` — so the double-quote survives to storage. The comment is then passed through parseUrl() and rendered via `{{ comment.comment|raw }}` in `comment.macros.twig` (line 40), which disables Twig auto-escaping. The same sink exists in the admin comment panel (`admin/content/comments.twig`, lines 62 and 112), so admins viewing the panel are also affected. No Content-Security-Policy headers are set anywhere in the app. ### PoC Requirements: - main.enableCommentEditor = true (set in admin Configuration panel) - attacker has any registered user account - one FAQ entry with comments allowed exists Steps: 1. Log in as a registered user and open a FAQ with comments. 2. Submit the following as the comment text: https://www.evil.com/"onmouseover="alert(document.cookie) (www. prefix required — parseUrl strips https:// then only re-adds it for www. URLs, which is what triggers the linkification) 3. Any user who views that FAQ page and hovers the link triggers the payload. To hit an admin, wait for them to visit the page or check the admin comments panel at /admin/content/comments. Resulting HTML in the page: <a href="https://www.evil.com/"onmouseover="alert(document.cookie)"> ... </a> The `"` closes the href attribute; onmouseover becomes a real attribute. ### Impact Stored XSS affecting all visitors of the page, including admins. Session cookie theft leads to full admin account takeover. The payload looks like a normal URL and persists until manually deleted.

CVE-2026-46367 Affected phpMyFAQ has stored XSS via Utils Versions

2 component(s)
Fixed Versions:
4.1.2
Product / Package Ecosystem Affected Versions Fixed Version
thorsten/phpmyfaq
Packagist
≥ 4.1.1
< 4.1.2
All 1 versions
4.1.1
4.1.2
phpmyfaq/phpmyfaq
Packagist
≥ 4.1.1
< 4.1.2
All 1 versions
4.1.1
4.1.2

References

Frequently Asked Questions

What is CVE-2026-46367?
CVE-2026-46367 is a security vulnerability in phpMyFAQ has stored XSS via Utils involving :parseUrl() in comment rendering under CWE-116: Improper Encoding or Escaping of Output.
Which phpMyFAQ has stored XSS via Utils versions are affected?
Affected versions include releases prior to 4.1.2 across affected packages: thorsten/phpmyfaq, phpmyfaq/phpmyfaq.
What version fixes CVE-2026-46367?
Upgrading to 4.1.2 (or the latest patched release for your respective branch) resolves the vulnerability.
Is thorsten/phpmyfaq affected?
Yes, thorsten/phpmyfaq is affected in releases prior to 4.1.2. Upgrade your dependency to 4.1.2 or later.
Is phpmyfaq/phpmyfaq affected?
Yes, phpmyfaq/phpmyfaq is affected in releases prior to 4.1.2. Upgrade your dependency to 4.1.2 or later.
What is the CVSS score of CVE-2026-46367?
CVE-2026-46367 has a CVSS v3.1 base score of 7.6 (HIGH) with vector string CVSS:3.1/AV:N/AC:L/PR:L/UI:R/S:C/C:H/I:L/A:N.
What CWE is associated with CVE-2026-46367?
CVE-2026-46367 is classified under CWE-116: Improper Encoding or Escaping of Output (The product prepares a structured message for communication with another component, but encoding or escaping of the data is either missing or done incorrectly. As a result, the intended structure of the message is not preserved.).
How can I check Packagist dependencies for CVE-2026-46367?
Run the dependency tree command: 'inspect dependencies for thorsten/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-9525-27vj-c8r8",
  "modified" : "2026-06-08T23:58:14Z",
  "published" : "2026-05-06T20:10:48Z",
  "aliases" : [ "CVE-2026-46367" ],
  "summary" : "phpMyFAQ has stored XSS via Utils::parseUrl() in comment rendering",
  "details" : "### Summary\n\nA stored XSS vulnerability in the comment rendering pipeline allows an authenticated user to inject JavaScript that executes for every visitor of an affected FAQ or News page. An attacker with a registered account can steal admin session cookies and take over the application.\n\n### Details\n\n`Utils::parseUrl()` (`phpmyfaq/src/phpMyFAQ/Utils.php`, line 281) converts URLs in comment text into clickable `<a>` tags at render time:\n\n    $pattern = '/(https?:\\/\\/[^\\s]+)/i';\n    $replacement = '<a href=\"$1\">$1</a>';\n    return preg_replace($pattern, $replacement, $string);\n\nThe regex `[^\\s]+` matches `\"` and `<`, and the URL is inserted into the href attribute with no htmlspecialchars() call. A URL with a literal `\"` closes the attribute early and allows injecting event handlers like onmouseover.\n\nThis only reaches the sink when `main.enableCommentEditor` is enabled. In that path, comment text goes through `sanitizeHtmlComment()` instead of `FILTER_SANITIZE_SPECIAL_CHARS` — which encodes `\"` — so the double-quote survives to storage. The comment is then passed through parseUrl() and rendered via `{{ comment.comment|raw }}` in `comment.macros.twig` (line 40), which disables Twig auto-escaping.\n\nThe same sink exists in the admin comment panel (`admin/content/comments.twig`, lines 62 and 112), so admins viewing the panel are also affected.\n\nNo Content-Security-Policy headers are set anywhere in the app.\n\n### PoC\n\nRequirements:\n- main.enableCommentEditor = true (set in admin Configuration panel)\n- attacker has any registered user account\n- one FAQ entry with comments allowed exists\n\nSteps:\n1. Log in as a registered user and open a FAQ with comments.\n2. Submit the following as the comment text:\n\n       https://www.evil.com/\"onmouseover=\"alert(document.cookie)\n\n   (www. prefix required — parseUrl strips https:// then only re-adds\n   it for www. URLs, which is what triggers the linkification)\n\n3. Any user who views that FAQ page and hovers the link triggers the\n   payload. To hit an admin, wait for them to visit the page or check\n   the admin comments panel at /admin/content/comments.\n\nResulting HTML in the page:\n\n    <a href=\"https://www.evil.com/\"onmouseover=\"alert(document.cookie)\">\n      ...\n    </a>\n\nThe `\"` closes the href attribute; onmouseover becomes a real attribute.\n\n### Impact\n\nStored XSS affecting all visitors of the page, including admins. Session cookie theft leads to full admin account takeover. The payload looks like a normal URL and persists until manually deleted.",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:N/AC:L/PR:L/UI:R/S:C/C:H/I:L/A:N"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "Packagist",
      "name" : "thorsten/phpmyfaq"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "4.1.1"
      }, {
        "fixed" : "4.1.2"
      } ]
    } ],
    "versions" : [ "4.1.1" ]
  }, {
    "package" : {
      "ecosystem" : "Packagist",
      "name" : "phpmyfaq/phpmyfaq"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "4.1.1"
      }, {
        "fixed" : "4.1.2"
      } ]
    } ],
    "versions" : [ "4.1.1" ]
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/thorsten/phpMyFAQ/security/advisories/GHSA-9525-27vj-c8r8"
  }, {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2026-46367"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/thorsten/phpMyFAQ"
  }, {
    "type" : "WEB",
    "url" : "https://www.vulncheck.com/advisories/phpmyfaq-stored-xss-via-utils-parseurl-in-comment-rendering"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-116", "CWE-79" ],
    "severity" : "HIGH",
    "github_reviewed" : true,
    "github_reviewed_at" : "2026-05-06T20:10:48Z",
    "nvd_published_at" : null
  }
}