Applies To.NET Framework 3.5 Service Pack 1 Windows 7 Service Pack 1 Windows 7 Enterprise Windows 7 Professional Windows 7 Ultimate Windows 7 Home Premium Windows 7 Home Basic Windows 7 Enterprise Windows 7 Professional Windows 7 Ultimate Windows 7 Home Premium Windows 7 Home Basic Windows Server 2008 R2 Service Pack 1 Windows Server 2008 R2 Standard Windows Server 2008 R2 Enterprise Windows Server 2008 R2 Datacenter Windows Server 2008 R2 Standard Windows Server 2008 R2 Enterprise Windows Server 2008 R2 Datacenter Windows Server 2008 Service Pack 2 Windows Server 2008 for Itanium-Based Systems Windows Server 2008 Datacenter Windows Server 2008 Enterprise Windows Server 2008 Standard Windows Server 2008 Web Edition Windows Vista Service Pack 2 Windows Vista Business Windows Vista Enterprise Windows Vista Home Basic Windows Vista Home Premium Windows Vista Starter Windows Vista Ultimate Windows Vista Enterprise 64-bit Edition Windows Vista Home Basic 64-bit Edition Windows Vista Home Premium 64-bit Edition Windows Vista Ultimate 64-bit Edition Windows Vista Business 64-bit Edition Microsoft Windows Server 2003 Service Pack 2 Microsoft Windows XP Professional x64 Edition Microsoft Windows XP Service Pack 3 Microsoft Windows XP Home Edition Microsoft Windows XP Professional

概要

Microsoft 安全更新 MS11-100 将 HTTP 请求中窗体项、文件和 JSON 成员的最大数量限制为 1000。由于此更改,ASP.NET 应用程序拒绝拥有超过 1000 种这些元素的请求。执行这些类型请求的 HTTP 客户端将被拒绝,且 Web 浏览器中会出现错误消息。此错误消息通常都包含 HTTP 500 状态代码。每个应用程序上都可配置这个新限制。有关配置说明,请参阅“解决方案”部分。

症状

拥有许多窗体项、文件或 JSON 负载的 ASP.NET 请求会收到来自服务器的错误响应。在服务器上登录的应用程序具有带有源的警告条目(ASP.NET 的特定版本)和事件 ID 1309。事件日志包含以下消息之一:

消息 1:

应用程序信息: 应用程序域:/LM/W3SVC/1/ROOT/<App Domain>信任级别:中 应用程序虚拟路径:<VDIR Path>应用程序路径:<App Path>机器名:<Machine Name>进程信息: 进程 ID: 0001 进程名称:w3wp.exe 帐户名称:IIS APPPOOL\DefaultAppPool 异常信息: 异常类型:HttpException 异常消息:URL 编码的表单数据无效。 at System.Web.HttpRequest.FillInFormCollection()at System.Web.HttpRequest.get_Form()at System.Web.HttpRequest.get_HasForm()at System.Web.UI.Page.GetCollectionBasedOnMethod(Boolean dontReturnNull)at System.Web.UI.Page.DeterminePostBackMode()at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)

消息 2:

应用程序信息: 应用程序域:/LM/W3SVC/1/ROOT/<App Domain> 信任级别:中 应用程序虚拟路径:<VDIR Path> 应用程序路径:<App Path> 机器名:<Machine Name>进程信息: 进程 ID: 0001进程名称:w3wp.exe 帐户名称:IIS APPPOOL\DefaultAppPool 异常信息: 异常类型:InvalidOperationException 异常消息:由于对象的当前状态,操作无效。 at System.Web.HttpRequest.FillInFilesCollection()at System.Web.HttpRequest.get_Files()at FileUpload.Page_Load(Object sender, EventArgs e) at System.Web.Util.CalliHelper.EventArgFunctionCaller(IntPtr fp, Object o, Object t, EventArgs e)at System.Web.Util.CalliEventHandlerDelegateProxy.Callback(Object sender, EventArgs e)at System.Web.UI.Control.OnLoad(EventArgs e)at System.Web.UI.Control.LoadRecursive()at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint

消息 3:

应用程序信息:应用程序域:/LM/W3SVC/1/ROOT/<App Domain> 信任级别:中 应用程序虚拟路径:<VDIR Path> 应用程序路径:<App Path>机器名:<Machine Name>进程信息: 进程 ID: 0001进程名称:w3wp.exe 帐户名称:IIS APPPOOL\DefaultAppPool 异常信息: 异常类型:InvalidOperationException 异常消息:由于对象的当前状态,操作无效。 at System.Web.Script.Serialization.JavaScriptObjectDeserializer.DeserializeDictionary(Int32 depth)at System.Web.Script.Serialization.JavaScriptObjectDeserializer.DeserializeInternal(Int32 depth)at System.Web.Script.Serialization.JavaScriptObjectDeserializer.BasicDeserialize(String input, Int32 depthLimit, JavaScriptSerializer serializer)at System.Web.Script.Serialization.JavaScriptSerializer.Deserialize(JavaScriptSerializer serializer, String input, Type type, Int32 depthLimit)at System.Web.Script.Serialization.JavaScriptSerializer.DeserializeObject(String input)at Failing.Page_Load(Object sender, EventArgs e) at System.Web.Util.CalliHelper.EventArgFunctionCaller(IntPtr fp, Object o, Object t, EventArgs e)at System.Web.Util.CalliEventHandlerDelegateProxy.Callback(Object sender, EventArgs e)at System.Web.UI.Control.OnLoad(EventArgs e)at System.Web.UI.Control.LoadRecursive()at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)

IIS 日志文件显示一个类似于以下形式的条目:

2011-01-01 00:00:00 ::1 POST /machine/default.aspx - 80 - ::1 - 500 0 0 187

原因

安全公告 MS11-100 解决的 Microsoft 安全更新将 ASP.NET 在一个请求中可接受的窗体项、文件和 JSON 成员的默认最大数量更改为 1000。此更改用于解决 Microsoft 安全公告 MS11-100 记录的拒绝服务漏洞。

解决方案

达到窗体项或文件的此限制的应用程序可以修改 ASP.NET appSetting aspnet:MaxHttpCollectionKeys,如 ASP.NET 应用程序的配置文件所示。此设置可解决“症状”部分的错误消息 1 和错误消息 2。

<configuration><appSettings><add key="aspnet:MaxHttpCollectionKeys" value="1000" /></appSettings></configuration>

注意 如果您在基于 x86 的系统上使用 ASP.NET 1.1,可通过向以下注册表项添加 DWORD 值来调整此设置:

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\ASP.NET\1.1.4322.0\MaxHttpCollectionKeys

如果您在基于 x64 的系统上使用 ASP.NET 1.1,可通过向以下注册表项添加 DWORD 值来调整此设置:

HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\ASP.NET\1.1.4322.0\MaxHttpCollectionKeys

达到此 JSON 负载限制的应用程序可以修改 ASP.NET appSetting aspnet:MaxJsonDeserializerMembers,如下面的 ASP.NET 应用程序配置文件所示。此设置可解决“症状”部分的错误消息 3。

<configuration><appSettings><add key="aspnet:MaxJsonDeserializerMembers" value="1000" /></appSettings></configuration>

注意 将此值增加到超过默认设置会增加服务器对安全公告 MS11-100 中所述的拒绝服务漏洞的敏感性。

参考

有关安全公告 MS11-100 的详细信息,请参阅以下 TechNet 文章:

Microsoft 安全公告 MS11-100 - 严重 有关详细信息,请单击下面的文章编号,以查看 Microsoft 知识库中相应的文章:

2638420 MS11-100:.NET Framework 中的漏洞可能允许特权提升:2011 年 12 月 29 日

需要更多帮助?

需要更多选项?

了解订阅权益、浏览培训课程、了解如何保护设备等。