Dan Haagman, InfoSecurity 2009
Secure Coding Course, © 7Safe
2010/11/09 DBAppsecurtiy 2010
1
OWASP TOP 10细述
杭州安恒信息技术有限公司
Dan Haagman, InfoSecurity 2009
Secure Coding Course, © 7Safe
2010/11/09 DBAppsecurtiy 2010
2
• OWASP TOP 10漏洞剖析
目录
Dan Haagman, InfoSecurity 2009
Secure Coding Course, © 7Safe
2010/11/09 DBAppsecurtiy 2010
3
注入 - Injection
跨站脚本 - Cross-Site Scripting (XSS)
失效的验证和会话管理 - Broken Authentication and Session
Management
不安全的直接对象访问 - Insecure Direct Object References
跨站请求伪造 - Cross-Site Request Forgery(CSRF)
不正确的安全设置 - Security Misconfiguration
不安全的加密存储 - Insecure Cryptographic Storage
URL访问限制缺失 - Failure to Restrict URL Access
没有足够的传输层防护 - Insufficient Transport Layer Protection
未验证的重定向和跳转 - Unvalidated Redirects and Forwards
OWASP TOP 10漏洞剖析
Dan Haagman, InfoSecurity 2009
Secure Coding Course, © 7Safe
2010/11/09 DBAppsecurtiy 2010
4
虽然还有其他类型的注入攻击,但绝大多数情况下,问题
涉及的都是SQL注入。
攻击者通过发送SQL操作语句,达到获取信息、篡改数据库、
控制服务器等目的。是目前非常流行的Web攻击手段。
流行性:常见;危害性:严重
示例
注入 - Injection
网页中使用如下SQL查询,其中username和password需要用户输入:
select * from hacked_Users where username='username' and
password='password'
攻击者可以输入任意用户名,并输入' or '1'='1 作为密码,实现如下查
询:
select * from hacked_Users where username= 'Andy ' and password='
or '1'='1'
Dan Haagman, InfoSecurity 2009
Secure Coding Course, © 7Safe
2010/11/09 DBAppsecurtiy 2010
5
主要防范措施:
严格检查用户输入,注意特殊字符:“’”“;”“[”“--
””||”“xp_”等
转义用户输入内容
拒绝已经经过转义的输入
使用参数化的查询
使用SQL存储过程
最小化SQL权限(禁用SA帐号)
防止错误页面信息泄露
注入 - Injection