从什么sql参数保护你? [英] From what do sql parameters protect you?

查看:81
本文介绍了从什么sql参数保护你?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

参数用于保护您免受恶意用户输入。

Parameters are used to protect you from malicious user input.

但是如果参数需要一个字符串,是否可以写入输入将被解释为sql,所以恶意用户可以使用像'DROP','TRUNCATE'等等?

But if the parameter expects a string, is it possible to write input that will be interpreted as sql, so malicious users can use things like 'DROP', 'TRUNCATE', etc...?

在asp,asp.net,java中的参数之间有保护的差异和其他人?

Are there differences in protection between parameters in asp, asp.net, java and others?

另请参阅:参数是否足以防止SQL注入?

推荐答案

参数化查询通常引用参数,如果它是一个字符串后面的场景,以便正常的SQL操作符不解释为这样。这意味着即使用户输入潜在的恶意数据,也只是作为字符串输入处理,而不会解释为SQL操作符/命令。

Parameterized queries generally quote the parameter if it is a string behind the scene so that the normal SQL operators are not interpreted as such. This means that even if a user enters potentially malicious data it is simply treated as a string input and not interpreted as SQL operators/commands.

可能存在技术差异它在各种框架中实现,但基本思想(和结果)是一样的。

There may be technical differences in how it is implemented in the various frameworks, but the basic idea (and result) is the same.

这篇关于从什么sql参数保护你?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆