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
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
- Attacker gains access to a valid phpMyFAQ administrator session through credential theft or session hijacking.
- Attacker logs into the phpMyFAQ administration panel.
- Attacker navigates to the Stop Words management interface.
- Attacker enters a malicious payload containing SQL metacharacters (e.g.,
test', 'en'); DROP TABLE faqstopwords; --) into the new stop word field. - The
StopWords::add()method processes the unsanitized input viasprintf()and constructs a malformed SQL query. - The application executes the concatenated SQL statement against the backend database.
- 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
- Upgrade phpMyFAQ to a version later than 4.1.5 immediately to resolve the inconsistency in the
StopWords::add()method. - Audit database query patterns across the
StopWordsclass to ensure consistent use ofescape()for all input parameters concatenated into SQL strings. - Prioritize migrating
sprintf()-based database interactions to parameterized or prepared statements (e.g.,PDO::prepare()) to structurally eliminate this class of vulnerability. - 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
Mitigations
Implement input validation on the stop-word administrative form to block suspicious SQL characters
CVE-2026-56738
Detection coverage 2
Detect CVE-2026-56737 Exploitation - Brute Force on /check Endpoint
highDetects potential brute force exploitation attempts against the phpMyFAQ 2FA /check endpoint by monitoring high-frequency POST requests.
Detect CVE-2026-56736 Exploitation - POST Request to FAQ Creation with XSS Patterns
highDetects potential exploitation attempts of CVE-2026-56736 by monitoring POST requests to the FAQ API containing common XSS vectors within the answer field.
Detection queries are available on the platform. Get full rules →