<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:content="http://purl.org/rss/1.0/modules/content/"><channel><title>PhpMyFAQ &lt;= 4.1.1 — CraftedSignal Threat Feed</title><link>https://feed.craftedsignal.io/products/phpmyfaq--4.1.1/</link><description>Trending threats, MITRE ATT&amp;CK coverage, and detection metadata — refreshed continuously.</description><generator>Hugo</generator><language>en</language><managingEditor>hello@craftedsignal.io</managingEditor><webMaster>hello@craftedsignal.io</webMaster><lastBuildDate>Wed, 06 May 2026 20:44:39 +0000</lastBuildDate><atom:link href="https://feed.craftedsignal.io/products/phpmyfaq--4.1.1/feed.xml" rel="self" type="application/rss+xml"/><item><title>phpMyFAQ SQL Injection via Unescaped OAuth Token</title><link>https://feed.craftedsignal.io/briefs/2024-01-phpmyfaq-sqli/</link><pubDate>Wed, 06 May 2026 20:44:39 +0000</pubDate><author>hello@craftedsignal.io</author><guid isPermaLink="true">https://feed.craftedsignal.io/briefs/2024-01-phpmyfaq-sqli/</guid><description>phpMyFAQ is vulnerable to SQL injection due to the `setTokenData` function failing to sanitize OAuth token fields from Azure AD JWT claims, potentially allowing attackers to execute arbitrary SQL commands via crafted Azure AD display names or custom claims.</description><content:encoded><![CDATA[<p>phpMyFAQ version 4.1.1 and earlier contains a SQL injection vulnerability within the <code>CurrentUser::setTokenData()</code> function. This function, responsible for updating user data with OAuth token information, fails to properly sanitize specific fields (<code>refresh_token</code>, <code>access_token</code>, <code>code_verifier</code>, and <code>jwt</code>) extracted from the Azure AD <code>id_token</code>. An attacker with a Microsoft Azure AD account whose display name or custom claim contains SQL metacharacters (e.g., a single quote) can inject arbitrary SQL queries into the phpMyFAQ database. The vulnerability exists because <code>setTokenData()</code> utilizes <code>sprintf</code> for constructing the SQL query without proper escaping, unlike other functions within the same file. Successful exploitation allows an attacker to read, modify, or delete sensitive FAQ data, extract user credentials, and potentially compromise the entire phpMyFAQ installation.</p>
<h2 id="attack-chain">Attack Chain</h2>
<ol>
<li>Attacker registers an Azure AD account and crafts a malicious display name or claim containing SQL injection payloads (e.g., <code>O'Brien</code> or <code>x',(SELECT SLEEP(5)))-- -</code>).</li>
<li>The attacker initiates the OAuth login flow on a phpMyFAQ instance with Azure AD authentication enabled.</li>
<li>The Azure AD authorization endpoint redirects back to the phpMyFAQ instance.</li>
<li>The phpMyFAQ instance requests an access token from Azure AD, receiving a JWT in response.</li>
<li>The JWT contains the attacker&rsquo;s crafted display name or claim.</li>
<li>phpMyFAQ&rsquo;s <code>setTokenData()</code> function receives the JWT and extracts the malicious claim without sanitization.</li>
<li>The unsanitized claim is injected into an SQL UPDATE statement, leading to arbitrary SQL execution.</li>
<li>The attacker can then read sensitive data, modify content, or extract password hashes.</li>
</ol>
<h2 id="impact">Impact</h2>
<p>Successful exploitation of this SQL injection vulnerability grants the attacker the ability to execute arbitrary SQL commands on the phpMyFAQ database. This can lead to a full compromise of the application, including unauthorized access to all FAQ data (including restricted entries), modification or deletion of content, and extraction of password hashes and session tokens of all users, including administrators. This can result in significant data breaches and reputational damage.</p>
<h2 id="recommendation">Recommendation</h2>
<ul>
<li>Deploy the Sigma rule <code>phpMyFAQ SQL Injection Attempt</code> to detect potential exploitation attempts by monitoring for suspicious SQL syntax within JWT claims (logsource: <code>webserver</code>, category: <code>webserver</code>).</li>
<li>Apply the recommended fix provided in the GHSA advisory, which involves escaping all interpolated values using <code>$this-&gt;configuration-&gt;getDb()-&gt;escape()</code> in the <code>setTokenData()</code> function to mitigate the SQL injection vulnerability (reference: GHSA-pm8c-3qq3-72w7).</li>
<li>Upgrade to a patched version of phpMyFAQ that addresses this vulnerability to prevent further exploitation (affected_products: <code>phpMyFAQ &lt;= 4.1.1</code>).</li>
</ul>
]]></content:encoded><category domain="severity">high</category><category domain="type">threat</category><category>sql-injection</category><category>oauth</category><category>phpmyfaq</category></item></channel></rss>