Skip to content
Threat Feed
high advisory

SQL Injection in phpMyFAQ StopWords::add()

An authenticated administrator can exploit an unescaped SQL insertion vulnerability in the phpMyFAQ StopWords::add() method (CVE-2026-56738) to execute arbitrary database commands.

CVE search metadata

CVE search record: CVE-2026-56738. KEV: no. Product: phpMyFAQ (<= 4.1.5), phpMyFAQ (3.2.0 - 4.1.5), phpMyFAQ (< 4.2.0-alpha). Brief: SQL Injection in phpMyFAQ StopWords::add(). Brief link: https://feed.craftedsignal.io/briefs/2026-09-phpmyfaq-sqli/

What's new

  • 1. added detection rule: Detect CVE-2026-56736 Exploitation - POST Request to FAQ Creation with XSS Patterns Sep 24, 20:05 via ghsa
  • 2. added detection rule: Detect CVE-2026-56737 Exploitation - Brute Force on /check Endpoint Sep 24, 20:05 via ghsa

phpMyFAQ versions up to and including 4.1.5 contain a SQL injection vulnerability within the StopWords::add() method in src/phpMyFAQ/StopWords.php. The vulnerability occurs because the application uses sprintf() to construct SQL queries but fails to sanitize the user-supplied stop word input using the database driver's escape() method. While sibling methods like StopWords::update() correctly implement escaping, the add() method omits this security control, creating an inconsistency that allows authenticated administrative users to break out of the SQL string literal.

An attacker with administrative privileges can inject arbitrary SQL commands, such as DROP TABLE, UNION-based exfiltration, or unauthorized data modification. While the threat requires authenticated administrative access, it represents a significant risk for environments where administrative sessions may be hijacked or compromised, or where administrative credentials are shared.

Attack Chain

  1. Attacker gains access to a valid phpMyFAQ administrator session through credential theft or session hijacking.
  2. Attacker logs into the phpMyFAQ administration panel.
  3. Attacker navigates to the Stop Words management interface.
  4. Attacker enters a malicious payload containing SQL metacharacters (e.g., test', 'en'); DROP TABLE faqstopwords; --) into the new stop word field.
  5. The StopWords::add() method processes the unsanitized input via sprintf() and constructs a malformed SQL query.
  6. The application executes the concatenated SQL statement against the backend database.
  7. The database driver interprets the injected content as a legitimate second command, leading to unauthorized data exfiltration or table destruction.

Impact

Successful exploitation allows an authenticated administrator to bypass intended application logic to perform unauthorized database operations. This can lead to total loss of database integrity through table deletion, exfiltration of sensitive FAQ content or user credentials, and modification of internal application data. The vulnerability highlights a failure in input validation that persists until the application is patched to use consistent escaping or, preferably, prepared statements.

Recommendation

  1. Upgrade phpMyFAQ to a version later than 4.1.5 immediately to resolve the inconsistency in the StopWords::add() method.
  2. Audit database query patterns across the StopWords class to ensure consistent use of escape() for all input parameters concatenated into SQL strings.
  3. Prioritize migrating sprintf()-based database interactions to parameterized or prepared statements (e.g., PDO::prepare()) to structurally eliminate this class of vulnerability.
  4. Monitor web server logs for administrative accounts performing suspicious SQL syntax patterns (e.g., UNION, DROP TABLE) originating from the stop words management endpoints.

Immediate actions

Upgrade phpMyFAQ to a version higher than 4.1.5

IT Operations 48h

Mitigations

Implement input validation on the stop-word administrative form to block suspicious SQL characters

immediate Development

CVE-2026-56738

Detection coverage 2

Detect CVE-2026-56737 Exploitation - Brute Force on /check Endpoint

high

Detects potential brute force exploitation attempts against the phpMyFAQ 2FA /check endpoint by monitoring high-frequency POST requests.

sigma tactics: initial_access techniques: T1550 sources: webserver

Detect CVE-2026-56736 Exploitation - POST Request to FAQ Creation with XSS Patterns

high

Detects potential exploitation attempts of CVE-2026-56736 by monitoring POST requests to the FAQ API containing common XSS vectors within the answer field.

sigma tactics: initial_access techniques: T1190 sources: webserver

Detection queries are available on the platform. Get full rules →