You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@httpd.apache.org by "Roy T. Fielding" <fi...@kiwi.ICS.UCI.EDU> on 1997/04/06 09:02:55 UTC

Re: [BUG?] /cgi-bin/foo/bar%2fbaz

>If foo is a script, and you try to access foo/bar/baz, it will run foo and
>pass /bar/baz as PATH_INFO.  If you try to access foo/bar%2fbaz, it will
>return NOT_FOUND because of unescape_url in util.c:
>
>                if (url[x] == '/' || url[x] == '\0') badpath = 1;
>
>Smells like a bug.  Once again (sigh) no time to look more deeply, would
>appreciate if someone familiar with that area take a look...

It has come up several times in the past.  The problem is that we use
the %2f check to avoid security problems with stupid scripts.  I think
the best solution would be to decode all %2f's before doing any processing
on the path, and thus reduce %2f.. to /.. before doing the path checks.
This makes it impossible to have a filename containing slash, but I think
we can live with that.

.....Roy