View Single Post
  #2 (permalink)  
Old 05-06-2008, 05:34 PM
Dubbya's Avatar
Dubbya Dubbya is offline
WebProWorld 1,000+ Club
 

Join Date: Nov 2006
Location: Steinbach, Manitoba, Canada
Posts: 1,260
Dubbya RepRank 3Dubbya RepRank 3
Default Re: SQL injection Attack

We sanitize data that's to be saved to the DB by disallowing or stripping illegal characters that only a hacker might use to inject code through string manipulation or form submissions.

Regular expressions (regEX) are perfect for this job. We use an include file with a VB Script function and call it prior to saving data. It's server side, so there's little chance of it failing but it's a little slow and frustrating for the user if you're bouncing data back and forth to the browser.

Of course, we generally have a JavaScript validation routine in place anyway, so that helps.

Additionally, your client might want to use another script, or get one written, that'll check the data that's already stored in the DB for signs of SQL injection or cross site scripting attacks.

Here's a great article that describes some of the data strings to look out for:
Detection of SQL Injection and Cross-site Scripting Attacks
__________________
Printer ink, inkjet & toner cartridges in Canada
"Price-wise printing supplies"
inkjetOasis.ca
Reply With Quote