Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

PHP Forum


You are currently viewing our PHP Forum as a guest. Please register to participate.
Login



Freelance Jobs

Reply
Security Question - Form data from outside website
Old 05-11-2009, 03:46 PM Security Question - Form data from outside website
Extreme Talker

Posts: 177
Trades: 0
Say I just create a local html file with a form that submits to my actual website, using the correct input names and such. What exactly should be done to prevent my page from carrying out the action that wasn't requested in a page ON my website?

From the research I've done, I've found a few different solutions but am always informed that this isn't full proof.

One method was to create a session variable of an md5() in the form.

Another was to check the referrer, which can be spoofed from what I've read.

And one other way...an expensive, not going that road solution, would be SSL.

So I was hoping you kind folks could give me some insight on maybe a procedure I should go through to prevent this kind of manipulation.
kbfirebreather is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 05-12-2009, 03:19 PM Re: Security Question - Form data from outside website
anderswc's Avatar
Super Talker

Posts: 132
Name: Will Anderson
Location: Terre Haute, IN
Trades: 0
Using a combination of session variables and referrers is a good start, but as you said, these can be spoofed (the session variables are pretty hard though).

Ultimately, it's really hard to check whether the user is coming from your website or not.

The question becomes... Is it important? If the user is authenticated, and their form data is valid, does it matter whether the form they submitted is from your website? You should be doing input validation anyway, so I can't think of a situation where it makes a big difference.
__________________
Will Anderson

Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE
anderswc is offline
Reply With Quote
View Public Profile Visit anderswc's homepage!
 
Old 05-12-2009, 03:30 PM Re: Security Question - Form data from outside website
Extreme Talker

Posts: 177
Trades: 0
Ya I was thinking the same thing. I think what it comes down to is I have to verify this person and what they're doing is valid. Like say their editing agolf course they created. It should be them ( as far as I can tell) and it should be THEIR course, not some other courses (via an ID).

The other thing I was thinking about is select and options...since those really shouldn't be anything but what I make it, they could create the same form with different values...but that's where the validation comes in.

So all in all, validate ALL input, even if it seems like it shouldn't need validation (hidden text boxes, drop downs, radio buttons, etc).
kbfirebreather is offline
Reply With Quote
View Public Profile
 
Old 05-12-2009, 04:34 PM Re: Security Question - Form data from outside website
anderswc's Avatar
Super Talker

Posts: 132
Name: Will Anderson
Location: Terre Haute, IN
Trades: 0
Exactly. Never use user input when accessing a database without validating their input. This includes cookies and referrals as well by the way. And of course, always make sure you escape possible SQL injections.
__________________
Will Anderson

Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE
anderswc is offline
Reply With Quote
View Public Profile Visit anderswc's homepage!
 
Reply     « Reply to Security Question - Form data from outside website
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.15876 seconds with 12 queries