准备好的语句和存储过程一起使用
我正处于基于 Microsoft ASP.NET / SQL Server 2008 的 Web 应用程序的规划阶段,在考虑数据库设计时,我开始考虑注入攻击以及应该采用哪些策略来减轻数据库作为注入攻击的载体。
我从各种来源听说使用存储过程可以提高安全性,我还了解到,如果它们仍然与动态 SQL 一起使用,它们同样具有传染性,因为这会带来注入点
问题
是否可以在存储过程中使用参数化查询?我的想法是,如果我将存储过程的参数传递到准备好的语句中,数据库引擎将为我清理这些参数。
I'm in the planning stages of a Microsoft ASP.NET / SQL Server 2008 based web application and In thinking about database design, I began to think about injection attacks and what strategies I should employ to mitigate the database as a vector for injection attacks.
I've heard from various sources that using stored procedures increases safety, I have also read that these are equally as infective if they are still used with dynamic SQL as this presents an injection point
Question
Is it possible to use a Parametrized Query inside a stored procedure? My thinking is that if I pass the arguments to the stored procedure into the prepared statement the database engine will sanitize those arguments for me.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
是的,您可以在存储过程中传递参数化查询。
但它认为它不会在程序中使用执行计划
据我所知,工作速度很慢。
Yes you can pass Parametrized query inside a store procedure.
but it think it will not use execution plan in the procedure
and work slow as per my knowledge.