<?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 — CraftedSignal Threat Feed</title><link>https://feed.craftedsignal.io/vendors/phpmyfaq/</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/vendors/phpmyfaq/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><item><title>phpMyFAQ Unauthenticated SQL Injection via User-Agent Header</title><link>https://feed.craftedsignal.io/briefs/2024-01-phpmyfaq-sql-injection/</link><pubDate>Tue, 09 Jan 2024 12:00:00 +0000</pubDate><author>hello@craftedsignal.io</author><guid isPermaLink="true">https://feed.craftedsignal.io/briefs/2024-01-phpmyfaq-sql-injection/</guid><description>Unauthenticated SQL injection vulnerability exists in phpMyFAQ &lt;= 4.1.1 due to improper handling of the User-Agent header in BuiltinCaptcha, allowing attackers to inject malicious SQL payloads and potentially gain complete control of the datastore.</description><content:encoded><![CDATA[<p>phpMyFAQ versions 4.1.1 and earlier are vulnerable to unauthenticated SQL injection in the BuiltinCaptcha component. The vulnerability stems from the improper handling of the User-Agent header and client IP address in the <code>garbageCollector()</code> and <code>saveCaptcha()</code> methods within <code>phpmyfaq/src/phpMyFAQ/Captcha/BuiltinCaptcha.php</code>. These methods fail to sanitize user-supplied data before incorporating it into SQL queries, specifically a DELETE and an INSERT statement, respectively. An attacker can inject arbitrary SQL commands by crafting a malicious User-Agent header and sending a GET request to the <code>/api/captcha</code> endpoint. The vulnerability was verified against phpMyFAQ 4.2.0-alpha, demonstrating a significant time difference in response times between clean and injected requests. This issue allows attackers to potentially read sensitive data, manipulate database records, and gain complete control of the phpMyFAQ datastore.</p>
<h2 id="attack-chain">Attack Chain</h2>
<ol>
<li>An unauthenticated attacker crafts a malicious SQL payload.</li>
<li>The attacker injects the payload into the User-Agent header of an HTTP GET request.</li>
<li>The attacker sends the crafted GET request to the <code>/api/captcha</code> endpoint of the phpMyFAQ instance.</li>
<li>The <code>CaptchaController.php</code> processes the request, instantiating the <code>BuiltinCaptcha</code> class.</li>
<li>The <code>BuiltinCaptcha</code> class retrieves the unsanitized User-Agent header.</li>
<li>The <code>getCaptchaImage()</code> method calls both the <code>saveCaptcha()</code> and <code>garbageCollector()</code> methods.</li>
<li>These methods execute the SQL queries with the injected payload, due to the lack of sanitization.</li>
<li>The attacker leverages time-based blind SQL injection to extract sensitive data or manipulate database records.</li>
</ol>
<h2 id="impact">Impact</h2>
<p>Successful exploitation of this vulnerability allows an attacker to perform unauthenticated remote SQL injection against the phpMyFAQ database. In a default installation, this includes the ability to read user credential hashes, the admin token, SMTP credentials, and the content of FAQ entries, including those marked as private or restricted. Attackers can also tamper with or wipe arbitrary rows within the database due to the ability to modify DELETE queries. The absence of authentication, CSRF protection, or rate limiting on the <code>/api/captcha</code> endpoint makes exploitation straightforward.</p>
<h2 id="recommendation">Recommendation</h2>
<ul>
<li>Apply the recommended fix provided in the advisory by implementing input sanitization using <code>Database::escape()</code> before interpolating values into SQL queries. Specifically, modify <code>phpmyfaq/src/phpMyFAQ/Captcha/BuiltinCaptcha.php:298-325</code> and <code>phpmyfaq/src/phpMyFAQ/Captcha/BuiltinCaptcha.php:330</code> as described in the advisory.</li>
<li>Audit the entire codebase for instances of <code>sprintf</code> used in conjunction with SQL queries, as suggested by the advisory, to identify and remediate any other potential SQL injection vulnerabilities.</li>
<li>Deploy the provided Sigma rule &ldquo;phpMyFAQ Captcha API SQL Injection Attempt&rdquo; to detect attempts to exploit this vulnerability by monitoring for suspicious User-Agent headers in requests to <code>/api/captcha</code>.</li>
<li>Upgrade to a patched version of phpMyFAQ that addresses this vulnerability, if available.</li>
</ul>
]]></content:encoded><category domain="severity">critical</category><category domain="type">advisory</category><category>sql-injection</category><category>unauthenticated</category><category>web-application</category></item><item><title>phpMyFAQ Unauthenticated FAQ Permission Bypass via Solution ID Enumeration</title><link>https://feed.craftedsignal.io/briefs/2024-01-phpmyfaq-unauth-bypass/</link><pubDate>Wed, 03 Jan 2024 12:00:00 +0000</pubDate><author>hello@craftedsignal.io</author><guid isPermaLink="true">https://feed.craftedsignal.io/briefs/2024-01-phpmyfaq-unauth-bypass/</guid><description>phpMyFAQ version 4.1.1 and earlier is vulnerable to an unauthenticated FAQ permission bypass, allowing attackers to enumerate solution IDs and discover restricted FAQ titles due to missing permission filters in key functions.</description><content:encoded><![CDATA[<p>phpMyFAQ version 4.1.1 and earlier contains a vulnerability that allows unauthenticated users to bypass intended access restrictions on FAQ entries. The vulnerability stems from the <code>/solution_id_{id}.html</code> route, which leverages the <code>getIdFromSolutionId()</code> function lacking proper permission checks. Additionally, the <code>getFaqBySolutionId()</code> function incorporates an explicit fallback mechanism that also bypasses permission filters. By sequentially querying solution IDs, an attacker can discover the existence and titles of FAQs intended for specific user groups or administrators. This affects deployments hosting sensitive internal knowledge alongside public content, impacting the confidentiality of restricted information. The vulnerability was reported on May 6, 2026.</p>
<h2 id="attack-chain">Attack Chain</h2>
<ol>
<li>An unauthenticated attacker sends a GET request to <code>/solution_id_{id}.html</code>, where <code>{id}</code> is a sequentially incremented integer.</li>
<li>The phpMyFAQ server receives the request and calls <code>Faq::getIdFromSolutionId()</code> to retrieve FAQ data.</li>
<li><code>getIdFromSolutionId()</code> executes an SQL query that joins <code>faqdata</code> and <code>faqcategoryrelations</code> based on <code>solution_id</code> without applying any permission filters.</li>
<li>The server constructs a redirect URL using the retrieved data, including the FAQ&rsquo;s category ID, record ID, language, and a slugified title derived from the FAQ&rsquo;s question.</li>
<li>The server responds with a 301 Moved Permanently redirect to the generated URL, exposing the FAQ&rsquo;s title in the <code>Location</code> header.</li>
<li>The attacker records the 301 responses, extracting the FAQ&rsquo;s category, ID, language, and title from the <code>Location</code> header.</li>
<li>The attacker repeats steps 1-6, enumerating solution IDs to discover all FAQ entries, including those with restricted access.</li>
<li>The attacker gains knowledge of restricted FAQ titles, compromising confidentiality where titles contain sensitive information about the FAQ&rsquo;s content.</li>
</ol>
<h2 id="impact">Impact</h2>
<p>Successful exploitation allows any unauthenticated visitor to enumerate all FAQ entries on the phpMyFAQ instance, including those intended for specific groups or users. The attacker can read the title of every restricted FAQ. For deployments that host internal-only content alongside public content (e.g., staff knowledge bases, internal SOPs, confidential customer notes), this leads to a loss of confidentiality. The slugified titles, often encoding the subject directly (e.g., <code>q3-layoff-plan</code>), expose sensitive information.</p>
<h2 id="recommendation">Recommendation</h2>
<ul>
<li>Apply the recommended fix by adding a permission filter to <code>getIdFromSolutionId()</code> using <code>QueryHelper::queryPermission()</code> (see code snippet in the original advisory) to prevent unauthenticated access.</li>
<li>Remove the unconditional fallback in <code>getFaqBySolutionId()</code> at <code>Faq.php:1256-1265</code> to ensure permission checks are enforced.</li>
<li>Deploy the Sigma rule &ldquo;phpMyFAQ Unauthenticated Solution ID Enumeration&rdquo; to detect attackers enumerating <code>/solution_id_{id}.html</code> to discover restricted FAQ titles.</li>
<li>Monitor web server logs (category: webserver, product: linux) for HTTP 301 responses originating from requests to <code>/solution_id_{id}.html</code> as an indicator of potential exploitation.</li>
</ul>
]]></content:encoded><category domain="severity">medium</category><category domain="type">advisory</category><category>phpMyFAQ</category><category>unauthenticated access</category><category>information disclosure</category><category>web server</category></item><item><title>phpMyFAQ Unauthenticated 2FA Brute-Force Vulnerability</title><link>https://feed.craftedsignal.io/briefs/2024-01-phpmyfaq-2fa-bypass/</link><pubDate>Wed, 03 Jan 2024 12:00:00 +0000</pubDate><author>hello@craftedsignal.io</author><guid isPermaLink="true">https://feed.craftedsignal.io/briefs/2024-01-phpmyfaq-2fa-bypass/</guid><description>phpMyFAQ is vulnerable to an unauthenticated 2FA brute-force attack via the `/admin/check` endpoint, allowing attackers to bypass two-factor authentication and gain administrative access.</description><content:encoded><![CDATA[<p>phpMyFAQ versions 4.1.1 and earlier are susceptible to an unauthenticated two-factor authentication (2FA) bypass vulnerability. The vulnerability exists in the <code>/admin/check</code> endpoint, which is intended for validating TOTP codes. Due to the <code>SkipsAuthenticationCheck</code> implementation, this endpoint can be accessed without prior password authentication. An attacker can send POST requests with arbitrary <code>user-id</code> and <code>token</code> values, attempting to brute-force the 6-digit TOTP code. The absence of rate limiting allows an attacker to exhaust the keyspace relatively quickly. Successful exploitation grants a fully authenticated administrative session, enabling complete control over the application. This poses a significant risk to the confidentiality, integrity, and availability of the phpMyFAQ instance and its data.</p>
<h2 id="attack-chain">Attack Chain</h2>
<ol>
<li>Attacker identifies a valid <code>user-id</code>, often starting with common values like 1 for the admin user.</li>
<li>Attacker sends a POST request to <code>/admin/check</code> with a guessed 6-digit TOTP code and the target <code>user-id</code>.</li>
<li>The <code>/admin/check</code> endpoint processes the request without verifying prior password authentication due to the <code>SkipsAuthenticationCheck</code> interface.</li>
<li>The application validates the provided TOTP code against the user ID.</li>
<li>If the TOTP is incorrect, the server redirects to <code>/admin/token?user-id=&lt;user_id&gt;</code>.</li>
<li>The attacker iterates through possible TOTP codes (000000-999999) in a loop.</li>
<li>Upon successful TOTP validation, <code>twoFactorSuccess()</code> is called, creating an authenticated admin session.</li>
<li>The server redirects to <code>./</code>, granting the attacker full administrative access to phpMyFAQ. The attacker can now perform actions like user management, data exfiltration, and configuration changes.</li>
</ol>
<h2 id="impact">Impact</h2>
<p>Successful exploitation allows an attacker to bypass 2FA for any user account, including administrators, without knowing the user&rsquo;s password. This results in full administrative control over the phpMyFAQ instance, potentially leading to unauthorized data access, modification, or deletion. The attacker can manage users, modify FAQ content, change configurations, and access backup/export functions containing all data. Given the ease of exploitation due to the lack of rate limiting, a wide range of phpMyFAQ instances are at risk.</p>
<h2 id="recommendation">Recommendation</h2>
<ul>
<li>Deploy the Sigma rule &ldquo;phpMyFAQ Unauthenticated 2FA Brute-Force Attempt&rdquo; to your SIEM to detect attempts to exploit this vulnerability by monitoring POST requests to <code>/admin/check</code> (logsource: webserver).</li>
<li>Apply a rate limit or account lockout policy on the <code>/admin/check</code> endpoint to prevent brute-force attacks.</li>
<li>Implement session binding in the <code>check()</code> action to ensure that TOTP validation only occurs after successful password authentication, as described in the Recommended Fix section of the overview.</li>
<li>Upgrade to a patched version of phpMyFAQ that addresses this vulnerability, if available.</li>
</ul>
]]></content:encoded><category domain="severity">critical</category><category domain="type">advisory</category><category>phpMyFAQ</category><category>2FA Bypass</category><category>Brute-Force</category><category>Authentication</category></item><item><title>phpMyFAQ Stored XSS Vulnerability in Comment Rendering</title><link>https://feed.craftedsignal.io/briefs/2024-01-02-phpmyfaq-xss/</link><pubDate>Tue, 02 Jan 2024 12:00:00 +0000</pubDate><author>hello@craftedsignal.io</author><guid isPermaLink="true">https://feed.craftedsignal.io/briefs/2024-01-02-phpmyfaq-xss/</guid><description>A stored XSS vulnerability in phpMyFAQ version 4.1.1 allows an authenticated user to inject JavaScript code into comments, leading to session cookie theft and potential admin account takeover when other users view the affected FAQ or News page.</description><content:encoded><![CDATA[<p>phpMyFAQ version 4.1.1 is vulnerable to a stored Cross-Site Scripting (XSS) vulnerability due to improper sanitization of URLs within user comments. An attacker with a registered user account can inject malicious JavaScript code into a comment. This code is then executed when other users, including administrators, view the FAQ or news page containing the comment. The vulnerability stems from the <code>Utils::parseUrl()</code> function, which converts URLs in comments to clickable links without proper HTML escaping, allowing for the injection of arbitrary HTML attributes. This can lead to session cookie theft and full administrative account takeover.</p>
<h2 id="attack-chain">Attack Chain</h2>
<ol>
<li>An attacker registers a user account on the phpMyFAQ instance.</li>
<li>The attacker identifies a FAQ entry or News page where comments are enabled (<code>main.enableCommentEditor = true</code>).</li>
<li>The attacker crafts a malicious URL containing JavaScript code, such as <code>https://www.evil.com/&quot;onmouseover=&quot;alert(document.cookie)</code>.</li>
<li>The attacker submits the malicious URL as part of a comment on the targeted FAQ entry or News page.</li>
<li>The <code>Utils::parseUrl()</code> function processes the comment, converting the URL into an HTML <code>&lt;a&gt;</code> tag without proper sanitization.</li>
<li>The crafted URL, including the injected JavaScript, is stored in the phpMyFAQ database.</li>
<li>When another user, including an administrator, views the FAQ entry or News page, the malicious JavaScript is executed in their browser.</li>
<li>The attacker steals the user&rsquo;s session cookie, potentially leading to account takeover, especially if the victim is an administrator.</li>
</ol>
<h2 id="impact">Impact</h2>
<p>Successful exploitation of this stored XSS vulnerability allows an attacker to inject arbitrary JavaScript code into phpMyFAQ pages. This can lead to session cookie theft, potentially resulting in the takeover of user accounts, including administrative accounts. Given the lack of Content-Security-Policy headers, the impact is magnified. This vulnerability affects all visitors to the page with the malicious comment, and the injected code persists until the comment is manually removed.</p>
<h2 id="recommendation">Recommendation</h2>
<ul>
<li>Upgrade to a patched version of phpMyFAQ that addresses the XSS vulnerability.</li>
<li>Apply HTML escaping to user-supplied URLs when rendering comments to prevent arbitrary HTML injection.</li>
<li>Implement a Content Security Policy (CSP) to restrict the execution of inline JavaScript.</li>
<li>Deploy the Sigma rule <code>Detect phpMyFAQ XSS Payload in Comments</code> to identify potential exploitation attempts (see below).</li>
<li>Monitor web server logs for requests containing the XSS payload <code>https://www.evil.com/&quot;onmouseover=&quot;alert(document.cookie)</code> (see IOCs).</li>
</ul>
]]></content:encoded><category domain="severity">high</category><category domain="type">advisory</category><category>xss</category><category>phpmyfaq</category><category>stored-xss</category></item></channel></rss>