HomeHome Product Discus... Product Discus...SmithCartSmithCartBAD BUG: Input sterilizationBAD BUG: Input sterilization
Previous
 
Next
New Post
12/9/2010 7:55 AM
 

Here's a BIG bug.

Type s'mores into the search box.

Error A critical error has occurred.
Incorrect syntax near 'mores'.

.... this means that input is NOT sterilized, offering an opportunity for SQL injection. I can't even describe what a huge security hole this is.

To fix this, input MUST be sterilized before bouncing to SQL.

To do so (at least in VisualBasic, I'm sure there's something similar in C#) you would do this:

Userinput = REPLACE(Userinput,"'","''") (replace a single ' with two 's)

Userinput = REPLACE(Userinput,CHR(34),"""") (Replace a single " with a double "")

.... this needs to be fixed right away. :(

Additionally, any other text input boxes SHOULD be sterilized. The easiest way to do this is with a function; something like:

UserInput = Sterilize(UserInput)

FUNCTION Sterilize(UserInput)

UserInput = Replace(UserInput,"'","''")

UserInput = Replace(UserInput,CHR(34),"""")

Sterilze = UserInput

End Function

.... this method prevents SQL injection and SQL Errors.

 
New Post
12/9/2010 10:24 AM
 

I have sent this into programming and will postback with a hotfix. Thanks for reporting it!

-Scott


Scott Kelly
Project Manager
DotNetNuke Consulting, DotNetNuke Store and DNN Ecommerce
 
New Post
12/13/2010 7:14 AM
 

Greg, This is fixed in the just released 3.96 version.

 
New Post
12/14/2010 7:08 AM
 

Awesome.

I have seen people do SQL injection that would make you shudder..... take a simple input form, something benign.... and access the entire database, every record. <<Shudder>>

I've even demonstrated it (at my last job) to the IT department to show THEM the importance of sterilization.

 
New Post
12/14/2010 6:26 PM
 

Good job, Anthony. I saw your SP. Nice work. :)

 
Previous
 
Next
HomeHome Product Discus... Product Discus...SmithCartSmithCartBAD BUG: Input sterilizationBAD BUG: Input sterilization