What is SQL injection? [duplicate]

2018-12-30 22:52发布

Possible Duplicates:

How does the SQL injection from the "Bobby Tables" XKCD comic work?
https://stackoverflow.com/search?q=sql+injection

Can someone explain SQL injection? How does it cause vulnerabilities? Where exactly is the point where SQL is injected?

9条回答
荒废的爱情
2楼-- · 2018-12-30 23:45

To get some general background check out the Wikipedia article on SQL Injection.

In short SQL injection attacks can leave you vulnerable to all manor of database data theft and destruction. The exact details of what can be done to your system depend on the details of the system itself.

Any time you pass input from your users to your database you have a potential injection point. Web applications are often lacking in the this regard, as new programmers often do not understand the risks of handling input from users, and web applications are attacked by very smart people you never thought would find your program.

查看更多
爱死公子算了
3楼-- · 2018-12-30 23:45

The point where SQL is injected is any point that your application accepts input from the user.

Whether this becomes a dangerous vulnerability for your web application depends on whether this input is later used as part of an SQL query without properly checking its type and escaping it if necessary.

Without proper escaping, some SQL code 'injected' by the user could be executed by the SQL engine as SQL code, rather than a simple string or value.

查看更多
公子世无双
4楼-- · 2018-12-30 23:46

I found this paper to be an extremely good read about SQL injection techniques (link is to PDF): Advanced SQL Injection In SQL Server Applications.

Despite the title saying "Advanced", it's quite readable even if you don't have much knowledge about SQL injection.

查看更多
登录 后发表回答