Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

SQL Injection with RS.AddNew 1

Status
Not open for further replies.

Mugs321

Programmer
Jan 31, 2007
49
0
0
CA
Hey all,
Is it necessary to run an SQL Injection Prevention routine when adding data to the DB using the RS.AddNew/Update method? I've noticed that even if you write something like:
Code:
'; drop table xxx; --
... the text is added, as is, right into the DB.

I just wanna make totally sure that it's safe not to check for injection techniques.

thx.
 
If you need to prove the security to someone, and assuming you are using MS SQL Server, you could use the SQL Profiler to start a Trace and run your ASP with the injection values.

The trace will allow you to see exactly what goes to the database when your code runs the AddNew.

See the SQL Server Books Online help file for details.
 
I ran it through SQL Profiler and the following happened:

-Single quotes were escaped
-All other data was entered as was (ie. -- and ; had not effect)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top