How to prevent xss in magento
<p>I am trying from last 5-8 hours not getting solution for xss prevent in magento,</p>

<p>I have already installed all latest patch in my magento.</p>

<p>I am using this script  in <strong>catalog search input box</strong></p>

<pre><code> "&gt;&lt;img src=x onerror=prompt(1);&gt;
</code></pre>

<p>and i am getting this output :- </p>

<p><strong>xss result</strong></p>

<p><a href="https://i.stack.imgur.com/Ctlua.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/Ctlua.png" alt="enter image description here"></a></p>

<p>I have also tried with some validation like htmlEscape , strip_tags but none of working for me.</p>

<p>Can someone please help me ?</p>