A
A
addd2015-11-11 16:53:29
C++ / C#
addd, 2015-11-11 16:53:29

How to protect yourself from sql injection?

Database.SqlQuery("exec sp_ ...", param)
this code is not protected from sql injection, how is it better to filter the parameters in this case?
Using the SqlParameters class, can you protect yourself from sql injections?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
S
Stanislav Makarov, 2015-11-11
@Nipheris

Using the SqlParameters class, can you protect yourself from sql injections?

It is possible and necessary. When using parameters and prepared statements, values ​​for a particular request can be passed generally separately from the syntax of the request. In any case, the driver of a particular DBMS will be responsible for the correctness, and not you.

X
Xrizolin, 2018-07-12
@Xrizolin

ORM should filter.
Check that you are following best practice: https://www.owasp.org/index.php/SQL_Injection_Prev...
And then run it with a vulnerability scanner. For example https://metascan.ru

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question