日期:2012-01-06  浏览次数:20475 次

在NT-Bugtraq的邮件列表上首先报告的Security bug in .NET Forms Authentication适用于ASP.NET 1.0 (RTM, SP1, SP2, SP3)和ASP.NET 1.1 (RTM, SP1).



当Form Authentication被使用时,匿名用户在试图访问被保护的页面如http://localhost/WebApplication2/secret.aspx时会被redirect到登录网页如http://localhost/WebApplication2/login.aspx?ReturnUrl=%2fWebApplication2%2fsecret.aspx.



但是如果使用Mozilla,匿名用户可以这样未经认证就访问被保护的页面:http://localhost/WebApplication2\secret.aspx;对IE,可以使用%5C达到类似的效果:http://localhost/WebApplication2%5Csecret.aspx



微软在10月5日发布了What You Should Know About a Reported Vulnerability in Microsoft ASP.NET网页以提供针对此安全漏洞的对策。当前的对策主要是如KB887459所描述的那样在Global.asax或其Code-Behind中在Application_BeginRequest中增加检查



    if (Request.Path.IndexOf('\\') >= 0 ||        System.IO.Path.GetFullPath(Request.PhysicalPath) != Request.PhysicalPath)     {        throw new HttpException(404, "not found");    }
显然每个Application都需要有这样的检查以应对此安全漏洞。微软还会提供其他的对策,请关注What You Should Know About a Reported Vulnerability in Microsoft ASP.NET网页更新。



对ASP.NET 2.0 Beta1,并没有此漏洞而是得到404错误。



贴子以"现状"提供且没有任何担保也没有授予任何权利

发表于 Thursday, October 07, 2004 1:53 AM

评论
# re: ASP.NET Form Authentication安全漏洞及对策 10/7/2004 8:49 AM TommyWOo
http://localhost/WebApplication2%5Csecret.aspx


试过了,不行。IE 版本问题?

# re: ASP.NET Form Authentication安全漏洞及对策 10/7/2004 9:40 AM R2
啊,好可怕!幸好我用Beta1

# re: ASP.NET Form Authentication安全漏洞及对策 10/7/2004 9:43 AM R2
难道微软的这种Form认证这么脆弱??

# re: ASP.NET Form Authentication安全漏洞及对策 10/7/2004 10:09 AM wonge
Windows 2003下不会出现这种错误:http://localhost/WebApplication2%5Csecret.aspx ?

# re: ASP.NET Form Authentication安全漏洞及对策 10/7/2004 10:12 AM 孙展波
我是使用XPSP2的OS及其带的IE6验证的。
从What You Should Know About a Reported Vulnerability in Microsoft ASP.NET网页,Windows 2003 Server也有这个问题。这是ASP.NET的Bug而不是OS的Bug.

# re: ASP.NET Form Authentication安全漏洞及对策 10/7/2004 10:44 AM Lostinet
可怕的漏洞啊~~~
解决方法可以做个简单的IHttpModule,把它注册到GAC和machine.config中.


# re: ASP.NET Form Authentication安全漏洞及对策 10/7/2004 1:21 PM Flashtoy
我按方法试了.怎么没有这个问题.
吓的我半死!
http://www.creva.org.cn/creva/orgshow.aspx

# re: ASP.NET Form Authentication安全漏洞及对策 10/7/2004 6:19 PM TommyWOo
楼上的朋友,,我想到了。。


因为我们用的是IE,IE要用这个漏洞,得使用%5C来代替\符号。。。

我们两个都是在根目录的第一级子目录加验证的,比如你的,得用http://www.creva.org.cn%5Ccreva/orgshow.aspx

显然这里有一个问题,域名是什么?这里域名被表示成了“www.creva.org.cn%5Ccreva”,而不是实际域名“www.creva.org.cn”。

我想问题应该在这里,展波用的是,虚拟目录下的子目录,所以出现了那个漏洞。

你可以用Mozilla的\符号试试。

# re: ASP.NET Form Authentication安全漏洞及对策 10/7/2004 6:25 PM 蓝色空间
确实有问题,赶快修正

# re: ASP.NET Form Authentication安全漏洞及对策 10/7/2004 6:38 PM libber
为什么我测试不出来呢? .net framework 1.1 sp1

# re: ASP.NET Form Authentication安全漏洞及对策 10/7/2004 8:28 PM kwklover
我也测试过了,没有这个问题啊
大家可以测试一下这个网站


# re: ASP.NET Form Authentication安全漏洞及对策 10/7/2004 8:33 PM erictang2003
我也没测试出来,用IE6 和 FireFox1.0 都没试出来.
不过还是改了代码以防万一

# re: ASP.NET Form Authentication安全漏洞及对策 10/8/2004 12:10 AM xiaoheng
测试了,没发现问题!!!!

# re: ASP.NET Form Authentication安全漏洞及对策 10/8/2004 9:09 AM Gigabyte
可以在Global.asax里面加上这么一段解决:

void Application_BeginRequest(object source, EventArgs e) {
if (Request.Path.IndexOf('\\') >= 0 ||
System.IO.Path.GetFullPath(Request.PhysicalPath) != Request.PhysicalPath) {
throw new HttpException(404, "not found");
}
}

这里有MS的解释:
http://www.kbalertz.com/kb_887459.aspx
# re: ASP.NET Form Authentication安全漏洞及对策 10/8/2004 1:14 PM Michael Lee
God ! 噩耗!!!

这种毛病都能出。还有前一阵的那个GDI+的bug,更是让人匪夷所思。