All vulnerabilities
GHSA-6x9g-rfx8-g42q

thorsten/phpmyfaq: CSRF Allows Unauthorized Database Migrations via /admin/api/update-database

thorsten/phpmyfaq
CVSS
7.1High
ExploitationNo known exploitationNot in CISA KEV, which does not prove it is unexploitedCISA KEV
Exploit odds (EPSS)No scoreNo FIRST EPSS score in this snapshot yet
Fixed in4.1.9Fixed versionGitHub
Published3 Oct 2026Updated 3 Oct 2026GitHub

What fixes it

  • 4.1.9thorsten/phpmyfaq, composerGitHubcomposer require "thorsten/phpmyfaq:^4.1.9"

A fixed version on one release line is not the upgrade target for every line. Check your exact version and any vendor backports.

Description

Summary

The POST /admin/api/update-database endpoint performs database migrations without requiring a CSRF token.

The endpoint only checks the global CONFIGURATION_EDIT permission and does not invoke the CSRF token validation mechanism used by other update-related endpoints.

Reproduction

Tested on phpMyFAQ 4.1.8.

A user with only the editconfig / CONFIGURATION_EDIT permission was logged in. The following request was sent without any CSRF token:

POST /admin/api/update-database HTTP/1.1
Host: localhost:8080
Cookie: PHPSESSID=<u_conf-session>
Content-Type: application/json

{}

The server returned:

{"success":"Database successfully updated."}

The database migration was executed successfully despite the absence of a CSRF token.

Root Cause

updateDatabase() does not call Token::verifyToken().

Other update-related endpoints use isValidUpdatePackageToken(), but the same protection is not applied to update-database.

Impact

An attacker can potentially trigger database migrations in a victim's authenticated browser through a cross-site request.

Depending on the database state and migration being executed, this can cause database integrity or availability issues.

The endpoint is also accessible to users with the delegated CONFIGURATION_EDIT permission rather than being restricted to superadmins.

Remediation

Require a page-scoped CSRF token before executing database migrations:

if (!Token::getInstance($this->container->get('session'))
    ->verifyToken('update-database', $data->csrf)) {
    return $this->json(
        ['error' => Translation::get('msgNoPermission')],
        Response::HTTP_UNAUTHORIZED
    );
}

The authorization requirements for sensitive update operations should also be reviewed separately.

Text from GitHub Advisory Database

Affected versions 1

  • thorsten/phpmyfaq, composer4.1.8GitHub