Slow HTTP attacks are denial-of-service (DoS) attacks that rely on the fact that the HTTP protocol, by design, requires a request to be completely received by the server before it is processed. If an HTTP request is not complete, or if the transfer rate is very low, the server keeps its resources busy waiting for the rest of the data. When the server’s concurrent connection pool reaches its maximum, this creates a denial of service. These attacks are problematic because they are easy to execute, i.e. they can be executed with minimal resources from the attacking machine.
Microsoft has confirmed the vulnerability in a security bulletin and released software updates. February 2014 Microsoft has released a security bulletin at the following link: MS14-009
Most enterprise sites/datacenters will have DoS defender specialized
hardware, firewalls, load balancers, etc. DoS attacks should be
blocked just while entering your hosting infrastructure not at the end
when request is being processed by web server.
Below are some configuration recommendations that may help preventing DoS attacks (tested with Sitecore 8.1 rev. 160519). Suggested configuration changes will not guarantee 100% protection. I would rather say it will defend from “junior” attackers with limited resources. Requests from let’s say 10000 different locations that bypass configuration limitations and dynamic IP restrictions will put a lot of stress on your web server and eventually cause denial of service.
Request Limits <requestLimits>
Requires Request Filtering feature has to be enabled.
Maximum URL length (Bytes)
- Default value : 4096
- Recommended value : 2048
Maximum query string length (Bytes)
- Default value : 2048
- Recommended value : 1024
Allow unlisted verbs
- Default value : true
- Recommended value : false (Make sure to configure listed verbs)
maxAllowedContentLength
- Default value : 30000000, which is approximately 28.6MB.
- Recommended value : Recommended value for Sitecore setup will vary based on requirements to upload media. For CD server such value can be minimized, while for CM server you may want to upload large size files i.e. have value maximized.
Configuration instructions: https://www.iis.net/configreference/system.webserver/security/requestfiltering/requestlimits
Website <limits>
connectionTimeout
- Default value : 00:02:00 (two minutes)
- Recommended value : 00:00:30
Configuration instructions: https://www.iis.net/configreference/system.applicationhost/sites/sitedefaults/limits
Application host <webLimits>
connectionTimeout (Specifies the time that IIS waits before it disconnects a connection considered inactive).
- Default value : 00:02:00 (two minutes)
- Recommended value : 00:00:30
headerWaitTimeout (Specifies the time that the server waits for all HTTP headers for the request to be received before disconnecting the client.)
- Default value : 00:00:00 (disabled)
- Recommended value : 00:00:30
minBytesPerSecond (Specifies the minimum throughput rate, in bytes, that HTTP.sys enforces when it sends a response to the client. The minBytesPerSecond attribute prevents malicious or malfunctioning software clients from using resources by holding a connection open with minimal data.)
- Default value : 240 bytes
- Recommended value : 500 bytes
Configuration instructions:
https://www.iis.net/configreference/system.applicationhost/weblimits
Dynamic IP Restrictions
The Dynamic IP Restrictions Extension for IIS provides IT Professionals and Hosters a configurable module that helps mitigate or block Denial of Service Attacks or cracking of passwords through Brute-force by temporarily blocking Internet Protocol (IP) addresses of HTTP clients who follow a pattern that could be conducive to one of such attacks.
When an attack pattern is detected, the module will place the offending IP in a temporary deny list and will avoid responding to the requests for a predetermined amount of time.
Dynamically blocking of requests from IP address based on either of the following criteria:
- The number of concurrent requests.
- The number of requests over a period of time.
Module download and configuration instructions
https://www.iis.net/downloads/microsoft/dynamic-ip-restrictions
maxAllowedContentLength
too low will mean you can't upload to media library and possibly affect package upload as well.