mysql - Html-Entity encoded empty HTML Tag -


can combination of characters, alone in form field, used xss or sql attack, if "html-entity encoded" right @ beginning of php code ?

<>

here simple program shows text value in text field when submit form :

<?php     foreach ($_post &$_http_field) {     $_http_field = htmlentities($_http_field,ent_quotes,'iso-8859-1');   }   foreach ($_get &$_http_field) {     $_http_field = htmlentities($_http_field,ent_quotes,'iso-8859-1');   }  ?>  <html><body>   <form action="/index2.php" name="abcd" method="post">     <input type="text" name="texte" value="<? echo $_post['texte'];?>">    <input type="submit" name="soumission" value="submit">   </form> </body></html> 

i'm sure not follow best coding practices in itself, code not seems risky if echo-ed variable in "value" field.

but when try "<>" in text field, web hosting firewall block request sending 403 error.

i'm not specifying document encoding here clarity reasons, in reality document made in iso-8859-1. matches htmlentities function.

<> may not work but

" onmouseover="alert(1) 

will succeed rendered as

<input type="text" name="texte" value="" onmouseover="alert(1)"> 

Comments

Popular posts from this blog

cakephp - simple blog with croogo -

How to group boxplot outliers in gnuplot -

bash - Performing variable substitution in a string -