3
When preventing an XSS attack (Alert(123;)) using Html.Encode the on-screen code is as follows:
<select class="combobox" id="xssSelect" name="cmbXss">
<option selected="selected" value="1"><script>alert(123;)</script></option>
<option value="2">Opcao2</option>
<option value="3">Opcao3</option>
</select>
If you run on IE this combo works perfectly, but in Chrome it crashes and I can’t change the options. Give to do this test by own stackoverflow running code snippet between IE and Chrome.
Note: I am using Chrome in version 43.0.2357.81 m
Note 2: Stackoverflow itself is preventing XSS attack when I enter the value... then follow the value I am preventing in my image code
You can always use
⁄
in time of/
... http://jsfiddle.net/zdr06mkf/– Sergio
It is intended to use
alert(123;)
instead ofalert(123);
? If so, why?– Victor Stafusa
@Victorstafusa that doesn’t matter, the behavior is the same. The value is like this because it was an intentional test of XSS in my project.
– Arthur Menezes