早上浏览http://ha.ckers.org/时,发现作者说BlogEngine.NET的读取文件漏洞!于是在本地测试了下,发现国内1.3的确存在这样的漏洞!
问题
读取web.config
读取管理员用户名和密码 users.xml
解决办法
1.修改 BlogEngine.Core\Web\HttpHandlers\JavaScriptHandler.cs文件
在private static string RetrieveRemoteScript(string file) 和private static string RetrieveLocalScript(string file)里分别加上以下代码
[code:c#]
if (!file.EndsWith(".js", StringComparison.OrdinalIgnoreCase))
{
throw new System.Security.SecurityException("No access");
}
[/code]
重新编译后即可解决问题。
2.下载我编译好的文件,覆盖到 bin文件夹即可
修复后提示
Bin-fix.zip (263.00 kb)
3.采用官方修复办法
http://www.dotnetblogengine.net/post/Critical-Security-Patch-Available.aspx