GHSA-fxm2-cmwj-qvx4 — thorsten/phpmyfaq
HIGHGHSA-fxm2-cmwj-qvx4 is a high-severity (CVSS 7.2) SQL Injection vulnerability in thorsten/phpmyfaq. A fix is available for thorsten/phpmyfaq — see the affected versions and patch details below.
phpMyFAQ has Authenticated SQL Injection in Configuration Update Functionality
Exploitation Status
Proof-of-concept exploit code exists
- CISA’s SSVC triage found public proof-of-concept exploit code for this CVE, though no confirmed active exploitation.
- A successful exploit gives an attacker total control of the affected component, not partial access.
Exploitation and automatability from CISA’s SSVC triage for GHSA-fxm2-cmwj-qvx4.
EPSS Exploitation Probability
EPSS (Exploit Prediction Scoring System) is a daily probability model maintained by FIRST.org. It estimates the likelihood a CVE will be exploited in production environments within the next 30 days, derived from real-world threat intelligence signals.
How urgent is this, really
GHSA-fxm2-cmwj-qvx4 plotted by exploitation likelihood (EPSS) against impact (CVSS). The shaded corner — EPSS 50%+ and CVSS 7.0+ — is where this CVE doesn't sit, though severity or exploitability alone can still warrant action.
Where this sits among everything scored
Of 378,567 CVEs with a current EPSS score, this one falls in the < 10% band (highlighted). Real counts from FIRST.org, not a sample — log-scaled since the landscape is heavily right-skewed.
Real-World Exposure
thorsten/phpmyfaq🐘phpmyfaq/phpmyfaqReal-time download stats are indexed for npm and PyPI packages. This vulnerability affects Packagist packages — download data is not available via public APIs for these ecosystems.
Description
Summary
An authenticated SQL injection vulnerability in the main configuration update functionality of phpMyFAQ (v4.0.13 and prior) allows a privileged user with 'Configuration Edit' permissions to execute arbitrary SQL commands. Successful exploitation can lead to a full compromise of the database, including reading, modifying, or deleting all data, as well as potential remote code execution depending on the database configuration.
Details
The vulnerability exists in the save method within the src/phpMyFAQ/Controller/Administration/ConfigurationTabController.php controller. This method handles the saving of application-wide configuration settings. It retrieves all submitted form data as an associative array via $request->get('edit').
The core of the issue is that while the values of this array are processed, the keys are trusted implicitly and are not sanitized or validated.
File: src/phpMyFAQ/Controller/Administration/ConfigurationTabController.php
// ...
public function save(Request $request): JsonResponse
{
$this->userHasPermission(PermissionType::CONFIGURATION_EDIT);
$configurationData = $request->get('edit');
// ...
foreach ($configurationData as $key => $value) {
// The key from the user input is used to build the $newConfigValues array.
$newConfigValues[$key] = (string) $value;
// ...
}
// ...
// The array, containing user-controlled keys, is passed to the model.
$this->configuration->update($newConfigValues);
return $this->json(['success' => Translation::get('ad_config_saved')], Response::HTTP_OK);
}
The $newConfigValues array, which contains user-controlled keys, is then passed to the update method in the src/phpMyFAQ/Configuration.php model. Here, the key ($name) is directly concatenated into a raw SQL query string.
File: src/phpMyFAQ/Configuration.php
public function update(array $newConfigs): bool
{
// ...
foreach ($newConfigs as $name => $value) {
if ($name != 'main.phpMyFAQToken' && !in_array($name, $runtimeConfigs)) {
// VULNERABLE CODE: The array key '$name' is not escaped and is directly
// concatenated into the SQL query string. The value is escaped, but not the name.
$update = sprintf(
"UPDATE %s%s SET config_value = '%s' WHERE config_name = '%s'",
Database::getTablePrefix(),
$this->tableName,
$this->getDb()->escape(trim($value)),
$name
);
$this->getDb()->query($update);
// ...
}
}
return true;
}
An attacker can craft a malicious form parameter name (which becomes the array key) to break out of the single quotes in the WHERE clause and inject arbitrary SQL commands.
PoC (Proof of Concept)
Prerequisites:
- A running instance of phpMyFAQ (v4.0.13 confirmed vulnerable).
- An authenticated user session with permissions to edit the configuration.
Execution: Due to the application's CSRF protection, the easiest way to reproduce this is by capturing a legitimate request to save the configuration and modifying it using a proxy tool like Burp Suite's Repeater.
- Log in as an administrator and navigate to Administration -> Configuration.
- Make a trivial change (e.g., toggle a setting) and click "Save configuration". Capture this
POSTrequest to/admin/api/configuration. - Send the captured request to Repeater. The request will contain a valid
Cookieheader and apmf-csrf-tokenparameter. - Modify the request body to inject a malicious key. Add a new
multipart/form-datapart with a craftednameattribute.
Example Malicious Request Body Part (Error-Based):
------WebKitFormBoundaryRandomString
Content-Disposition: form-data; name="edit[dummykey' and updatexml(1, concat(0x7e, (SELECT table_name FROM information_schema.tables WHERE table_schema = database() LIMIT 0, 1), 0x7e), 1) and '1]"
true
------WebKitFormBoundaryRandomString
Note: You must also include the pmf-csrf-token part from the original request in the body.
Result:
The server will respond with a 500 Internal Server Error, and the body of the response will contain a database error message, confirming the SQL injection. The leaked data will be present within the error string.
An error occurred: XPATH syntax error: '~faq_faqadminlog~' at line 311 at /var/www/html/src/phpMyFAQ/Database/Mysqli.php
This error confirms the successful execution of the injected updatexml payload, which has extracted and revealed the name of the first table in the database (faq_faqadminlog). Time-based blind techniques can also be used to extract data without relying on error messages.
Affected Packages
| Ecosystem | Package | Vulnerable range | Fix |
|---|---|---|---|
| 🐘Packagist | thorsten/phpmyfaq | all versions | 4.0.14composer require thorsten/phpmyfaq:^4.0.14 |
| 🐘Packagist | phpmyfaq/phpmyfaq | all versions | 4.0.14composer require phpmyfaq/phpmyfaq:^4.0.14 |
Detection & mitigation playbook
Open-source dependencyDetect
Scan your dependency tree (package-lock.json, pnpm-lock.yaml, requirements.txt, go.sum, etc.) for thorsten/phpmyfaq, including transitive dependencies — a direct dependency you never call can still pull in a vulnerable version.
Fix
Update thorsten/phpmyfaq to 4.0.14 or later, then make sure no transitive (indirect) dependency still pins the vulnerable range — O3 confirms GHSA-fxm2-cmwj-qvx4 is resolved across your whole dependency graph.
Workarounds
If you can't upgrade right away: gate or disable the affected feature, validate untrusted input at the boundary, and avoid passing attacker-controlled data into the vulnerable path. O3's runtime protection blocks exploitation in production as an interim safeguard until the upgrade lands.
How O3 protects you
O3 Security's impact-aware SCA analyses which vulnerable code paths your application actually calls, so a match like GHSA-fxm2-cmwj-qvx4 can be triaged on real exposure rather than presence alone.
Tailored to GHSA-fxm2-cmwj-qvx4. Runtime protection reduces exposure until a permanent patch is applied and verified — it complements patching, it doesn't replace it.
Frequently Asked Questions
Is GHSA-fxm2-cmwj-qvx4 in your dependencies?
O3 Security finds GHSA-fxm2-cmwj-qvx4 across Packagist dependencies, including transitive ones, and its impact-aware SCA ranks findings by whether your code actually calls the vulnerable path.