{"vuid":"VU#405811","idnumber":"405811","name":"Apache HTTPD 1.3/2.x Range header DoS vulnerability","keywords":["Apache HTTPD Range Header DoS"],"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.","clean_desc":"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.\"","impact":"CPU and memory usage will spike causing a denial-of-service condition.","resolution":"Apply an Update\nApache 2.2.20 has been released to address this vulnerability.","workarounds":"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\n          SetEnvIf Range (?:,.*?){5,5} bad-range=1\n          RequestHeader unset Range env=bad-range # We always drop Request-Range; as this is a legacy\n          # 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\n          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\n          RewriteCond %{HTTP:range} !(bytes=[^,]+(,[^,]+){0,4}$|^$)\n          # RewriteCond %{HTTP:request-range} !(bytes=[^,]+(?:,[^,]+){0,4}$|^$)\n          RewriteRule .* - [F] # We always drop Request-Range; as this is a legacy\n          # 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\n   http://svn.apache.org/viewvc?view=revision&sortby=date&revision=1161534\"","sysaffected":"","thanks":"This vulnerability was publicly disclosed.","author":"This document was written by Jared Allar.","public":["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"],"cveids":["CVE-2011-3192"],"certadvisory":"","uscerttechnicalalert":null,"datecreated":"2011-08-25T11:35:16Z","publicdate":"2011-08-24T00:00:00Z","datefirstpublished":"2011-08-26T13:34:43Z","dateupdated":"2011-09-19T12:41:05Z","revision":22,"vrda_d1_directreport":"0","vrda_d1_population":"3","vrda_d1_impact":"3","cam_widelyknown":"7","cam_exploitation":"2","cam_internetinfrastructure":"14","cam_population":"15","cam_impact":"11","cam_easeofexploitation":"15","cam_attackeraccessrequired":"15","cam_scorecurrent":"16.01015625","cam_scorecurrentwidelyknown":"25.059375","cam_scorecurrentwidelyknownexploited":"37.5890625","ipprotocol":"","cvss_accessvector":"","cvss_accesscomplexity":"","cvss_authentication":null,"cvss_confidentialityimpact":"","cvss_integrityimpact":"","cvss_availabilityimpact":"","cvss_exploitablity":null,"cvss_remediationlevel":"","cvss_reportconfidence":"","cvss_collateraldamagepotential":"","cvss_targetdistribution":"","cvss_securityrequirementscr":"","cvss_securityrequirementsir":"","cvss_securityrequirementsar":"","cvss_basescore":"","cvss_basevector":"","cvss_temporalscore":"","cvss_environmentalscore":"","cvss_environmentalvector":"","metric":16.01015625,"vulnote":null}