Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Preventing Injection attacks
Message
 
 
À
25/08/2008 15:04:17
Mike Yearwood
Toronto, Ontario, Canada
Information générale
Forum:
Microsoft SQL Server
Catégorie:
Autre
Versions des environnements
SQL Server:
SQL Server 2005
Divers
Thread ID:
01341172
Message ID:
01341592
Vues:
14
Hi Mike,

I understand that. The question is - how to prevent the incorrect input using parameterized queries. We're installing URLScan, but how would you do this in code? Say, in Stored procedure do you need to analyze each parameter?

Or should you try to do this in the front-end? Or use triggers in tables rejecting some input?

>There are two kinds of injection attacks. One is SQL Injection, which is when the user enters SQL code which you the programmer concatenate and turn into one big SQL command. This is prevented by parameterizing what the user enters. This also requires NO cleaning up of the user's entries.
>
>Instead of
>
>m.lcCmd = "select * from table where field = " + thisform.userentry
>
>do
>
>m.lcUserEntry = thisform.userentry
>m.lcCmd = "select * from table where field = ?m.lcUserEntry"
>
>The other injection is HTML / Javascript being entered into the fields. These you do have to try and filter out.
>
If it's not broken, fix it until it is.


My Blog
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform