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:
you've got mod_headers installed , enabled;
you've placed
header
entries inside of<ifmodule mod_headers.c>
(or variant thereof).
whether assumptions correct or not, let's troubleshoot issue:
make sure actual header being sent browser - don't state anywhere in question you've tested this;
try additional header:
header set x-xss-protection "1; mode=block"
;remove
<ifmodule ...>
section, see if apache fails (or gives warning) informing module isn't loaded;you do not want use
header append ...
since append desired value (to possibly existing entry), , knows how browsers interpret that;maybe try this:
header unset x-frame-options deny header set x-frame-options deny
Comments
Post a Comment