/

CVE-2026-109573

Severity:

HIGH RISK

(8.1)

SQL Injection (CWE-89) in phpMyFAQ Autocomplete API

CVE-2026-109573

Deferred

Vulnerability type

Category:

SQL Injection

CWE:

CWE-89

Impact:

Unauthorized database access and modification

Severity:

HIGH RISK

(8.1)

CVSS version:

3.1

Catch this CVE while code is being written

Detect vulnerable code directly in pull requests, so CVEs are fixed before merge.

Summary

phpMyFAQ contains an SQL injection vulnerability in its MySQL escaping logic when the database uses NO_BACKSLASH_ESCAPES mode. An unauthenticated attacker may exploit the search functionality to read sensitive data, alter records, or remove database tables.

phpMyFAQ contains an SQL injection vulnerability in its MySQL escaping logic when the database uses NO_BACKSLASH_ESCAPES mode. An unauthenticated attacker may exploit the search functionality to read sensitive data, alter records, or remove database tables.

Affected context

The issue affects phpMyFAQ deployments that use the vulnerable PdoMysql::escape() behavior with MySQL or MariaDB configured for NO_BACKSLASH_ESCAPES mode. The autocomplete search endpoint becomes risky when user-controlled search input is normalized before database query construction and escaping does not match the database's active SQL parsing rules.

The issue affects phpMyFAQ deployments that use the vulnerable PdoMysql::escape() behavior with MySQL or MariaDB configured for NO_BACKSLASH_ESCAPES mode. The autocomplete search endpoint becomes risky when user-controlled search input is normalized before database query construction and escaping does not match the database's active SQL parsing rules.

Exploit preconditions

  • Attack surface: The unauthenticated autocomplete search API
  • Required access: Network access to the phpMyFAQ application; no account may be required
  • Trigger point: Processing the endpoint's search parameter
  • Relevant condition: The backend uses the affected MySQL escaping behavior while NO_BACKSLASH_ESCAPES mode is enabled
  • Why exploitation is possible: Input normalization can produce SQL-significant characters, while backslash-based quote escaping is treated literally by the database
  • Attack surface: The unauthenticated autocomplete search API
  • Required access: Network access to the phpMyFAQ application; no account may be required
  • Trigger point: Processing the endpoint's search parameter
  • Relevant condition: The backend uses the affected MySQL escaping behavior while NO_BACKSLASH_ESCAPES mode is enabled
  • Why exploitation is possible: Input normalization can produce SQL-significant characters, while backslash-based quote escaping is treated literally by the database

Why this happens

The vulnerability results from relying on backslash escaping for SQL string delimiters without accounting for the database session's SQL mode. Under NO_BACKSLASH_ESCAPES, the database does not interpret the backslash as an escape character, so the application's escaping assumptions do not hold. This is a classic CWE-89: SQL Injection condition in which externally controlled input can alter the structure or meaning of a database query.

The vulnerability results from relying on backslash escaping for SQL string delimiters without accounting for the database session's SQL mode. Under NO_BACKSLASH_ESCAPES, the database does not interpret the backslash as an escape character, so the application's escaping assumptions do not hold. This is a classic CWE-89: SQL Injection condition in which externally controlled input can alter the structure or meaning of a database query.

Potential impact

  • An unauthenticated attacker may read credentials, configuration secrets, or other database contents.
  • An attacker could modify application records.
  • An attacker could delete tables or otherwise damage stored data.
  • Compromised secrets could enable follow-on access to connected services.
  • An unauthenticated attacker may read credentials, configuration secrets, or other database contents.
  • An attacker could modify application records.
  • An attacker could delete tables or otherwise damage stored data.
  • Compromised secrets could enable follow-on access to connected services.

General mitigation guidance

Mitigation generally focuses on eliminating string-based SQL construction and ensuring that application and database parsing rules are aligned.

Common defensive patterns include:

  • Use parameterized queries or prepared statements for all user-controlled values.
  • Avoid treating manual escaping as a substitute for query parameterization.
  • Normalize and validate input according to a narrowly defined search schema before database access.
  • Keep database session modes explicit, consistent, and covered by security testing.
  • Restrict database credentials to the minimum operations required by the application.
  • Separate application accounts by function and prevent routine application users from performing schema-altering operations.

Mitigation generally focuses on eliminating string-based SQL construction and ensuring that application and database parsing rules are aligned.

Common defensive patterns include:

  • Use parameterized queries or prepared statements for all user-controlled values.
  • Avoid treating manual escaping as a substitute for query parameterization.
  • Normalize and validate input according to a narrowly defined search schema before database access.
  • Keep database session modes explicit, consistent, and covered by security testing.
  • Restrict database credentials to the minimum operations required by the application.
  • Separate application accounts by function and prevent routine application users from performing schema-altering operations.

How teams detect issues like this

Organizations can identify related risks through:

  • Static analysis rules that flag SQL queries assembled through string concatenation or interpolation.
  • Code review checks for custom escaping helpers used in place of prepared statements.
  • Tests that exercise quote handling, Unicode normalization, and differing database SQL modes.
  • Database activity monitoring for unexpected metadata reads, schema changes, or destructive statements.
  • Web application monitoring for anomalous requests to search and autocomplete endpoints.

Automated code review and software composition analysis tools may help identify unsafe query construction and vulnerable components.

Organizations can identify related risks through:

  • Static analysis rules that flag SQL queries assembled through string concatenation or interpolation.
  • Code review checks for custom escaping helpers used in place of prepared statements.
  • Tests that exercise quote handling, Unicode normalization, and differing database SQL modes.
  • Database activity monitoring for unexpected metadata reads, schema changes, or destructive statements.
  • Web application monitoring for anomalous requests to search and autocomplete endpoints.

Automated code review and software composition analysis tools may help identify unsafe query construction and vulnerable components.

Sources

SourceLink
github.comgithub.com/thorsten/phpMyFAQ/security/advisories/GHSA-98p2-cg7p-h385
vulncheck.comvulncheck.com/advisories/phpmyfaq-before-4.1.9-sql-injection-via-api-autocomplete-search-endpoint

Frequently asked

questions

Yes. The affected autocomplete functionality may be reachable by unauthenticated users, subject to application routing and deployment controls.

An attacker generally needs network access to the phpMyFAQ service and the ability to submit search requests. Database credentials or an application account may not be necessary.

The preferred pattern is to use parameterized queries or prepared statements rather than relying on manually escaped SQL strings.

Combine parameterized database access with strict input validation, tests across supported SQL modes, least-privileged database accounts, and monitoring for unusual query behavior.

Yes. The affected autocomplete functionality may be reachable by unauthenticated users, subject to application routing and deployment controls.

An attacker generally needs network access to the phpMyFAQ service and the ability to submit search requests. Database credentials or an application account may not be necessary.

The preferred pattern is to use parameterized queries or prepared statements rather than relying on manually escaped SQL strings.

Combine parameterized database access with strict input validation, tests across supported SQL modes, least-privileged database accounts, and monitoring for unusual query behavior.

Find out what's already
exploitable in your codebase.