Executive Summary

Summary
Title Apache HTTPD 1.3/2.x Range header DoS vulnerability
Informations
NameVU#405811First vendor Publication2011-08-26
VendorVU-CERTLast vendor Modification2011-09-19
Severity (Vendor) N/ARevisionM

Security-Database Scoring CVSS v2

Cvss vector : (AV:N/AC:L/Au:N/C:N/I:N/A:C)
Cvss Base Score7.8Attack RangeNetwork
Cvss Impact Score6.9Attack ComplexityLow
Cvss Expoit Score10AuthentificationNone Required
Calculate full CVSS 2.0 Vectors scores

Detail

Vulnerability Note VU#405811

Apache HTTPD 1.3/2.x Range header DoS vulnerability

Overview

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.

I. Description

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."

II. Impact

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

III. Solution

Apply an Update

Apache 2.2.20 has been released to address this vulnerability.

Workarounds


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} !(bytes=[^,]+(,[^,]+){0,4}$|^$)
# RewriteCond %{HTTP:request-range} !(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-...
http//svn.apache.org/viewvc?view=revision&sortby=date&revision=11615..."

Vendor Information

VendorStatusDate NotifiedDate Updated
Apache HTTP Server ProjectAffected2011-08-26
Cisco Systems, Inc.Affected2011-08-31
Debian GNU/LinuxAffected2011-08-31
Mandriva S. A.Affected2011-09-06
Oracle CorporationAffected2011-09-19

References

http//blog.spiderlabs.com/2011/08/mitigation-of-apache-range-header-dos-atta...
http//mail-archives.apache.org/mod_mbox/httpd-announce/201108.mbox/%3C201108...
http//mail-archives.apache.org/mod_mbox/httpd-announce/201108.mbox/%3C201108...
http://www.apache.org/dist/httpd/CHANGES_2.2.20
http://www.apache.org/dist/httpd/Announcement2.2.html

Credit

This vulnerability was publicly disclosed.

This document was written by Jared Allar.

Other Information

Date Public:2011-08-24
Date First Published:2011-08-26
Date Last Updated:2011-09-19
CERT Advisory:
CVE-ID(s):CVE-2011-3192
NVD-ID(s):CVE-2011-3192
US-CERT Technical Alerts:
Severity Metric:16.01
Document Revision:21

Original Source

Url : http://www.kb.cert.org/vuls/id/405811

CWE : Common Weakness Enumeration

idName
CWE-399Resource Management Errors

OVAL Definitions

Definition Id: oval:org.mitre.oval:def:14824
 
Oval ID: oval:org.mitre.oval:def:14824
Title: HP-UX Apache Web Server, Remote Denial of Service (DoS)
Description: The byterange filter in the Apache HTTP Server 1.3.x, 2.0.x through 2.0.64, and 2.2.x through 2.2.19 allows remote attackers to cause a denial of service (memory and CPU consumption) via a Range header that expresses multiple overlapping ranges, as exploited in the wild in August 2011, a different vulnerability than CVE-2007-0086.
Family: unix Class: vulnerability
Reference(s): CVE-2011-3192
Version: 4
Platform(s): HP-UX 11
Product(s):
Definition Synopsis:
Definition Id: oval:org.mitre.oval:def:14762
 
Oval ID: oval:org.mitre.oval:def:14762
Title: HP-UX Apache Web Server, Remote Denial of Service (DoS)
Description: The byterange filter in the Apache HTTP Server 1.3.x, 2.0.x through 2.0.64, and 2.2.x through 2.2.19 allows remote attackers to cause a denial of service (memory and CPU consumption) via a Range header that expresses multiple overlapping ranges, as exploited in the wild in August 2011, a different vulnerability than CVE-2007-0086.
Family: unix Class: vulnerability
Reference(s): CVE-2011-3192
Version: 4
Platform(s): HP-UX 11
Product(s):
Definition Synopsis:

CPE : Common Platform Enumeration

TypeDescriptionCount
Application98

ExploitDB Exploits

idDescription
2011-12-09Apache HTTP Server Denial of Service

Open Source Vulnerability Database (OSVDB)

idDescription
74721Apache HTTP Server ByteRange Filter Memory Exhaustion Remote DoS

Metasploit Database

idDescription
2011-08-19 Apache Range header DoS (Apache Killer)