Link Details

Link 89227 thumbnail
User 1 avatar

By rick
via roshanbh.com.np
Published: Jun 23 2008 / 13:02

HTTP POST request from outside domain is one of the way of attacking your website. A intruder can use JavaScript in other domain or localhost to send the repetitive POST request to your web page containing PHP script. We must prevent this kind of cross domain form posting which might be harmful of our website.
  • 8
  • 7
  • 975
  • 299

Comments

Add your comment
User 273110 avatar

isnoop replied ago:

0 votes Vote down Vote up Reply

I like the basic premise, but this article overlooks some major issues with the HTTP_REFERRER approach: Users with referrers turned off will fail the test as described. Also HTTP_REFERRER is set by the user so an attack could easily be launched with a faked referrer that tricked your script. For example, many Wordpress comment spam attacks include faked referrers.

User 201312 avatar

jgmurray replied ago:

0 votes Vote down Vote up Reply

Bad advice, from a 'PHP Professional'. How many people are going to use this an end up getting all the spam they can handle on their (or worse, their client's) website.

User 297562 avatar

Sven Arild Helleland replied ago:

0 votes Vote down Vote up Reply

As mentioned, NEVER trust or rely on variables that can be altered by the user.

Not only are an approach like this going to alienate valid users (not all browsers populate the HTTP_REFERRER, and you can also turn it off), but it will not stopp users with bad intentions anyway as its the easiest thing to fake.

Add your comment


Html tags not supported. Reply is editable for 5 minutes. Use [code lang="java|ruby|sql|css|xml"][/code] to post code snippets.