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.

HTML Forum


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



Post a Project »

Find a Professional HTML Freelancer!

Find a Freelancer to help you with your HTML projects

FREE Outsourcing eBook!

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

Posts: 71
Name: Rafael Schimassek
Trades: 0
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
 
 
Register now for full access!
Old 05-01-2008, 01:01 PM Re: Are POST Forms trustworthy?
Mooofasa's Avatar
Defies a Status

Posts: 1,611
Name: Michael (mik) Land
Location: England
Trades: 0
Use form validation.
__________________

Please login or register to view this content. Registration is FREE
- Tumblog with thoughts, quotes, links, videos, images and my creations.

Please login or register to view this content. Registration is FREE
- The best free web browser.

Please login or register to view this content. Registration is FREE
- Firefox is now Firefail.
Mooofasa is offline
Reply With Quote
View Public Profile Visit Mooofasa's homepage!
 
Old 05-01-2008, 01:44 PM Re: Are POST Forms trustworthy?
InfinitySchima's Avatar
Skilled Talker

Posts: 71
Name: Rafael Schimassek
Trades: 0
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, 04:27 PM Re: Are POST Forms trustworthy?
Mooofasa's Avatar
Defies a Status

Posts: 1,611
Name: Michael (mik) Land
Location: England
Trades: 0
Every input should use validation to reduce risk of violation.
__________________

Please login or register to view this content. Registration is FREE
- Tumblog with thoughts, quotes, links, videos, images and my creations.

Please login or register to view this content. Registration is FREE
- The best free web browser.

Please login or register to view this content. Registration is FREE
- Firefox is now Firefail.
Mooofasa is offline
Reply With Quote
View Public Profile Visit Mooofasa's homepage!
 
Old 05-01-2008, 06:56 PM Re: Are POST Forms trustworthy?
vangogh's Avatar
Post Impressionist

Posts: 10,688
Name: Steven Bradley
Location: Boulder, Colorado
Trades: 0
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 |
Please login or register to view this content. Registration is FREE

l Tips On Marketing, SEO, Design, and Development |
Please login or register to view this content. Registration is FREE

l
Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE
vangogh is offline
Reply With Quote
View Public Profile Visit vangogh's homepage!
 
Old 05-01-2008, 09:38 PM Re: Are POST Forms trustworthy?
willcode4beer's Avatar
Super Moderator

Posts: 1,533
Name: Paul Davis
Location: San Francisco
Trades: 1
Quote:
Originally Posted by vangogh View Post
Make sure you validate it on the server side. Javascript validation isn't secure.
double plus good
__________________

Please login or register to view this content. Registration is FREE

willcode4beer is offline
Reply With Quote
View Public Profile
 
Old 05-02-2008, 03:48 AM Re: Are POST Forms trustworthy?
InfinitySchima's Avatar
Skilled Talker

Posts: 71
Name: Rafael Schimassek
Trades: 0
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, 09:39 AM Re: Are POST Forms trustworthy?
Plugin-Developer's Avatar
Weightlifting CS Student

Posts: 504
Name: Nick Ohrn
Trades: 0
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.
__________________

Please login or register to view this content. Registration is FREE
- Custom plugin development to fit your needs. Plugins available for WordPress and Drupal, among others.
Plugin-Developer is offline
Reply With Quote
View Public Profile Visit Plugin-Developer's homepage!
 
Reply     « Reply to Are POST Forms trustworthy?
 

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.27666 seconds with 12 queries