/

CVE-2026-46367

Severity:

HIGH RISK

(7.6)

Stored Cross-Site Scripting (XSS) in phpMyFAQ URL Parsing

CVE-2026-46367

Deferred

Vulnerability type

Category:

Stored Cross-Site Scripting (XSS)

CWE:

CWE-79

Impact:

Session Hijacking and Application Compromise via Stored XSS

Severity:

HIGH RISK

(7.6)

CVSS version:

3.1

Catch this CVE while code is being written

Detect vulnerable code directly in pull requests, so CVEs are fixed before merge.

Summary

phpMyFAQ before version 4.1.2 contains a stored cross-site scripting (XSS) flaw in Utils::parseUrl() that allows authenticated users to inject JavaScript via malformed URLs in comments.

When other users or administrators view affected FAQ pages, the injected script can execute in their browser, enabling session theft and potential full application takeover.

Affected context

The vulnerability appears in phpMyFAQ deployments that:

  • Allow authenticated users to submit comments containing URLs
  • Rely on Utils::parseUrl() to process and render those URLs in FAQ pages
  • Do not consistently escape or sanitize special characters (such as quotes) in generated HTML

The risk is highest where administrators or privileged users frequently view public or user-generated FAQ comments from untrusted contributors.

Exploit preconditions

  • Attack surface: Web-based comment submission features within phpMyFAQ.
  • Required access: Authenticated user account with permission to post or edit comments.
  • Trigger point: Rendering of a maliciously crafted URL inside a comment on an FAQ page, typically when a victim visits or moderates the page.
  • Why exploitation is possible: The URL parser and subsequent HTML output do not properly escape quotes or event handler attributes, allowing attacker-controlled input to break out of the intended context and inject executable JavaScript that is stored and replayed to other users.

Why this happens

This issue stems from insufficient output encoding when user-controlled URLs are embedded into HTML generated by Utils::parseUrl().

The function permits unescaped quotes or attribute delimiters to propagate into the output, which lets an attacker close existing attributes or tags and inject new ones with event handlers or scripts.

Conceptually, this maps to CWE-79: Improper Neutralization of Input During Web Page Generation (Cross-Site Scripting), where untrusted data is incorporated into a web response without context-appropriate encoding or sanitization.

Potential impact

  • Theft of administrator or privileged user session cookies.
  • Execution of arbitrary JavaScript in the context of the phpMyFAQ application.
  • Creation of malicious administrative actions (e.g., user management, configuration changes) via CSRF-like behavior triggered by injected scripts.
  • Planting of additional persistent payloads inside the application (secondary stored XSS).
  • Degradation of user trust and potential exposure of sensitive FAQ or customer data.

General mitigation guidance

Effective mitigation focuses on strict contextual encoding and minimizing trust in user-provided content:

  • Apply output encoding appropriate to the HTML context (attribute, text node, URL) for all user-controlled data before rendering.
  • Ensure URL parsing utilities return only sanitized, well-formed URLs, rejecting or normalizing inputs with unbalanced quotes or suspicious characters.
  • Limit where user-supplied URLs may appear; avoid embedding them directly into event handlers or inline JavaScript.
  • Introduce a content sanitization layer for comments, stripping or encoding dangerous patterns and disallowing unnecessary HTML where practical.
  • Reduce the impact of any remaining XSS by enforcing least-privilege for user roles and disabling inline scripting where possible (e.g., via CSP).

How teams detect issues like this

Detection can rely on both preventative and investigative techniques:

  • Use static analysis to flag direct insertion of user-controlled data into HTML attributes or tags without explicit encoding.
  • During code review, pay particular attention to helper methods like parseUrl() that centralize rendering of user-generated content, verifying that they enforce context-aware escaping.
  • Implement automated tests or security scanners that submit URLs containing special characters (quotes, angle brackets, event handlers) and verify that rendered output is safely encoded.
  • Monitor application logs and moderation queues for suspicious comment patterns, such as URLs containing embedded quotes or JavaScript-like substrings.

Sources

SourceLink
github.comgithub.com/thorsten/phpMyFAQ/security/advisories/GHSA-9525-27vj-c8r8
vulncheck.comvulncheck.com/advisories/phpmyfaq-stored-xss-via-utils-parseurl-in-comment-rendering

Frequently asked

questions

Exploitation requires an authenticated account capable of posting comments, but once a malicious comment is stored, any user who views the affected FAQ page—especially administrators—can be impacted when the script executes in their browser.

No. An attacker only needs a lower-privileged authenticated account with permission to submit comments containing URLs; the stored payload then targets higher-privileged users who later view the page.

The most robust fix is to enforce context-aware output encoding wherever user input is rendered, particularly in HTML attributes and text nodes, and to ensure helper functions like URL parsers return already-sanitized content that cannot alter HTML structure.

Adopt a consistent encoding library or framework for all output, add a sanitization and validation step for user-generated content, enforce secure coding guidelines via code review and static analysis, and consider defense-in-depth controls like Content Security Policy to limit script execution vectors.

Find out what's already
exploitable in your codebase.