# phpMyFAQ SQL injection in BuiltinCaptcha via User-Agent header

Source: https://junglewise.ai/threats/phpmyfaq-sql-injection-in-builtincaptcha-via-user-agent-header-23e44a8e  
Publisher: Junglewise Threat Intelligence, https://junglewise.ai/threats  
Published: 2026-05-15. Updated: 2026-06-09  
License: CC BY 4.0 with a link back

Severity: critical · CVSS 9.8 · Published 2026-05-15

phpMyFAQ, an open-source FAQ software, contains a critical security flaw in its CAPTCHA system. An unauthenticated attacker can send a specially crafted web request to steal sensitive information from the database, including administrator credentials and system configuration details. This could lead to a full takeover of the FAQ platform and exposure of private data.

Technologies: [phpmyfaq/phpmyfaq (Packagist)](https://junglewise.ai/threats/technologies/phpmyfaq-phpmyfaq), [thorsten/phpmyfaq (Packagist)](https://junglewise.ai/threats/technologies/thorsten-phpmyfaq), [Thorsten phpMyFAQ](https://junglewise.ai/threats/technologies/phpmyfaq). Vendors: [Packagist](https://junglewise.ai/threats/vendors/packagist), [Thorsten](https://junglewise.ai/threats/vendors/thorsten).

## Quick answers

**Is This vulnerability exploited in the wild?** No. Junglewise Threat Intelligence has no report of This vulnerability being exploited in the wild.

**How severe is This vulnerability?** Critical severity, with a CVSS score of 9.8, published 15 May 2026.

**Which products and versions are affected?** phpmyfaq/phpmyfaq (Packagist) < 4.1.2; thorsten/phpmyfaq (Packagist) < 4.1.2; Thorsten phpMyFAQ < 4.1.2.

**Is there a fix for This vulnerability?** No fixed version is recorded yet. Check the vendor's advisory in the references below. If you run it, Junglewise drafts a mitigation that fits your setup and applies it once you approve, with senior security engineers behind it.

**How is This vulnerability attacked?** It is attacked over the network, in a network appliance.

**Am I affected?** Check whether you run phpmyfaq/phpmyfaq (Packagist), thorsten/phpmyfaq (Packagist) or Thorsten phpMyFAQ at an affected version. Junglewise does that check for you around the clock: connect your code, cloud and domains, and it matches new vulnerabilities like this one against what you actually run and tells you when one reaches you.

## Technical details

An unauthenticated SQL injection vulnerability exists in phpMyFAQ versions prior to 4.1.2. The issue resides in the BuiltinCaptcha::garbageCollector() and BuiltinCaptcha::saveCaptcha() methods, which use sprintf() to interpolate the 'User-Agent' HTTP header directly into DELETE and INSERT SQL queries without sanitization or parameterization. Attackers can trigger this by sending a crafted User-Agent header to the public /api/captcha endpoint. This enables time-based blind SQL injection, allowing for the extraction of sensitive data such as bcrypt password hashes from the 'faquser' table and SMTP credentials from 'faqconfig'. The vulnerability is resolved in version 4.1.2.

## Affected products

- thorsten phpMyFAQ < 4.1.2

## Timeline

- 2026-04-28: advisory: Original advisory GHSA-289f-fq7w-6q2w published
- 2026-05-15: disclosed: NVD publication of CVE-2026-46364
- 2026-06-08: other: Duplicate advisory GHSA-ch9q-c9mp-j5gq withdrawn

## References

- [https://github.com/thorsten/phpMyFAQ/security/advisories/GHSA-289f-fq7w-6q2w](https://github.com/thorsten/phpMyFAQ/security/advisories/GHSA-289f-fq7w-6q2w)
- [https://github.com/thorsten/phpMyFAQ/commit/b9f25109fddb38eee19987183798638d07943f92](https://github.com/thorsten/phpMyFAQ/commit/b9f25109fddb38eee19987183798638d07943f92)
- [https://www.vulncheck.com/advisories/phpmyfaq-sql-injection-via-user-agent-header-in-builtincaptcha](https://www.vulncheck.com/advisories/phpmyfaq-sql-injection-via-user-agent-header-in-builtincaptcha)

## Related threats

- [phpMyFAQ insufficient authorization in group deletion](https://junglewise.ai/threats/cve-2026-124433-phpmyfaq-before-4-1-11-contains-an-insufficient-authorization)
- [phpMyFAQ WebAuthn account enumeration in prepare-login](https://junglewise.ai/threats/cve-2026-124432-phpmyfaq-4-1-9-before-4-1-11-and-4-2-0-pre-releases-before-4-2-0)
- [phpMyFAQ authorization bypass in attachment downloads](https://junglewise.ai/threats/cve-2026-111910-phpmyfaq-before-4-1-9-and-4-2-0-alpha-before-4-2-0-beta-contains)
- [phpMyFAQ missing authorization in deleteUser API](https://junglewise.ai/threats/cve-2026-111909-phpmyfaq-before-4-1-9-contains-a-missing-authorization)
- [phpMyFAQ broken object-level authorization in FAQ update API](https://junglewise.ai/threats/cve-2026-111908-phpmyfaq-4-0-0-before-4-1-9-and-4-2-0-alpha-before-4-2-0-beta)
