4.1 Ensure 'maxAllowedContentLength' is configured - Default


The maxAllowedContentLength Request Filter is the maximum size of the http request, measured in bytes, which can be sent from a client to the server. Configuring this value enables the total request size to be restricted to a configured value.

It is recommended that the overall size of requests be restricted to a maximum value appropriate for the server, site, or application.


Setting an appropriate value that has been tested for the maxAllowedContentLength filter will lower the impact an abnormally large request would otherwise have on IIS and/or web applications. This helps to ensure availability of web content and services, and may also help mitigate the risk of buffer overflow type attacks in unmanaged components.


Size of requests be restricted to the maximum value set.


The MaxAllowedContentLength Request Filter may be set for a server, website, or application using the IIS Manager GUI, using AppCmd.exe commands in a command-line window, and/or directly editing the configuration files. To configure using the IIS Manager GUI:

Open Internet Information Services (IIS) Manager

In the Connections pane, click on the server, site, application, or directory to be configured

In the Home pane, double-click Request Filtering

Click Edit Feature Settings... in the Actions pane

Under the Request Limits section, key the maximum content length in bytes that will allow applications to retain their intended functionality, such as 30000000 (approx. 28.6 MB)

Enter the following command in AppCmd.exe to configure:

%systemroot%\system32\inetsrv\appcmd set config /section:requestfiltering /requestLimits.maxAllowedContentLength:30000000


Enter the following command in PowerShell to configure:

Set-WebConfigurationProperty -pspath 'MACHINE/WEBROOT/APPHOST' -filter 'system.webServer/security/requestFiltering/requestLimits' -name 'maxAllowedContentLength' -value 30000000

Default Value:

When request filtering is installed on a system, the default value is: maxAllowedContentLength='30000000', which is approximately 28.6MB.

See Also


Item Details


References: 800-53|SA-8, CSCv7|18

Plugin: Windows

Control ID: 8919277da3550015faf656d6973c130b4beae5d9a8df9277b0cb1f72ff9e6292