Ivan Fratric of the Google Security Team discovered a bug in nginx,
which might allow an attacker to bypass security restrictions in certain
configurations by using a specially crafted request, or might have
potential other impact (CVE-2013-4547).
Some checks on a request URI were not executed on a character following
an unescaped space character (which is invalid per HTTP protocol, but
allowed for compatibility reasons since nginx 0.8.41). One of the
results is that it was possible to bypass security restrictions like
location /protected/ {
deny all;
}
by requesting a file as “/foo /…/protected/file” (in case of static
files, only if there is a "foo " directory with a trailing space), or to
trigger processing of a file with a trailing space in a configuration
like
I think every request like “/protected/hello.php” can bypass this security
restriction like “location /protected {deny all;}”.
Is there something wrong with this POC description or something I misunderstand?
Thanks.
These are distinct examples of affected configurations.
Obviously if you have both locations in your configuration exactly as
written, access to “/protected/hello.php” is not restricted (and there
is
nothing to bypass).
This is actually a common configuration mistake to write a configuration
like this and assume that access to php files under “/protected/” is
restricted. Correct solution would be to use “^~” modifier to prevent
checking of regexp locations:
On Tue, Nov 19, 2013 at 07:02:21PM +0400, Maxim D. wrote:
Hello!
Ivan Fratric of the Google Security Team discovered a bug in nginx,
which might allow an attacker to bypass security restrictions in certain
configurations by using a specially crafted request, or might have
potential other impact (CVE-2013-4547).
I wanted to inform the list that debian has uploaded packages to handle
the issue:
nginx 1.2.1-2.2+wheezy2 for wheezy (includes the backported patch)
nginx 1.4.4-1 for sid