views:

494

answers:

2

A security review was done against one of our ASP.net applications and returned in the test results was a SQL Injection Exposures considered to be a high risk item.

The test that was performed passed a SQL statement as the value of the __EVENTTARGET and the __EVENTARGUMENT. I am wondering since these 2 values are ASP.net auto-generated hidden fields used for the Auto-Postback feature of the framework and hold information specific to the controls initiating the postback, is there really the potential for SQL injection if you are never manually calling and or pulling values out of these parameters in your code behind?

+1  A: 

..if you are never manually calling and or pulling values out of these parameters in your code behind...

Assuming the above statement to be true, I don't see those parameters being susceptible to SQL Injection. Perhaps you ran an automated scan and this is a false alarm?

sri
The results were given to us by a 3rd party who were more than likely using an automated tool and we believe this to be a false positive. But to make sure we do our diligence I am posing this to the community to see if anyone out there has run into this issue specifically.
Schleichermann
I'd ask the third party to back up their claim.
Martin Smith
+2  A: 

You should always assume that dirty data can be passed from your form. Allowing it to be loaded from a postback, the __EVENTARGUMENT can be altered from the client side via javascript.

Always use good practices to make sure you don't allow sql-injection; and used parametrized SQL statements or another safe method.

http://msdn.microsoft.com/en-us/library/ms998271.aspx

Glennular
SQL is never executed from our code-behind files. We use an ORM as the data layer between the application and the database.
Schleichermann