Try our conversational search powered by Generative AI!

Per Nilsson
Jan 18, 2012
  17142
(4 votes)

MS Update MS11-100 breaks sites with more than 1000 parameters

Got a ticket to the support with an error I haven't seen before and found out that the reason is a two weeks old Microsoft hotfix. It might happen to someone else so wanted to write a few rows how to solve it if you run into the problem.

During the holidays MS published the security update MS11-100. This update has been released to fix ASP.NET DoS vulnerability and limits the amount of parameters for a single HTTP POST to 1000. It's probably not that often you use more than 1000 parameters but this is the error you will end up with if you do (the one to look for is ThrowIfMaxHttpCollectionKeysExceeded):

 

Operation is not valid due to the current state of the object.

Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Source Error:

An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.

Stack Trace:
[InvalidOperationException: Operation is not valid due to the current state of the object.]
System.Web.HttpValueCollection.ThrowIfMaxHttpCollectionKeysExceeded() +2692302
System.Web.HttpValueCollection.FillFromEncodedBytes(Byte[] bytes, Encoding encoding) +61
System.Web.HttpRequest.FillInFormCollection() +148

[HttpException (0x80004005): The URL-encoded form data is not valid.]
System.Web.HttpRequest.FillInFormCollection() +206
System.Web.HttpRequest.get_Form() +68
System.Web.HttpRequest.get_HasForm() +8735447
System.Web.UI.Page.GetCollectionBasedOnMethod(Boolean dontReturnNull) +97
System.Web.UI.Page.DeterminePostBackMode() +63
System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +133

 

Solution:
When they added the limitation of parameters they also added the possiblilty to override the default value by a new setting in web.config. Can also mention that it’s not possible to apply different values at different locations. 

Add the following setting to web.config with a value larger than 1000 (default):

<appSettings>
   <add key="aspnet:MaxHttpCollectionKeys" value="some number here"/>
</appSettings>

The above setting should fix the problem.

 

Links:
Info about the hotfix and people getting the error in the discussion following the article:
http://weblogs.asp.net/scottgu/archive/2011/12/28/asp-net-security-update-shipping-thursday-dec-29th.aspx

The same error discussed in a forum
http://forums.asp.net/t/1754522.aspx/1?New+Net+2+0+Bug+From+Windows+Update+

Jan 18, 2012

Comments

Please login to comment.
Latest blogs
Optimizely and the never-ending story of the missing globe!

I've worked with Optimizely CMS for 14 years, and there are two things I'm obsessed with: Link validation and the globe that keeps disappearing on...

Tomas Hensrud Gulla | Apr 18, 2024 | Syndicated blog

Visitor Groups Usage Report For Optimizely CMS 12

This add-on offers detailed information on how visitor groups are used and how effective they are within Optimizely CMS. Editors can monitor and...

Adnan Zameer | Apr 18, 2024 | Syndicated blog

Azure AI Language – Abstractive Summarisation in Optimizely CMS

In this article, I show how the abstraction summarisation feature provided by the Azure AI Language platform, can be used within Optimizely CMS to...

Anil Patel | Apr 18, 2024 | Syndicated blog

Fix your Search & Navigation (Find) indexing job, please

Once upon a time, a colleague asked me to look into a customer database with weird spikes in database log usage. (You might start to wonder why I a...

Quan Mai | Apr 17, 2024 | Syndicated blog