The vulnerability is a stored Cross-Site Scripting (XSS) attack in phpMyFAQ's search functionality. The root cause is a combination of improper input handling and insecure output rendering. An attacker with privileges to edit FAQs could inject a malicious payload encoded as HTML entities into a FAQ's question or answer. When a user performs a search, the phpMyFAQ\Controller\Api\SearchController.search method would fetch this content. It insecurely used html_entity_decode(strip_tags()), which allowed the encoded payload to bypass the tag stripper and be decoded back into executable HTML. This malicious data, prepared by functions like phpMyFAQ\Faq.renderFaqsByFaqIds and phpMyFAQ\Helper\SearchHelper.getSearchResult, was then passed to the search.twig template. The template rendered the content using the |raw filter, which disables Twig's auto-escaping, causing the malicious script to execute in the browser of anyone viewing the search results. A secondary issue existed in phpMyFAQ\Search.logSearchTerm, which logged unsanitized search terms. The patch addresses these issues by removing the dangerous html_entity_decode call, adding htmlentities encoding during data preparation, and sanitizing search terms before logging.