[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <4E5782FC.9020708@civ.zcu.cz>
Date: Fri, 26 Aug 2011 13:26:52 +0200
From: bodik <bodik@....zcu.cz>
To: full-disclosure@...ts.grok.org.uk
Subject: Re: Advisory: Range header DoS vulnerability
Apache HTTPD 1.3/2.x (CVE-2011-3192)
>> 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]
> ^^ Better use this:
>
> RewriteEngine on RewriteCond %{HTTP:range} !(^bytes=[^,]+(,[^,]+){0,4}$|^$)
> [NC,OR] RewriteCond %{HTTP:request-range} !(^bytes=[^,]+(,[^,]+){0,4}$|^$)
> [NC] RewriteRule .* - [F]
>
> Because if you don't specify the [OR] apache will combine the rules making
> an AND (and you don't want this!).
>
> Also use NC=(nocase) to prevent the attacker upper casing "bytes=" (don't
> know if it will work.. but just to prevent)
>
in any case, i found very wierd behavior on some of our webservers. as we
applied the first version of workaround, something about 15% of our webpages
seems to be broken, but the rest of virtual hosts were working fine.
I really dunno why, since LiveHeaders didn't show !any! ranges http header
from my browser but still i was getting "Forbidden" response :(
I'll digg in deeper (also to rewrite debug log) in the night because I can't
reproduce it on other places ;(
bodik
_______________________________________________
Full-Disclosure - We believe in it.
Charter: http://lists.grok.org.uk/full-disclosure-charter.html
Hosted and sponsored by Secunia - http://secunia.com/
Powered by blists - more mailing lists