You are viewing a plain text version of this content. The canonical link for it is here.
Posted to bugs@httpd.apache.org by bu...@apache.org on 2007/12/12 21:14:08 UTC

DO NOT REPLY [Bug 44068] New: - RedirectMatch matches directory when it should not

DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG�
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=44068>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND�
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=44068

           Summary: RedirectMatch matches directory when it should not
           Product: Apache httpd-2
           Version: 2.2.6
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: normal
          Priority: P2
         Component: mod_alias
        AssignedTo: bugs@httpd.apache.org
        ReportedBy: ftlofaro@yahoo.com


These following cases show a bug in mod_alias. I get the same behavior with the
RedirectMatch in httpd.conf or .htaccess. Same results in Linux and Solaris,
except httpd on Linux handles some cases correct the Solaris one gets wrong.

RedirectMatch 302 ^/foo/. "http://servername/redirected/"

Expected Behavior: Only http://servername/foo/ followed by at least one
character gets redirected
Actual Behavior: http://servername/foo itself gets redirected

RedirectMatch 302 ^/foo/a "http://servername/redirected/"
Expected Behavior: Only http://servername/foo/a followed by anything gets redirected
Actual Behavior: Works properly

RedirectMatch 302 ^/foo/i "http://servername/redirected/"
Expected Behavior: Only http://servername/foo/i followed by anything gets redirected
Actual Behavior: Works fine except http://servername/foo/ gets redirected, which
it should not.

RedirectMatch 302 ^/foo/d "http://servername/redirected/"
Expected Behavior: Only http://servername/foo/d followed by anything gets redirected
Actual Behavior: Works properly on Linux, on Solaris acts like the ^/foo/i case
above

RedirectMatch 302 ^/foo/[h-j] "http://servername/redirected"
Expected Behavior: Only http://servername/foo/ followed by "h", "i", or "j",
then followed by anything gets redirected
Actual Behavior: Works fine except http://servername/foo/ gets redirected, which
it should not.

RedirectMatch 302 ^/foo/[c-e] "http://servername/redirected"
Expected Behavior: Only http://servername/foo/ followed by "c", "d", or "e",
then followed by anything gets redirected
Actual Behavior: Works fine on Linux, on Solaris acts like the ^/foo/[h-j] case
above

Changing / to \/ has no effect.

-- 
Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.

---------------------------------------------------------------------
To unsubscribe, e-mail: bugs-unsubscribe@httpd.apache.org
For additional commands, e-mail: bugs-help@httpd.apache.org


DO NOT REPLY [Bug 44068] - RedirectMatch matches directory when it should not

Posted by bu...@apache.org.
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG�
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=44068>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND�
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=44068


nick@webthing.com changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEEDINFO                    |RESOLVED
         Resolution|                            |INVALID




------- Additional Comments From nick@webthing.com  2007-12-12 14:21 -------
(In reply to comment #1)

> If you request a directory, Apache tries appending all the DirectoryIndex file
> names to serve an index page. The RedirectMatch check is done after that. It
> probably should be done before that, so that unexpected matches don't occur.

Not quite.  The DirectoryIndex causes a subrequest, and it's the subrequest that
gets redirected.  All as expected.

If we "fix" this, we have a gaping security hole, where a file matching your
RedirectMatch - and therefore maybe presumed secret - would then be served.


-- 
Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.

---------------------------------------------------------------------
To unsubscribe, e-mail: bugs-unsubscribe@httpd.apache.org
For additional commands, e-mail: bugs-help@httpd.apache.org


DO NOT REPLY [Bug 44068] - RedirectMatch matches directory when it should not

Posted by bu...@apache.org.
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG�
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=44068>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND�
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=44068


rpluem@apache.org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |NEEDINFO




------- Additional Comments From rpluem@apache.org  2007-12-12 12:42 -------
Sorry, but I cannot reproduce these cases. They work as expected. I guess there
are other directives (possibly rewrite rules) in your config that lead to this
kind of strange behaviour.

-- 
Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.

---------------------------------------------------------------------
To unsubscribe, e-mail: bugs-unsubscribe@httpd.apache.org
For additional commands, e-mail: bugs-help@httpd.apache.org


DO NOT REPLY [Bug 44068] - RedirectMatch matches directory when it should not

Posted by bu...@apache.org.
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG�
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=44068>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND�
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=44068





------- Additional Comments From ftlofaro@yahoo.com  2007-12-12 12:33 -------
OK, I found out what is happening. If the directory isn't there, it works as
expected.

I found an interaction between DirectoryIndex and RedirectMatch.

If you request a directory, Apache tries appending all the DirectoryIndex file
names to serve an index page. The RedirectMatch check is done after that. It
probably should be done before that, so that unexpected matches don't occur.

In other words, have the RedirectMatch code run first, then the DirectoryIndex
code. The Solaris and Linux difference was because the Solaris machine was set
to try default.htm in the httpd.conf and the Linux one wasn't.



-- 
Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.

---------------------------------------------------------------------
To unsubscribe, e-mail: bugs-unsubscribe@httpd.apache.org
For additional commands, e-mail: bugs-help@httpd.apache.org