<?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 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>Tue, 02 Jan 2024 12:00:00 +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 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>