Apache HTTPD 1.3/2.x Range header DoS vulnerability

ID VU:405811
Type cert
Reporter CERT
Modified 2011-09-19T00:00:00



Apache HTTPD server contains a denial-of-service vulnerability in the way multiple overlapping ranges are handled. Both the 'Range' header and the 'Range-Request' header are vulnerable. An attack tool, commonly known as 'Apache Killer', has been released in the wild. The attack tool causes a significant increase in CPU and memory usage on the server.


The Apache HTTPD Security Advisory Update 2 states:

"Background and the 2007 report

There are two aspects to this vulnerability. One is new, is Apache specific; and resolved with this server side fix. The other issue is fundamentally a protocol design issue dating back to 2007:

_ <http://seclists.org/bugtraq/2007/Jan/83> _

_The contemporary interpretation of the HTTP protocol (currently) requires a server to return multiple (overlapping) ranges; in the order requested. This means that one can request a very large range (e.g. from byte 0- to the end) 100's of times in a single request. _

Being able to do so is an issue for (probably all) webservers and currently subject of an IETF discussion to change the protocol:

_ __<http://trac.tools.ietf.org/wg/httpbis/trac/ticket/311>_

This advisory details a problem with how Apache httpd and its so called internal 'bucket brigades' deal with serving such "valid" request. The problem is that currently such requests internally explode into 100's of large fetches, all of which are kept in memory in an inefficient way. This is being addressed in two ways. By making things more efficient. And by weeding out or simplifying requests deemed too unwieldy."


CPU and memory usage will spike causing a denial-of-service condition.


Apply an Update
Apache 2.2.20 has been released to address this vulnerability.


The Apache HTTPD Security Advisory Update 2 offers the following workarounds:

_"There are several immediate options to mitigate this issue until a full fix is available. Below examples handle both the 'Range' and the legacy 'Request-Range' with various levels of care. _

Note that 'Request-Range' is a legacy name dating back to Netscape Navigator 2-3 and MSIE 3. Depending on your user community - it is likely that you can use option '3' safely for this older 'Request-Range'.

1) Use SetEnvIf or mod_rewrite to detect a large number of ranges and then either ignore the Range: header or reject the request.

_ Option 1: (Apache 2.2)_

_ __# Drop the Range header when more than 5 ranges._ _ # CVE-2011-3192_
_ SetEnvIf Range (?:,.*?){5,5} bad-range=1_
_ RequestHeader unset Range env=bad-range_

_ # We always drop Request-Range; as this is a legacy_
_ # dating back to MSIE3 and Netscape 2 and 3._
_ RequestHeader unset Request-Range_

_ # optional logging._
_ CustomLog logs/range-CVE-2011-3192.log common env=bad-range_
_ CustomLog logs/range-CVE-2011-3192.log common env=bad-req-range_

_ Above may not work for all configurations. In particular situations mod_cache and (language) modules may act before the 'unset' is executed upon during the 'fixup' phase._

_ Option 2: (Pre 2.2 and 1.3)_

_ __# Reject request when more than 5 ranges in the Range: header._ _ # CVE-2011-3192_
_ #_
_ RewriteEngine on_
_ RewriteCond %{_``_[HTTP:range](&lt;HTTP:range&gt;)_``_} !(bytes=[^,]+(,[^,]+){0,4}$|^$)_
_ # RewriteCond %{_``_[HTTP:request-range](&lt;HTTP:request-range&gt;)_``_} !(bytes=[^,]+(?:,[^,]+){0,4}$|^$)_
_ RewriteRule .* - [F]_

_ # We always drop Request-Range; as this is a legacy_
_ # dating back to MSIE3 and Netscape 2 and 3._
_ RequestHeader unset Request-Range_

_ The number 5 is arbitrary. Several 10's should not be an issue and may be required for sites which for example serve PDFs to very high end eReaders or use things such complex http based video streaming._

_2) Limit the size of the request field to a few hundred bytes. Note that while this keeps the offending Range header short - it may break other headers; such as sizeable cookies or security fields. _

_ __LimitRequestFieldSize 200_

_ Note that as the attack evolves in the field you are likely to have to further limit this and/or impose other LimitRequestFields limits._

_ See: __<http://httpd.apache.org/docs/2.2/mod/core.html#limitrequestfieldsize>_

3) Use mod_headers to completely dis-allow the use of Range headers:

_ _RequestHeader unset Range_ _

_ Note that this may break certain clients - such as those used for e-Readers and progressive/http-streaming video. Furthermore to ignore the Netscape Navigator 2-3 and MSIE 3 specific legacy header - add:_

_ __RequestHeader unset Request-Range _

_ Unlike the commonly used 'Range' header - dropping the 'Request-Range' is not likely to affect many clients._

4) Deploy a Range header count module as a temporary stopgap measure:

_ __<http://people.apache.org/~dirkx/mod_rangecnt.c>_

_ Precompiled binaries for some platforms are available at:_

_ __<http://people.apache.org/~dirkx/BINARIES.txt>_

5) Apply any of the current patches under discussion - such as:

_ <http://mail-archives.apache.org/mod_mbox/httpd-dev/201108.mbox/%3cCAAPSnn2PO-d-C4nQt_TES2RRWiZr7urefhTKPWBC1b+K1Dqc7g@mail.gmail.com%3e>

Vendor Information

Vendor| Status| Date Notified| Date Updated
Apache HTTP Server Project| | -| 26 Aug 2011
Cisco Systems, Inc.| | -| 31 Aug 2011
Debian GNU/Linux| | -| 31 Aug 2011
Mandriva S. A.| | -| 06 Sep 2011
Oracle Corporation| | -| 19 Sep 2011
If you are a vendor and your product is affected, let us know.

CVSS Metrics

Group | Score | Vector
Base | N/A | N/A
Temporal | N/A | N/A
Environmental | N/A | N/A


  • <http://blog.spiderlabs.com/2011/08/mitigation-of-apache-range-header-dos-attack.html>
  • <http://mail-archives.apache.org/mod_mbox/httpd-announce/201108.mbox/%3C20110824161640.122D387DD@minotaur.apache.org%3E>
  • <http://mail-archives.apache.org/mod_mbox/httpd-announce/201108.mbox/%3C20110826103531.998348F82@minotaur.apache.org%3E>
  • <http://www.apache.org/dist/httpd/CHANGES_2.2.20>
  • <http://www.apache.org/dist/httpd/Announcement2.2.html>


This vulnerability was publicly disclosed.

This document was written by Jared Allar.

Other Information

  • CVE IDs: CVE-2011-3192
  • Date Public: 24 Aug 2011
  • Date First Published: 26 Aug 2011
  • Date Last Updated: 19 Sep 2011
  • Severity Metric: 16.01
  • Document Revision: 21