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. 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:
```php
$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:
a_b → LIKE becomes '%a_b%' → _ matches any single character, e.g. matches "aXb", "a1b", "azb" — broader than the literal string a_bte%t → LIKE becomes '%te%t%' → matches test, text, te12t, etc._%_ → LIKE becomes '%_%_%' → matches any record with at least one character, effectively dumping all custom pagesThis allows an attacker to retrieve custom page content that would not appear in normal exact searches, bypassing intended search scope restrictions.
1. Navigate to the phpMyFAQ search page (accessible to unauthenticated users by default).
2. Submit a search query: _%_ (underscore, percent, underscore — length 3, bypasses the <= 2 filter).
3. The backend executes: WHERE (page_title LIKE '%_%_%' OR content LIKE '%_%_%')
4. 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.
searchCustomPages() in Search.php; custom pages (faqcustompages table)% and _ in LIKE search terms before interpolation:```php
$word = str_replace(['\\', '%', '_'], ['\\\\', '\\%', '\\_'], $word);
```
Or use parameterized queries with properly escaped LIKE values.
This issue can be reached over the network, attack complexity is low, an attacker needs no privileges on the target. No user interaction is required. The scope is unchanged, so the impact stays within the vulnerable component. Rated impact: confidentiality low, integrity none, availability none.
The score comes from this vector: CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:N/A:N
CVE-2026-34973 is classified as CWE-943: Improper Neutralization of Special Elements in Data Query Logic. The product generates a query intended to access or manipulate data in a data store such as a database, but it does not neutralize or incorrectly neutralizes special elements that can modify the intended logic of the query.
CVE-2026-34973 is recorded against 2 packages.
Published on 2 April 2026 and last revised on 24 July 2026. A public exploit is known to exist, which raises the urgency of patching considerably. Record sourced from NVD.
phpmyfaq has other advisories on record. If you are patching this one, these are worth checking on the same host:
These advisories are the same class of weakness (CWE-943: Improper Neutralization of Special Elements in Data Query Logic) in other software:
Details
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:N/A:N
Affected Packages
| Software | From version | Fixed in |
|---|---|---|
| phpmyfaq | — | — |
| thorsten/phpmyfaq | — | 4.1.1 |
References
Similar Threats
Exploit Protection
CVE-2026-34973 carries CVSS 5.3 Medium rating and a public exploit already exists. BotEraser checks your installation against this and other known CVE records, and blocks IPs associated with exploit activity.
Check My Site For CVE-2026-34973 →No credit card required · Results in minutes
ⓘ Data Notice: The information presented above has been compiled from publicly available internet sources. Boteraser aggregates this data solely for informational purposes and does not independently classify, evaluate, or endorse any findings about the vulnerabilities listed. The accuracy and completeness of this information is the sole responsibility of the original publishers. Boteraser and its operators accept no liability for any decisions made based on this data.
Stay up to date with the latest from Boteraser.
We use cookies to improve your experience on our site. By using our site, you consent to cookies.
Manage your cookie preferences below:
Essential cookies enable basic functions and are necessary for the proper function of the website.
CloudFlare provides web performance and security solutions, enhancing site speed and protecting against threats.
Service URL: developers.cloudflare.com (opens in a new window)
These cookies are needed for adding comments on this website.
These cookies are used for managing login functionality on this website.
Statistics cookies collect information anonymously. This information helps us understand how visitors use our website.
Google Analytics is a powerful tool that tracks and analyzes website traffic for informed marketing decisions.
Service URL: policies.google.com (opens in a new window)
You can find more information in our Cookie Policy and Privacy Policy.