HTTP Response Splitting应用程序问题 WASC分类:Content Spoofing 参考: http://www./projects/threat/classes/content_spoofing.shtml 错误等级: 严重(High) 风险: 可以偷盗或者操作用户Session和Cookie,这样攻击者可以扮演一个合法的客户进行操作。 使服务器缓存中毒 技术说明: 通常,应用程序在cookie中,或者URL转发时绑定用户数据。在这种情形下(用户输入绑定在HTTP Response Headers中),攻击者中断当前的返回(注入必要的HTTP Response Headers),添加他自己的附加的HTTP Response。攻击者能够重新编写通讯,采用这种方式:当额外的请求发送,产生额外的回应。这有2种方式进行利用: 1. Cross Site Scripting 2. Web缓存中毒: 攻击方法:
HTTP Response Splitting Application WASC Threat Classification Client-side Attacks: Content Spoofing http://www./projects/threat/classes/content_spoofing.shtml CVE Reference(s) N/A Security Risks It is possible to deface the site content through web-cache poisoning It is possible to steal or manipulate customer session and cookies, which may be used to impersonate a legitimate user, allowing the hacker to view or alter user records, and to perform transactions as that user Possible Causes Sanitation of hazardous characters was not performed correctly on user input Technical Description Oftentimes, applications embed user data in cookie values or as part of a URL in a redirection response. In such situations (or in general, in situations where user input is embedded as-is in HTTP response headers), it is possible for an attacker to terminate the "current" response (by injecting the necessary HTTP response headers), and then to add his/her own additional complete HTTP response. The attacker can then orchestrate the traffic in such a way that when an additional request is sent it appears to generate the additional response. When an attacker succeeds in sending a crafted request, and it is responded with the crafted response, there are two (perhaps more) ways in which this condition can be exploited: 1. Cross Site Scripting: 2. Web cache poisoning: Sample Exploit: When the application redirects the client based on client data (e.g. a parameter named "Lang"): <% Response.Redirect "/Homepage_by_lang.asp?language="+Request.QueryString("lang")) %> Then sending the parameter lang=foobar%0d%0aContent-Length:%200%0d%0a%0d%0aHTTP/1.1%20200%20OK%0d%0aContent-Type:%20text/html%0d%0aContent-Length:%2046%0d%0a%0d%0a<html><script>alert("hacked")</script></html> yields two HTTP responses (and some leftovers after the second response):
As explained above, this can be used to either mount a cross site scripting attack, or a web cache poisoning attack. General Fix Recommendations There are several issues whose remediation lies in sanitizing user input. By verifying that user input does not contain hazardous characters, it is possible to prevent malicious users from causing your application to execute unintended operations, such as launch arbitrary SQL queries, embed Javascript code to be executed on the client side, run various operating system commands etc. |
|