当前位置: 代码迷 >> Web前端 >> IE中的X-XSS-Protection配备
  详细解决方案

IE中的X-XSS-Protection配备

热度:606   发布时间:2012-09-10 11:02:32.0
IE中的X-XSS-Protection配置
Internet Explorer 8 contains a new feature to detect reflected cross-site scripting (XSS) vulnerabilities. XSS vulnerabilities enable an attacker to control the relationship between a user and a Web site or Web application that they trust. Cross-site scripting can enable attacks such as:
Cookie theft, including the theft of sessions cookies that can lead to account hijacking
Monitoring keystrokes input to the victim Web site or application
Performing actions on the victim Web site on behalf of the victim user. For example, an XSS attack on Windows Live Mail might enable an attacker to read and forward e-mail messages, set new calendar appointments, and so on.
The XSS Filter operates as an Internet Explorer 8 component with visibility into all requests / responses flowing through the browser. When the filter discovers likely XSS in a cross-site request, it identifies and neuters the attack if it is replayed in the server's response.

With the new XSS Filter, Internet Explorer 8 users encountering a Type-1 XSS attack will see a notification like the following:

The page has been modified and the XSS attack is blocked. Users are not presented with a question about what they would like to do in this case (a question most users would be unable to answer). Internet Explorer simply blocks the malicious script from executing.

In this case the XSS Filter has identified a cross-site scripting attack in the URL. It has neutered this attack as the identified script was replayed back into the response page. In this way the filter is effective without modifying an initial request to the server or blocking an entire response.

上面是微软网站上的介绍,一个简单的方法来处理脚本攻击。例如:
http://localhost/a.htm?content=<script>alert(1);</script>。那么在IE8及其后续的版本就会用这个恶意脚本去匹配输出内容吧。具体的还需要后续进行测试。