High

phpMyFAQ has stored XSS via Utils::parseUrl() in comment rendering

  • Disclosed: 06.05.2026
  • Updated: 11.10.2026 10:22

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.

Affected software

Click a technology to see all vulnerabilities affecting it.

PlatformPackageVulnerable versionsFixed in
Composer package phpmyfaq/phpmyfaq >= 4.1.1, < 4.1.2 4.1.2
Composer package thorsten/phpmyfaq >= 4.1.1, < 4.1.2 4.1.2

References

CVSS score 7.6/10
CVSS vector
CVSS:3.1/AV:N/AC:L/PR:L/UI:R/S:C/C:H/I:L/A:N
Weakness (CWE)
CWE-116, CWE-79
Platform
Composer
Package
phpmyfaq/phpmyfaq, thorsten/phpmyfaq
Disclosed
06.05.2026
Updated
11.10.2026 10:22

Sources and licenses

OSV / GitHub Advisory Database - GHSA-9525-27vj-c8r8 - CC BY 4.0

Vulnerability history: thorsten/phpmyfaq

All published vulnerabilities of this package (Composer package), newest first. Shows whether this is a one-off slip or a package that needs watching.

All (112) in the archive
Total entries
112
First → latest
05.2022 09.2026
Without a fix
2
Exploited in attacks
0

Severity breakdown

  • Critical 8
  • High 36
  • Medium 67
  • Low 1

Disclosures per year

  1. 2022: 8
  2. 2023: 62
  3. 2024: 2
  4. 2025: 6
  5. 2026: 34
Severity:
  1. High · 8.1 CVE-2026-56737 >= 3.2.0, < 4.1.6 4.1.6
  2. High · 7.5 CVE-2026-35672 < 4.1.3 4.1.3
  3. High · 8.8 CVE-2026-35671 < 4.1.3 4.1.3
  4. phpMyFAQ has stored XSS via Utils::parseUrl() in comment rendering this entry
    High · 7.6 CVE-2026-46367 >= 4.1.1, < 4.1.2 4.1.2
  5. High · 7.5 CVE-2025-69200 < 4.0.16, >= 4.1.0-alpha, <= 4.1.0-beta.2 4.0.16
  6. High · 8.1 CVE-2025-59943 >= 4.0.7, < 4.0.13 4.0.13
  7. High · 7.6 CVE-2023-5865 < 3.2.2 3.2.2
  8. High · 7.4 CVE-2023-5864 < 3.2.1 3.2.1
  9. High · 8.3 CVE-2023-5319 < 3.1.18 3.1.18
  10. Critical · 9.0 CVE-2023-5320 < 3.1.18 3.1.18
  11. Critical · 9.1 CVE-2023-5316 < 3.1.18 3.1.18
  12. High · 8.8 CVE-2023-4007 < 3.1.16 3.1.16
  13. High · 8.2 CVE-2023-2550 < 3.1.13 3.1.13
  14. High · 8.3 CVE-2023-1887 < 3.1.12 3.1.12
  15. High · 7.3 CVE-2023-1886 < 3.1.12 3.1.12
  16. Critical · 9.8 CVE-2023-0788 < 3.1.11 3.1.11
  17. Critical · 9.8 CVE-2023-0789 < 3.1.11 3.1.11
  18. High · 8.8 CVE-2023-0790 < 3.1.11 3.1.11
  19. High · 8.8 CVE-2023-0793 < 3.1.11 3.1.11
  20. Critical · 9.8 CVE-2023-0311 < 3.1.10 3.1.10
Show more (4) Showing 40 of 44

Know which vulnerabilities affect your application

With the DockRay integration and software inventory enabled, DockRay checks reported component versions against known vulnerabilities and notifies you about confirmed matches. Coverage depends on the supported technology and available advisory data.

Connect your application
DockRay newsletter

Application security in your inbox

Important vulnerabilities, actionable guidance and practical advice for your applications. Choose your technologies and follow what matters to your project.

  • A daily digest of new vulnerabilities, critical ones included.
  • Notifications about important updates.
  • Practical advice on application security and monitoring.

Leave empty to receive updates for every technology.

Free to subscribe. Unsubscribe with one click in any email.