A Flash Developer Resource Site

Results 1 to 8 of 8

Thread: [RESOLVED] Protecting from Malicious Posts

  1. #1
    Domo Arigato! Ultima Designs's Avatar
    Join Date
    Nov 2003
    Location
    Missing in Action
    Posts
    512

    [RESOLVED] Protecting from Malicious Posts

    Hey guys,

    I mentioned in here one or two times that we are working on a big project at the moment. We are trying to think of security concerns, and one of them that we have come up with is this: we don't want people to be able to recreate our forms on another website and then post the data to our website. This way, we can hopefully prevent people from registering spam accounts, for example.

    Is there any way to prevent this from happening? Maybe some way to check the referring page, and if it isn't from our domain name but has data being posted, to redirect them to a failure page or something? The website is done with PHP.

  2. #2
    $_SERVER['HTTP_REFERER']

    The address of the page (if any) which referred the user agent to the current page. This is set by the user agent. Not all user agents will set this, and some provide the ability to modify HTTP_REFERER as a feature. In short, it cannot really be trusted.
    http://us3.php.net/manual/en/reserve...riables.server

  3. #3
    Domo Arigato! Ultima Designs's Avatar
    Join Date
    Nov 2003
    Location
    Missing in Action
    Posts
    512
    One other question - can you spoof the referring website (could you make it appear to be something it is not)?

  4. #4
    Quote Originally Posted by Ultima Designs
    One other question - can you spoof the referring website (could you make it appear to be something it is not)?
    yes.


    You could keep a session variable that's known only to your code. Still not perfect, but pretty OK.

  5. #5
    Domo Arigato! Ultima Designs's Avatar
    Join Date
    Nov 2003
    Location
    Missing in Action
    Posts
    512
    Not all user agents will set this, and some provide the ability to modify HTTP_REFERER as a feature.
    So, there's a chance that someone will have no setting for this, and as a result will not be premitted to access the website?

  6. #6
    Quote Originally Posted by Ultima Designs
    So, there's a chance that someone will have no setting for this, and as a result will not be premitted to access the website?
    If you require an HTTP_REFERER before accessing the web page, then they won't be able to access the web page. If you check that the HTTP_REFERER is your web page or empty, before accessing the web page, you should be better off.

  7. #7
    Domo Arigato! Ultima Designs's Avatar
    Join Date
    Nov 2003
    Location
    Missing in Action
    Posts
    512
    Haha, good call. That idea completely slipped my mind. That should take care of the issue, much thanks!

  8. #8
    Phantom Flasher... Markp.com's Avatar
    Join Date
    May 2000
    Posts
    16,034
    Moved to the correct forum.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  




Click Here to Expand Forum to Full Width

HTML5 Development Center