Neohapsis is currently accepting applications for employment. For more information, please visit our website www.neohapsis.com or email firstname.lastname@example.org
Re: [Re: AppSec FAQ at OWASP]
From: Rohyt Belani (rohytbelanihotmail.com)
Date: Fri Jan 30 2004 - 09:43:28 CST
>> An easier solution to prevent XSS attacks might be to HTML encode the "<"
>and ">" characters as < and >. So even if they are accepted as input
>from the user, it would not result in the execution of a script like
>It's not correct. With this code :
><a href="<%= escapeHTML(url)%>/doc.html">Document</a>
>The hacker can inject in the variable url the value :
>and execute a script without <, > or &!
The solution I proposed for HTML encoding characters like < and > will still be effective in the case you mentioned.
This is because the underlying principle for good input validation routines is to first decode the encoded URL and then perform input validation. By doing so all encoding attacks like the one you mentioned can be prevented from executing successfully.