php - How to stop malicious automatic iFrame Form Input from other site? -


so there's guy putting code on site:

<iframe name="frame" src="" frameborder="0"  width="1" height="1" allowfullscreen style="width:1;height:1;"></iframe> <form name="form" method="post" action="http://mysite.com/vote.php" target="frame">   <input type="hidden" name="vote" value="1" />   <input type="hidden" name="id" value="1337" /> </form> <script type="text/javascript">   document.forms.form.submit(); </script> 

with little piece of code he's tricking users voting post (1337) in favor.

how can stop this? ideas?

i've tried following (.htaccess) doesn't stop it:

# disable iframe header set x-frame-options deny header append x-frame-options sameorigin 

i'm assuming 2 things here:

  1. you've got mod_headers installed , enabled;

  2. you've placed header entries inside of <ifmodule mod_headers.c> (or variant thereof).


whether assumptions correct or not, let's troubleshoot issue:

  1. make sure actual header being sent browser - don't state anywhere in question you've tested this;

  2. try additional header: header set x-xss-protection "1; mode=block";

  3. remove <ifmodule ...> section, see if apache fails (or gives warning) informing module isn't loaded;

  4. you do not want use header append ... since append desired value (to possibly existing entry), , knows how browsers interpret that;

  5. maybe try this:

    header unset x-frame-options deny header set x-frame-options deny 

Comments

Popular posts from this blog

linux - xterm copying to CLIPBOARD using copy-selection causes automatic updating of CLIPBOARD upon mouse selection -

c++ - qgraphicsview horizontal scrolling always has a vertical delta -