Hoch

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

  • Veröffentlicht: 06.05.2026
  • Aktualisiert: 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.

Betroffene Software

Klicken Sie auf eine Technologie, um alle zugehörigen Schwachstellen anzuzeigen.

PlattformPaketAnfällige VersionenBehoben in
Composer-Paket phpmyfaq/phpmyfaq >= 4.1.1, < 4.1.2 4.1.2
Composer-Paket thorsten/phpmyfaq >= 4.1.1, < 4.1.2 4.1.2

Verweise

CVSS-Wert 7.6/10
CVSS-Vektor
CVSS:3.1/AV:N/AC:L/PR:L/UI:R/S:C/C:H/I:L/A:N
Schwäche (CWE)
CWE-116, CWE-79
Plattform
Composer
Paket
phpmyfaq/phpmyfaq, thorsten/phpmyfaq
Veröffentlicht
06.05.2026
Aktualisiert
11.10.2026 10:22

Quellen und Lizenzen

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

Schwachstellenhistorie: thorsten/phpmyfaq

Alle veröffentlichten Schwachstellen dieses Pakets (Composer-Paket), neueste zuerst. Zeigt, ob es ein einmaliger Ausrutscher ist oder ein Paket, das man im Auge behalten muss.

Alle (112) im Archiv
Einträge insgesamt
112
Erste → letzte
05.2022 09.2026
Ohne Fix
2
In Angriffen ausgenutzt
0

Verteilung nach Schweregrad

  • Kritisch 8
  • Hoch 36
  • Mittel 67
  • Niedrig 1

Veröffentlichungen pro Jahr

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

Erkennen Sie Schwachstellen in Ihrer Anwendung

Mit der DockRay-Integration und aktivierter Softwareinventarisierung prüft DockRay gemeldete Komponentenversionen auf bekannte Schwachstellen und benachrichtigt Sie über bestätigte Treffer. Die Abdeckung hängt von der unterstützten Technologie und den verfügbaren Meldungen ab.

Anwendung verbinden
DockRay Newsletter

Anwendungssicherheit in Ihrem Postfach

Wichtige Schwachstellen, konkrete Empfehlungen und praktische Tipps für Ihre Anwendungen. Wählen Sie Ihre Technologien und verfolgen Sie, was für Ihr Projekt relevant ist.

  • Eine tägliche Zusammenfassung neuer Schwachstellen, auch kritischer.
  • Benachrichtigungen über wichtige Updates.
  • Praktische Tipps zur Sicherheit und Überwachung von Anwendungen.

Leer lassen, um Meldungen zu allen Technologien zu erhalten.

Kostenlos anmelden. In jeder E-Mail mit einem Klick abmelden.