Overview
phpMyFAQ, an open-source FAQ management web application, is affected by CVE-2026-56736, a stored cross-site scripting (XSS) vulnerability tracked upstream as GHSA-pgwp-vc7q-cvj3. The flaw allows any unauthenticated visitor — or a low-privileged registered user — to submit a crafted FAQ entry from the public-facing frontend that plants persistent JavaScript. That payload survives the application's sanitization pipeline and executes in an administrator's browser the moment the admin opens the submission in the Admin FAQ Editor to review, approve, or edit it. Because the script runs in the admin's authenticated session, the practical outcome is session theft and potential full admin account takeover. The issue carries a CVSS v3.1 score of 8.2 (High), with vector AV:N/AC:L/PR:N/UI:R/S:C/C:H/I:L/A:N, and was published September 24, 2026. It is fixed in phpMyFAQ 4.2.0-alpha.
Technical Details
| Attribute | Value |
|---|---|
| CVE ID | CVE-2026-56736 |
| Severity | High (CVSS 8.2) |
| Attack Vector | Network — frontend FAQ submission form |
| Authentication | Not required to inject the payload |
| Privileges Required | None (unauthenticated) or low-privileged registered user |
| User Interaction | Required — an administrator must open/review the submitted FAQ entry |
| Impact | Stored XSS executing in the admin session; session/cookie theft, admin panel compromise |
CWE Classification: CWE-79 (Improper Neutralization of Input During Web Page Generation / Cross-Site Scripting).
How It Works
The vulnerability lives in the gap between phpMyFAQ's input sanitization and how the Admin FAQ Editor renders stored content:
- Submission — An unauthenticated or low-privileged user submits a new FAQ entry (or comment/edit) through the public frontend, embedding a payload in a field such as the FAQ question, answer, or keywords using HTML-encoded characters designed to slip past the initial filter.
- Flawed sanitization order — On the way in, phpMyFAQ applies
strip_tags()to the submitted content, which appears to remove executable markup. However, the application later callshtml_entity_decode()on the same content — converting the previously-encoded entities back into live, executable HTML after thestrip_tags()pass has already let them through unmodified. - Unsafe rendering in the admin template — When an administrator opens the pending or existing FAQ entry in the Admin FAQ Editor, the decoded content is rendered through a Twig template using the
|rawfilter, which disables Twig's automatic output escaping entirely. There is no output-side sanitization to catch what the flawed encode/decode chain missed. - Execution in the admin context — The injected JavaScript runs with the full privileges of the administrator's authenticated session, giving the attacker a path to steal session cookies, forge admin actions, or pivot to broader compromise of the FAQ instance.
The root cause is a classic sanitize-then-decode ordering bug: encoding-based filter bypasses are only effective if nothing downstream reverses the encoding before the content reaches a sink that executes it. Here, html_entity_decode() does exactly that immediately before an unescaped |raw render.
Impact Assessment
Who Is At Risk
| Impact Area | Description |
|---|---|
| Admin Sessions | Any administrator who reviews, edits, or approves user-submitted FAQ content is exposed on every visit to the Admin FAQ Editor until patched. |
| Public-Facing Instances | Any phpMyFAQ deployment that accepts frontend FAQ submissions from anonymous or low-privileged users — the most common configuration for public knowledge bases and support portals. |
| Downstream Trust | Organizations exposing phpMyFAQ as a customer-facing or internal knowledge base risk broader compromise if the admin account shares credentials or session infrastructure with other systems. |
| Content Integrity | Once an attacker controls the admin session, they can tamper with published FAQ content, plant further malicious entries, or exfiltrate the underlying database via admin-panel functionality. |
Potential Attack Chains
- Session hijack → admin panel takeover — The attacker's script exfiltrates the admin's session cookie to an external endpoint; the attacker replays it to gain full administrative access to phpMyFAQ.
- Persistent backdoor via content tampering — With admin access obtained via the stolen session, the attacker edits other FAQ entries to plant additional stored payloads, creating a self-sustaining XSS foothold that survives remediation of the original entry.
- Credential harvesting via DOM manipulation — The injected script rewrites the admin UI (e.g., a fake re-authentication prompt) to capture the administrator's actual login credentials rather than just the session token.
- Chaining with other disclosed phpMyFAQ issues — CVE-2026-56736 was disclosed alongside related phpMyFAQ advisories, including an authentication bypass (CVE-2026-56737) and a SQL injection in
StopWords::add()(CVE-2026-56738). An attacker could use this stored XSS to gain an initial administrative foothold and then leverage a co-disclosed flaw to escalate further or exfiltrate the underlying database.
Mitigation
Immediate Actions
- Upgrade to phpMyFAQ 4.2.0-alpha or later — This is the only complete fix; it corrects the sanitize/decode ordering and removes the unsafe
|rawrendering of user-submitted content in the Admin FAQ Editor. - Restrict or disable anonymous FAQ submission — If upgrading is not immediately possible, temporarily disable frontend submissions from unauthenticated or low-privileged users, or route all submissions through manual pre-moderation outside the vulnerable review flow.
- Rotate admin session secrets — After patching, invalidate existing administrator sessions and force re-authentication, in case a payload was already planted and reviewed prior to remediation.
- Audit existing FAQ content — Review recently submitted or edited FAQ entries, comments, and keyword fields for encoded script fragments (e.g., HTML-entity-encoded
<script>tags or event handler attributes) that may already be stored.
Detection Opportunities
- Review the Admin FAQ Editor render path — Search the phpMyFAQ template layer for
|rawfilter usage on any field that originates from user-submitted content; this is the sink that made the bypass exploitable. - Inspect stored FAQ records for entity-encoded payloads — Query the FAQ, comment, and keyword tables for values containing
<,&#, or double-encoded sequences that would decode into<script>,onerror=,onload=, or similar executable constructs. - Monitor admin-session network activity — Unexpected outbound requests from the admin panel origin (beaconing to unfamiliar domains) immediately after opening a FAQ entry for review is a strong indicator of active exploitation.
- Check web server and WAF logs — Look for FAQ submission requests containing HTML-entity-encoded script markup in the question, answer, or keyword parameters.
Defence-in-Depth
- Enforce Content Security Policy (CSP) on the admin panel to restrict inline script execution and unauthorized outbound connections, reducing the impact even if an XSS payload executes.
- Set
HttpOnlyandSecureflags on admin session cookies so that even a successful script injection cannot directly read the session token viadocument.cookie. - Apply the principle of least privilege to admin accounts — separate the "review submissions" role from full administrative capability where phpMyFAQ's permission model allows it, limiting blast radius if a reviewer's session is compromised.
- Adopt a web application firewall (WAF) rule set tuned for stored-XSS patterns on form submission endpoints as a compensating control until the upgrade is deployed.
- Track phpMyFAQ security advisories going forward — this disclosure was one of three related phpMyFAQ CVEs released the same day, suggesting an active third-party security review of the codebase; expect further advisories and patches in the near term.
Key Takeaways
- CVE-2026-56736 is a stored XSS in phpMyFAQ, fixed in 4.2.0-alpha, allowing unauthenticated attackers to target administrators.
- The root cause is an encode/decode ordering flaw —
html_entity_decode()reversesstrip_tags()filtering before an unescaped Twig|rawrender in the Admin FAQ Editor. - Exploitation requires no authentication to inject the payload, only that an administrator later reviews the malicious submission (
UI:Rin the CVSS vector). - Successful exploitation enables session theft and admin account takeover, with a path to further content tampering and database exposure.
- Upgrading to phpMyFAQ 4.2.0-alpha or later is the only complete remediation; interim mitigations include disabling anonymous submissions and rotating admin sessions.
- This CVE was disclosed alongside CVE-2026-56737 (authentication bypass) and CVE-2026-56738 (SQL injection), so patch reviews should account for chained exploitation across all three.