You are viewing a plain text version of this content. The canonical link for it is here.
Posted to apache-bugdb@apache.org by James Marshall <ja...@jmarshall.com> on 2001/01/14 22:41:54 UTC
mod_cgi/7066: PATH_INFO containing %2F causes server to interpret PATH_INFO as part of file path.
>Number: 7066
>Category: mod_cgi
>Synopsis: PATH_INFO containing %2F causes server to interpret PATH_INFO as part of file path.
>Confidential: no
>Severity: non-critical
>Priority: medium
>Responsible: apache
>State: open
>Quarter:
>Keywords:
>Date-Required:
>Class: sw-bug
>Submitter-Id: apache
>Arrival-Date: Sun Jan 14 13:50:01 PST 2001
>Closed-Date:
>Last-Modified:
>Originator: james@jmarshall.com
>Release: 1.3.15-dev
>Organization:
apache
>Environment:
It's actually on www.apache.org; printenv.cgi shows it.
>Description:
Compare
http://www.apache.org/printenv.cgi/path/info
http://www.apache.org/printenv.cgi/path%2Finfo
These should both call printenv.cgi, right? The second case results in
"file not found", apparently because the server is looking for the file
/printenv.cgi/path/info .
Related to this, PATH_INFO is being un-URL-encoded before being passed to the
script, e.g.
http://www.apache.org/printenv.cgi/path%20info
results in PATH_INFO of "/path info". Shouldn't it be passed along without
decoding it, i.e. "/path%20info"? Otherwise, how could a script distinguish
between PATH_INFOs of "/path%2Finfo" and "/path/info"? Or are such pairs
always semantically equivalent?
Sticky question and a can of worms, I know. When are parts of the URL
encoded and when aren't they, etc. The latest CGI draft seems to imply
that PATH_INFO treatment may vary by server (section 6.1.6), but this
results in non-portable scripts. Granted, the CGI draft is a BCP.
>How-To-Repeat:
Try http://www.apache.org/printenv.cgi/path%2Finfo
>Fix:
What seems to be lacking is a clear definition of when things are encoded and
when they aren't. I know that's very tricky to come up with. Yes, I've lost
sleep trying to figure this one out.
>Release-Note:
>Audit-Trail:
>Unformatted:
[In order for any reply to be added to the PR database, you need]
[to include <ap...@Apache.Org> in the Cc line and make sure the]
[subject line starts with the report component and number, with ]
[or without any 'Re:' prefixes (such as "general/1098:" or ]
["Re: general/1098:"). If the subject doesn't match this ]
[pattern, your message will be misfiled and ignored. The ]
["apbugs" address is not added to the Cc line of messages from ]
[the database automatically because of the potential for mail ]
[loops. If you do not include this Cc, your reply may be ig- ]
[nored unless you are responding to an explicit request from a ]
[developer. Reply only with text; DO NOT SEND ATTACHMENTS! ]