ASP.NET HTTP 响应拆分攻击

信息安全 攻击 http 威胁缓解 响应分裂
2021-08-24 22:37:34

默认情况下,当您执行 Response.Redirect 时,ASP.NET 会检查 HTTP 响应拆分攻击:

Response.Redirect("/MySite/Default.aspx?lang=foobar%0d%0aContentLength:%200%0d%0a%0d%0aHTTP/1.1%20200%20OK%0d%0aContentType:%20text/html%0d%0aContentLength:%2019%0d%0a%0d%0a<html>Shazam</html>");

结果 - 错误页面:

A potentially dangerous Request.QueryString value was detected from the client (lang="...th: 19

<html>Shazam</html>").

Description: Request Validation has detected a potentially dangerous client input value, and processing of the request has been aborted. This value may indicate an attempt to compromise the security of your application, such as a cross-site scripting attack. You can disable request validation by setting validateRequest=false in the Page directive or in the configuration section. However, it is strongly recommended that your application explicitly check all inputs in this case. 

有没有其他方法可以对默认的 ASP.NET 网站配置执行 HTTP 响应拆分攻击?ASP.NET MVC 呢?

1个回答

这将是一个令人讨厌的微不足道的答案,但是......

在更新的 ASP.NET(或 MVC)服务器上执行响应拆分攻击的唯一方法是应用程序本身正在写回原始 HTTP 响应
是的,当然没有一个心智正常的程序员会这样做……但是在 60%心智不正常的程序员的情况下,这样的实现很可能很容易受到攻击。

否则,不,该应用程序不容易受到 HRS 的攻击。