Attack ChainAIDerived
Hypothetical attack flow derived from CVE metadata – not a confirmed exploit chain
-
ReconIdentify phpMyFAQ <4.1.2 with Azure AD SSO enabled
-
DeliveryRegister Entra ID account with SQL payload in display name or JWT claim
-
ExploitInitiate OAuth login to phpMyFAQ
-
InstallIdP returns id_token containing malicious claim
-
C2setTokenData() interpolates claim into unescaped UPDATE
-
ExecuteInjected SQL executes against faquser table
-
ImpactEscalate privileges or exfiltrate FAQ database
Vulnerability Assessment
| Weakness |
CWE
OWASP Top 10:2025
A05:2025 - Injection
ASVS 5.0
V1 - Encoding and Sanitization Parameterized queries, prepared statements
MITRE ATT&CK
2 techniques across 2 tactics: Initial Access, Persistence The technique list with ATT&CK links and the kill-chain view is part of the Basic plan and up. |
| Exploitation Conditions | The target phpMyFAQ instance (version < 4.1.2) must have Microsoft Azure AD / Entra ID OAuth authentication enabled and reachable, because CurrentUser::setTokenData() is only invoked along that SSO code path; instances using only local accounts or non-Azure auth providers are not exposed. The attacker must control or register an Entra ID account that is permitted to authenticate against the target's app registration and must place SQL metacharacters (notably a single quote) into a field that flows into the OAuth token - specifically the Azure AD display name, the preferred_username claim, or another JWT claim embedded in id_token - and then complete a successful OAuth login (UI:P passive interaction). No privileges within phpMyFAQ are required pre-exploitation (PR:N), and no application-layer escaping is bypassed beyond the missing $db->escape() call, but high attack complexity (AC:H) reflects the need to control IdP-side claims and the dependency on the Azure AD tenant configuration accepting the attacker's account. |
| Impact | Signals are mixed and warrant context-aware prioritization rather than blanket urgency. The CVSS 4.0 score of 7.7 reflects network attack vector but high attack complexity (AC:H), required attack prerequisites (AT:P), passive user interaction (UI:P), and high confidentiality/integrity/availability impact (VC:H/VI:H/VA:H) - consistent with SSVC's 'Total' technical impact but 'Automatable: no' classification. EPSS is very low (0.03% / 9th percentile), and the CVE is not listed in CISA KEV, indicating no observed mass exploitation. However, SSVC marks exploitation status as 'poc' and a detailed advisory plus working proof-of-concept methodology is published by VulnCheck and the upstream GHSA, so targeted attacks against phpMyFAQ instances with Azure AD enabled are plausible. The CVSS vector indicates PR:N (no privileges required at the SQL layer), but the description and code path show that exploitation requires a usable Azure AD account that authenticates into the target phpMyFAQ instance - a meaningful gating factor not visible from the vector alone. Defenders running phpMyFAQ with Azure AD SSO should treat this as a high-priority patch; deployments using local accounts only are not reachable through this path. |
| Exploit ScenarioDerived | An attacker registers (or controls) a Microsoft Entra ID account whose display name or a custom JWT claim such as preferred_username contains an SQL payload like O'; UPDATE faquser SET is_admin=1 WHERE user_id=1-- . They then log in to a target phpMyFAQ instance that has Azure AD SSO enabled; the legitimate OAuth token exchange returns an id_token containing the attacker-controlled claim. When phpMyFAQ calls CurrentUser::setTokenData() to persist the tokens, the unescaped single quote breaks out of the SQL string literal and the appended payload executes against the phpMyFAQ database. A working proof-of-concept methodology is published in the GHSA advisory. |
Get an e-mail when this CVE is exploited, patched or re-scored. Free account.
Alert meAnalysisAIv3 – May 28, 2026
SQL injection in phpMyFAQ prior to 4.1.2 allows attackers authenticating through Azure AD/Entra ID OAuth to execute arbitrary database queries by embedding SQL metacharacters in their identity provider display name or JWT claims. The CurrentUser::setTokenData() method interpolates OAuth token fields into an UPDATE statement via sprintf without calling the database escape routine, while sibling methods in the same file correctly escape input. Publicly available exploit code exists per VulnCheck and the GHSA advisory, though EPSS is low (0.03%, 9th percentile) and the issue is not in CISA KEV.
Earlier versions of this analysis (2)
SQL injection in phpMyFAQ versions prior to 4.1.2 allows attackers controlling Azure AD/Entra ID identity attributes to execute arbitrary database queries against the faquser table by smuggling SQL metacharacters through OAuth token claims (display name, preferred_username, JWT fields). Publicly available exploit code exists via the VulnCheck and GHSA advisories, though the EPSS score of 0.03% (9th percentile) and SSVC rating of non-automatable suggest limited mass-exploitation today. The bug is a developer oversight: CurrentUser::setTokenData omits the $db->escape() call that adjacent methods setAuthSource and setRememberMe correctly use.
SQL injection in phpMyFAQ 4.1.1 and earlier allows attackers with Azure AD accounts to execute arbitrary database queries through OAuth token claims. The CurrentUser::setTokenData() method fails to escape JWT token fields when building SQL UPDATE statements, enabling injection when display names or JWT claims contain SQL metacharacters like single quotes. The vulnerability requires user interaction (OAuth login) but no special privileges, making it exploitable by any user who can authenticate via Azure AD.
RemediationAI
Vendor-released patch: upgrade phpMyFAQ to 4.1.2 or later, which adds proper $db->escape() handling in CurrentUser::setTokenData() consistent with setAuthSource() and setRememberMe(); see https://github.com/thorsten/phpMyFAQ/security/advisories/GHSA-pm8c-3qq3-72w7 and the VulnCheck advisory at https://www.vulncheck.com/advisories/phpmyfaq-sql-injection-in-currentuser-settokendata-via-unescaped-oauth-token-fields for details. If patching cannot be performed immediately, disable the Azure AD / Entra ID OAuth login provider in the phpMyFAQ configuration to eliminate the reachable code path - this prevents single sign-on with Microsoft accounts and forces users to local authentication. As a tighter compensating control on the identity side, restrict the Entra ID app registration assignment to a trusted, vetted user group whose display names and custom claims you control and audit, accepting that this only narrows rather than removes the risk. As a final defensive layer, place the phpMyFAQ database account behind least-privilege grants (UPDATE on faquser only) and enable database query logging on the faquser table to detect anomalous statements while the patch is rolled out.
Affected VersionsENISA
Affected Packages
Source: OSV (Open Source Vulnerabilities)
Affects your stack
Affects 3 packages in composer, euvd
Checking this CVE against your own stacks and servers is part of the Basic plan and up.
Technical ContextAI · show details
phpMyFAQ is an open-source PHP-based FAQ management system (CPE cpe:2.3:a:thorsten:phpmyfaq) that supports Microsoft Azure AD / Entra ID OAuth single sign-on. The root cause is CWE-89 (Improper Neutralization of Special Elements used in an SQL Command). In phpmyfaq/src/phpMyFAQ/User/CurrentUser.php lines 515-534, the setTokenData() method builds a SQL UPDATE against the faquser table by interpolating refresh_token, access_token, code_verifier, and json_encode($token['jwt']) directly into single-quoted string literals via sprintf, omitting the $db->escape() call that sibling methods setAuthSource() and setRememberMe() correctly use. Crucially, json_encode() does not escape single quotes, so a JWT claim such as preferred_username='O'Malley' survives encoding and terminates the SQL string literal, allowing arbitrary SQL to be appended.
Know when Phpmyfaq gets its next vulnerability
- Watch products and get an email when something new is published
- Check this CVE against your own stack and servers
- Exploit and PoC references, threat intelligence from 22 sources
No credit card · 7-day full trial
Severity by source
CVSS:4.0/AV:N/AC:H/AT:P/PR:N/UI:P/VC:H/VI:H/VA:H/SC:N/SI:N/SA:N
Primary rating from Vendor (VulnCheck) · only source for this CVE.
CVSS VectorVendor: VulnCheck
Lifecycle Timeline
4DescriptionCVE.org
phpMyFAQ before 4.1.2 contains a sql injection vulnerability in CurrentUser::setTokenData that allows authenticated attackers to execute arbitrary SQL by injecting malicious OAuth token claims. Attackers with Azure AD accounts containing SQL metacharacters in display names or JWT claims can break out of string literals and execute arbitrary database queries.
Executive ViewAI
phpMyFAQ versions prior to 4.1.2 contain a SQL injection vulnerability in Azure AD/Entra ID OAuth integration that allows authenticated users to execute arbitrary database queries. Organizations deploying phpMyFAQ with federated identity authentication face direct database compromise risk. While no active exploitation is documented, publicly available proof-of-concept code exists, requiring immediate patching.
Apply vendor patch.
Threat Intelligence Overview
How this decision was reached
The engine reads each signal below and applies a fixed list of rules from top to bottom. The first rule that matches sets the recommended action – like a statement, every line is shown.
What every action level means
SSVC AssessmentENISA
Priority Score
Attack Technique
SQL injection exploits the way applications construct database queries by mixing user input directly into SQL statements.
Duplicate-email registration handling in phpMyFAQ 4.0.7 through 4.0.13 (and 4.0-nightly-2025-10-03 and earlier) lets una
Insufficient Session Expiration in GitHub repository thorsten/phpmyfaq prior to 3.2.2. Rated critical severity (CVSS 9.8
Authentication Bypass by Capture-replay in GitHub repository thorsten/phpmyfaq prior to 3.1.12. Rated critical severity
Weak Password Requirements in GitHub repository thorsten/phpmyfaq prior to 3.1.12. Rated critical severity (CVSS 9.8), t
Weak Password Requirements in GitHub repository thorsten/phpmyfaq prior to 3.1.8. Rated critical severity (CVSS 9.8), th
Unauthenticated SQL injection in phpMyFAQ before 4.1.2 allows remote attackers to extract credentials, admin tokens, and
In phpMyFAQ before 2.9.9, there is Cross-Site Request Forgery (CSRF) in admin/stat.ratings.php. Rated high severity (CVS
In phpMyFaq before 2.9.9, there is CSRF in admin/ajax.config.php. Rated high severity (CVSS 8.8), this vulnerability is
In phpMyFAQ before 2.9.9, there is Cross-Site Request Forgery (CSRF) for modifying a glossary. Rated high severity (CVSS
In phpMyFAQ before 2.9.9, there is Cross-Site Request Forgery (CSRF) in admin/stat.main.php. Rated high severity (CVSS 8
phpMyFAQ is an open source FAQ web application for PHP 8.1+ and MySQL, PostgreSQL and other databases. Rated high severi
phpMyFAQ is an open source FAQ web application for PHP 8.1+ and MySQL, PostgreSQL and other databases. Rated high severi
EUVD-2026-30594
GHSA-p9wc-4pjv-rg82
NVD
CVE.org
EPSS
Vulnrichment
VulDB
Exploit-DB