Attribute-based Cross Site Scripting (XSS): When Encoding Double Quote " is Not Enough
Analysis: Attribute Based XSS It works when an attacker injects an XSS payloads at the following point ($__$): <input type="text" name="search" value=" $__$ " /> Typical payload is "><script>alert('XSS')</script> which results in: <input type="text" name="search" value=" "><script>alert('XSS')</script> " /> Armed with this information, security-aware programmers have begun to encode the double quote character ( " ) as " or %22 . This results in: <input type="text" name="search" value=" %22 ><script>alert('XSS')</script> " /> And XSS fails. However, they neglect to encode the single quote character ( ' ). For the above example, whether single quote is encoded or not, XSS will not be triggered. See the follow example . <input type="text" name=...