Reply
Are POST Forms trustworthy?
Old 05-01-2008, 11:56 AM Are POST Forms trustworthy?
InfinitySchima's Avatar
Skilled Talker

Posts: 69
Name: Rafael Schimassek
Hi there,
I'm currently working on an Online Browser Game which uses many for forms.
I got a question if I can trust in certain form values as some could use certain methods to hack the game.

A simple example:
I got a Select InputBox (<select>...</select>) with 3 options: '1', '2' and '3'.
Can I be sure that the values will ALWAYS be either '1', '2' or '3'; or can it happen that someone finds a way to input '4' in there?

Additionally, is it possible for the user to change the value of an Hidden InputBox (<input type="hidden" />) ?

My doubt is more about the InputBoxes with predefined values, for TextBoxes I already use validation methods.

Thanks in advance,
Schimassek...

PS: I also heard that there is a Security Mechanism for a site only to accept forms from its own site. Is that correct and must I enable it before on my server?
InfinitySchima is offline
Reply With Quote
View Public Profile
 
When You Register, These Ads Go Away!
     
Old 05-01-2008, 12:01 PM Re: Are POST Forms trustworthy?
Mooofasa's Avatar
Defies a Status

Posts: 1,612
Name: Michael (mik) Land
Location: England
Use form validation.
__________________
Tumblings.co.uk - Tumblog with thoughts, quotes, links, videos, images and my creations.
Opera Browser - The best free web browser.
Opera Dev Tools - Firefox is now Firefail.
Mooofasa is offline
Reply With Quote
View Public Profile Visit Mooofasa's homepage!
 
Old 05-01-2008, 12:44 PM Re: Are POST Forms trustworthy?
InfinitySchima's Avatar
Skilled Talker

Posts: 69
Name: Rafael Schimassek
So you mean that additionally to Text Boxes, Text Areas, Password Boxes and File Boxes I should also validate Selection Lists, Check Boxes, Hidden Values and Radio Options?

Schimassek...
InfinitySchima is offline
Reply With Quote
View Public Profile
 
Old 05-01-2008, 03:27 PM Re: Are POST Forms trustworthy?
Mooofasa's Avatar
Defies a Status

Posts: 1,612
Name: Michael (mik) Land
Location: England
Every input should use validation to reduce risk of violation.
__________________
Tumblings.co.uk - Tumblog with thoughts, quotes, links, videos, images and my creations.
Opera Browser - The best free web browser.
Opera Dev Tools - Firefox is now Firefail.
Mooofasa is offline
Reply With Quote
View Public Profile Visit Mooofasa's homepage!
 
Old 05-01-2008, 05:56 PM Re: Are POST Forms trustworthy?
vangogh's Avatar
Post Impressionist

Posts: 8,441
Name: Steven Bradley
Location: Boulder, Colorado
You need to validate everything. Someone could copy the source code of your form, change it, and run it from their computer. One of the most basic rules of security is to never trust user input.

Make sure you validate it on the server side. Javascript validation isn't secure. You can use Javascript validation to make things easier on the user, but you have to validate for security on the server.

I think there are a few threads here with more details on validation, but you should be able to find plenty of info searching. Search for 'form validation' and add the language you want to use and you should get a lot of results. Most of your work will go into validating the first form and after that you'll be able to copy your code with some modification to your other forms.
__________________
l Search Engine Friendly Web Design | Van SEO Design
l Tips On Marketing, SEO, Design, and Development | TheVanBlog
l Custom WordPress Themes
vangogh is offline
Reply With Quote
View Public Profile Visit vangogh's homepage!
 
Old 05-01-2008, 08:38 PM Re: Are POST Forms trustworthy?
willcode4beer's Avatar
Webmaster Talker

Posts: 630
Name: Paul Davis
Location: San Francisco
Quote:
Originally Posted by vangogh View Post
Make sure you validate it on the server side. Javascript validation isn't secure.
double plus good
__________________
Paul Davis
willCode4Beer.com (coding for all the right reasons)
willcode4beer is offline
Reply With Quote
View Public Profile
 
Old 05-02-2008, 02:48 AM Re: Are POST Forms trustworthy?
InfinitySchima's Avatar
Skilled Talker

Posts: 69
Name: Rafael Schimassek
Thanks on that, now I'm clear about this subject.
I guess I'm going to have a big hack testing time....
InfinitySchima is offline
Reply With Quote
View Public Profile
 
Old 05-02-2008, 08:39 AM Re: Are POST Forms trustworthy?
nickohrn's Avatar
Weightlifting CS Student

Posts: 505
Name: Nick Ohrn
I'd just like to reiterate the sentiments already expressed here. If you are receiving any data to your web site or web service in any format, be it posted forms, SOAP messages, XML messages, or anything else, you need to validate it. Not validating your data is the quickest way to getting your site killed by some script kiddie with too much time and a vindictive streak.
__________________
Plugin-Developer.com - Custom plugin development to fit your needs. Plugins available for WordPress and Drupal, among others.
nickohrn is offline
Reply With Quote
View Public Profile Visit nickohrn's homepage!
 
Reply     « Reply to Are POST Forms trustworthy?
 

Thread Tools

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

vB 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.14366 seconds with 13 queries