dont forget, injection necessarily need not be of the SQL injection type. users can also try to inject HTML into ur text. .NET has an inbuilt protecting mechanism for this. but if that has been disabled then somebody could as well as do this:
<script>window.close()</script>
and in the page that tries to display this the script will execute.
suggestion:
either validate the fields where u collect the data
OR
Do a HtmlEncode on ALL the fields where no such validations have been done...
Thanks for the link. I'm brand-spankin' new to ASP, and fairly new to html still. I'd never even heard of SQL Injection until today. Thanks for the good info.
Actually if you look at the problem from the standpoint of what to restrict you're probably going to miss something. You should instead look at it from the standpoint of what to allow.
That said, parameterized queries, as mentioned, are the key to guarding against attack in the input (though you can misuse parameters to let malicious input through). You don't want to rely on string replacement because it's not a true solution.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.