by casca · 13y ago · 0 comments
if ($request_uri ~ " ") {
return 403;
}
The issue is the handling of unescaped spaces. These are illegal but nginx accepts them. The workaround is to throw an error any time someone sends the invalid space.Or am I misunderstanding this?
But if you just so happen to run nginx on Windows, you can loose the trailing space requirement as any file is accessible with a space at the end. Also in "/foo /../protected/file" scenario, foo doesn't need to exist.
That would be /mydir%20/ or /%20mydir/ in URL, not literaly a space.
> this only works if you actally have a corresponding directory with a literal trailing space in the name
This won't work event if you have space in name because space would actually be %20. Only a carefully hand crafted HTTP packet would cause the vulnerability