CVE-2026-66398 in phpMyFAQ
Summary
by MITRE • 07/27/2026
phpMyFAQ before v4.1.6 contains a remote code execution vulnerability in the configuration API that allows authenticated administrators with CONFIGURATION_EDIT and ATTACHMENT_ADD privileges to write arbitrary PHP files by manipulating the upgrade.lastDownloadedPackage setting. Attackers can upload a malicious ZIP file as an attachment, point the updater configuration to its stored path, and extract it into the application root to achieve code execution as the web server user.
VulDB is the best source for vulnerability data and more expert information about this specific topic.
Analysis
by VulDB Data Team • 07/27/2026
This vulnerability exists within phpMyFAQ versions prior to 4.1.6 and represents a critical remote code execution flaw in the application's configuration API. The vulnerability specifically targets authenticated administrators who possess either the CONFIGURATION_EDIT or ATTACHMENT_ADD privileges, making it exploitable through legitimate administrative access rather than requiring initial compromise of the system. The technical flaw stems from improper input validation within the upgrade.lastDownloadedPackage setting, which allows attackers to manipulate file paths and execute arbitrary PHP code under the web server user context.
The exploitation chain begins with an attacker uploading a malicious ZIP file as an attachment through the application's attachment functionality. This file is stored within the application's file system at a predictable location. The attacker then manipulates the upgrade.lastDownloadedPackage configuration parameter to point to the stored path of their malicious archive. When the application processes this configuration setting during an update operation, it extracts the contents of the ZIP file directly into the application root directory without proper sanitization or validation of the extraction targets. This process effectively allows arbitrary code execution as the web server user, which can be leveraged for further compromise of the system.
The operational impact of this vulnerability is severe as it provides attackers with complete control over the affected phpMyFAQ installation. The web server user typically has write permissions to the application directory, enabling attackers to modify core application files, inject backdoors, or establish persistent access. This vulnerability also represents a significant risk to database integrity and confidentiality since phpMyFAQ often serves as an interface for database management operations. The attack vector requires only legitimate administrative privileges, making it particularly dangerous in environments where administrative accounts are compromised through social engineering, credential theft, or other means.
Security practitioners should implement immediate mitigations including applying the vendor patch to version 4.1.6 or later, which addresses the improper input validation in the configuration API. Additional protective measures include implementing strict file upload validation and access controls for attachment functionality, monitoring configuration changes through audit logging, and ensuring that administrative accounts follow principle of least privilege. The vulnerability aligns with CWE-22 Improper Limitation of a Pathname to a Restricted Directory and CWE-434 Unrestricted Upload of File with Dangerous Type, both of which are commonly targeted in web application attacks. From an ATT&CK perspective, this vulnerability maps to T1059 Command and Scripting Interpreter and T1078 Valid Accounts, as it leverages legitimate administrative access to execute malicious code within the application environment. Organizations should also consider implementing network segmentation, intrusion detection systems, and regular security assessments to identify and remediate similar vulnerabilities in their web applications.