Affiliate Marketing
Forum Search


Reply
 
LinkBack Thread Tools Display Modes

  #1 (permalink)  
Old 20-04-07
accelerator's Avatar
Online shopping rocks!
 
Join Date: Nov 2004
Location: England
Posts: 1,316
Thanks: 8
Thanked 29 Times in 26 Posts
accelerator is an unknown quantity at this point
  Online Form Security - What Characters Shall I Ban

Hi All

I'm currently working on a vb.net script that allows user input into my database via an online form. I am writing the form validation code, and I just thought I'd ask which characters people think it's wise to ban. I only want simple text to be allowed, so far I've got:

< > *

What else do people think?

Cheers

Accelerator
__________________
WebRef.eu - Web Development Resources for the Online Entrepreneur
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Sponsored Links
  #2 (permalink)  
Old 21-04-07
tbp tbp is offline
Registered User
 
Join Date: Dec 2006
Posts: 1,999
Thanks: 0
Thanked 18 Times in 18 Posts
tbp is an unknown quantity at this point
  Re: Online Form Security - What Characters Shall I Ban

' ; are the usual ones to block, or at least escape them, as they can be used for SQL injection attacks!
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)  
Old 23-04-07
Registered User
 
Join Date: Oct 2006
Location: Edinburgh, UK
Posts: 22
Thanks: 0
Thanked 0 Times in 0 Posts
John@PP is an unknown quantity at this point
  Re: Online Form Security - What Characters Shall I Ban

' , " $ ; < >

That said I would just escape them like tbp said
__________________
John@PP
Screen Burn Removal - PixelProtector
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #4 (permalink)  
Old 23-04-07
Registered User
 
Join Date: Sep 2003
Posts: 63
Thanks: 0
Thanked 0 Times in 0 Posts
monkeyboy is an unknown quantity at this point
  Re: Online Form Security - What Characters Shall I Ban

Ideally you should be using parameterised SQL in a stored proc rather than building the SQL statement on the fly. This is especially true for SQL Server.

If you have to build up your SQL I would suggest looking out for SQL comment markers such as two dashes --
__________________
Prezzybox.com home of the gift wizard
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Sponsored Links
  #5 (permalink)  
Old 23-04-07
Registered User
 
Join Date: Dec 2005
Posts: 140
Thanks: 0
Thanked 0 Times in 0 Posts
ceetee is an unknown quantity at this point
  Re: Online Form Security - What Characters Shall I Ban

Are you sure it's not easier to define the only allowable characters?

I.e for username/passwords - alphanumerical characters.

// non alphanumerical characters
$regPattern= "[^a-zA-Z0-9]";

and in the condition

!ereg($regPattern,$_POST['password'])
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

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 Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
UK Online Now Available on buy.at! Steven Lynch buy.at 0 19-03-07 05:00 PM
Form text area help - displaying UTF-8 characters Barry Widgets, Coding, AJAX, PHP - Technology & Affiliate Marketing 1 24-02-06 01:17 PM
DGM Online Contact form speeddate DGM Affiliates 1 22-04-05 05:26 PM


Affiliate Marketing RSS Feeds - Contact Us - Affiliate Marketing - Archive - Privacy Statement - Top

Content Relevant URLs by vBSEO 3.2.0 RC7