Loading advisory.
Loading advisory.
phpMyFAQ has a LIKE Wildcard Injection in Search.php — Unescaped % and _ Metacharacters Enable Broad Content Disclosure
The searchCustomPages() method in phpmyfaq/src/phpMyFAQ/Search.php uses real_escape_string() (via escape()) to sanitize the search term before embedding it in LIKE clauses.
Published 2026-04-01 23:41 UTC · Modified 2026-04-06 23:34 UTC
Severity and EPSS are shown separately. Helm does not combine them into one score.
| Package | Ecosystem | Affected | Fixed in | Upgrade command |
|---|---|---|---|---|
| thorsten/phpmyfaq | Packagist | < 4.1.1 versions 2.10.0-alpha, 2.8.0, 2.8.0-RC, 2.8.0-RC2, 2.8.0-RC3, 2.8.0-RC4, 2.8.0-alpha2, 2.8.0-alpha3, 2.8.0-beta, 2.8.0-beta2, 2.8.0-beta3, 2.8.1, 2.8.10, 2.8.11, 2.8.12, 2.8.13, 2.8.14, 2.8.15, 2.8.16, 2.8.17 and 149 more | 4.1.1 | composer require 'thorsten/phpmyfaq:>=4.1.1' |
The searchCustomPages() method in phpmyfaq/src/phpMyFAQ/Search.php uses real_escape_string() (via escape()) to sanitize the search term before embedding it in LIKE clauses. However, real_escape_string() does not escape SQL LIKE metacharacters % (match any sequence) and _ (match any single character). An unauthenticated attacker can inject these wildcards into search queries, causing them to match unintended records — including content that was not meant to be surfaced — resulting in information disclosure.
File: phpmyfaq/src/phpMyFAQ/Search.php, lines 226–240
Vulnerable code:
$escapedSearchTerm = $this->configuration->getDb()->escape($searchTerm);
$searchWords = explode(' ', $escapedSearchTerm);
$searchConditions = [];
foreach ($searchWords as $word) {
if (strlen($word) <= 2) {
continue;
}
$searchConditions[] = sprintf(
"(page_title LIKE '%%%s%%' OR content LIKE '%%%s%%')",
$word,
$word
);
}escape() calls mysqli::real_escape_string(), which escapes characters like ', \, NULL, etc. — but explicitly does not escape % or _, as these are not SQL string delimiters. They are, however, LIKE pattern wildcards.
Attack vector:
A user submits a search term containing _ or % as part of a 3+ character word (to bypass the strlen <= 2 filter). Examples:
Search for a_b → LIKE becomes '%a_b%' → _ matches any single character, e.g. matches "aXb", "a1b", "azb" — broader than the literal string a_b
Search for te%t → LIKE becomes '%te%t%' → matches test, text, te12t, etc.
Search for _%_ → LIKE becomes '%_%_%' → matches any record with at least one character, effectively dumping all custom pages
This allows an attacker to retrieve custom page content that would not appear in normal exact searches, bypassing intended search scope restrictions.
Navigate to the phpMyFAQ search page (accessible to unauthenticated users by default).
Submit a search query: _%_ (underscore, percent, underscore — length 3, bypasses the <= 2 filter).
The backend executes: WHERE (page_title LIKE '%_%_%' OR content LIKE '%_%_%')
This matches all custom pages with at least one character in title or content — returning content that would not appear for a specific search term.
Authentication required: None — search is publicly accessible
Affected component: searchCustomPages() in Search.php; custom pages (faqcustompages table)
Impact: Unauthenticated users can enumerate/disclose all custom page content regardless of the intended search term filter
Fix: Escape % and _ in LIKE search terms before interpolation:
$word = str_replace(['\\', '%', '_'], ['\\\\', '\\%', '\\_'], $word);Or use parameterized queries with properly escaped LIKE values.
No public exploit code known to Helm's sources (Nuclei templates, Metasploit, Exploit-DB and PoC-in-GitHub). That does not mean none exists.
EPSS went from 0.004 on 2026-11-24 to 0.004 on 2026-11-30, over 3 recorded scores.
| Date | Score | Previous | Model |
|---|---|---|---|
| 2026-11-24 | 0.004 | first score | v2026.06.15 |
| 2026-11-26 | 0.004 | 0.004 | v2026.06.15 |
| 2026-11-30 | 0.004 | 0.004 | v2026.06.15 |