Login | Register For Free | Help
Search for: (Advanced)

Mailing List Archive: Apache: Bugs

[Bug 55323] Double unescaped uri in sub request handler

 

 

Apache bugs RSS feed   Index | Next | Previous | View Threaded


bugzilla at apache

Jul 29, 2013, 4:17 AM

Post #1 of 6 (53 views)
Permalink
[Bug 55323] Double unescaped uri in sub request handler

https://issues.apache.org/bugzilla/show_bug.cgi?id=55323

--- Comment #1 from Eric Covener <covener [at] gmail> ---
That looks too general, your symptom is that you pass file%#12file into a
rewriterule (-U check?) and it needs to be encoded at that point, but the patch
would re-escape anyone who sent in a properly escaped URL.

--
You are receiving this mail because:
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: bugs-unsubscribe [at] httpd
For additional commands, e-mail: bugs-help [at] httpd


bugzilla at apache

Jul 29, 2013, 5:30 AM

Post #2 of 6 (48 views)
Permalink
[Bug 55323] Double unescaped uri in sub request handler [In reply to]

https://issues.apache.org/bugzilla/show_bug.cgi?id=55323

--- Comment #2 from Simon Klinkert <simon.klinkert [at] gmail> ---
(In reply to Eric Covener from comment #1)
> That looks too general, your symptom is that you pass file%#12file into a
> rewriterule (-U check?) and it needs to be encoded at that point, but the
> patch would re-escape anyone who sent in a properly escaped URL.

First of all, thanks for your feedback!

How do I encode the uri at "that point"?

There is no -U involved. My rewrite rule looks like this:

RewriteRule ^(/.*)? %{LA-U:ENV:storage_path}$1 [L]

In addition, I do not really see why this should be too general. The function
ap_sub_req_method_uri does already a re-escaping if new_uri does not start with
'/'. Why is that bad for the other case?

--
You are receiving this mail because:
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: bugs-unsubscribe [at] httpd
For additional commands, e-mail: bugs-help [at] httpd


bugzilla at apache

Jul 29, 2013, 5:43 AM

Post #3 of 6 (48 views)
Permalink
[Bug 55323] Double unescaped uri in sub request handler [In reply to]

https://issues.apache.org/bugzilla/show_bug.cgi?id=55323

--- Comment #3 from Eric Covener <covener [at] gmail> ---
(In reply to Simon Klinkert from comment #2)
> (In reply to Eric Covener from comment #1)
> > That looks too general, your symptom is that you pass file%#12file into a
> > rewriterule (-U check?) and it needs to be encoded at that point, but the
> > patch would re-escape anyone who sent in a properly escaped URL.
>
> First of all, thanks for your feedback!
>
> How do I encode the uri at "that point"?
>
> There is no -U involved. My rewrite rule looks like this:
>
> RewriteRule ^(/.*)? %{LA-U:ENV:storage_path}$1 [L]

$1 has captured a URL-escaped string. I think you can re-escabe it with the [B]
flag, or pull the unescaped version out of %{THE_REQUEST} in a rewritecond.

> In addition, I do not really see why this should be too general. The
> function ap_sub_req_method_uri does already a re-escaping if new_uri does
> not start with '/'. Why is that bad for the other case?

Sorry, did not look to closely and not too familiar with it. Was just concerned
generally about the scope of the change.

--
You are receiving this mail because:
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: bugs-unsubscribe [at] httpd
For additional commands, e-mail: bugs-help [at] httpd


bugzilla at apache

Jul 29, 2013, 5:49 AM

Post #4 of 6 (48 views)
Permalink
[Bug 55323] Double unescaped uri in sub request handler [In reply to]

https://issues.apache.org/bugzilla/show_bug.cgi?id=55323

--- Comment #4 from Eric Covener <covener [at] gmail> ---
> $1 has captured a URL-escaped string. I think you can re-escabe it with the
> [B] flag, or pull the unescaped version out of %{THE_REQUEST} in a
> rewritecond.

Duh, I mean: $1 has captured an un-escaped

--
You are receiving this mail because:
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: bugs-unsubscribe [at] httpd
For additional commands, e-mail: bugs-help [at] httpd


bugzilla at apache

Jul 29, 2013, 7:24 AM

Post #5 of 6 (47 views)
Permalink
[Bug 55323] Double unescaped uri in sub request handler [In reply to]

https://issues.apache.org/bugzilla/show_bug.cgi?id=55323

--- Comment #5 from Simon Klinkert <simon.klinkert [at] gmail> ---
(In reply to Eric Covener from comment #4)
> > $1 has captured a URL-escaped string. I think you can re-escabe it with the
> > [B] flag, or pull the unescaped version out of %{THE_REQUEST} in a
> > rewritecond.
>
> Duh, I mean: $1 has captured an un-escaped

The [B] flag didn't work for me (it has no effect), but I've no idea why. I
will give it some further investigation later on.

%{THE_REQUEST} might work, but that's rather a workaround than a real fix.

--
You are receiving this mail because:
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: bugs-unsubscribe [at] httpd
For additional commands, e-mail: bugs-help [at] httpd


bugzilla at apache

Aug 5, 2013, 6:17 AM

Post #6 of 6 (22 views)
Permalink
[Bug 55323] Double unescaped uri in sub request handler [In reply to]

https://issues.apache.org/bugzilla/show_bug.cgi?id=55323

--- Comment #6 from Simon Klinkert <simon.klinkert [at] gmail> ---
Ok, I think the [B] flag doesn't work because there is no way to reach the
backreference code path in function do_expand in my case. From the log files I
can see that the double unescaping happens while we do a variable lookup for
LA-U:ENV:storage_path. The variable lookup/subrequest is triggered by function
do_expand as well. Maybe it's easier to understand if you take a look at my
initially posted stack trace.

I think it's still ok to change the unescaping behavior in the sub request
handler.

--
You are receiving this mail because:
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: bugs-unsubscribe [at] httpd
For additional commands, e-mail: bugs-help [at] httpd

Apache bugs RSS feed   Index | Next | Previous | View Threaded
 
 


Interested in having your list archived? Contact Gossamer Threads
 
  Web Applications & Managed Hosting Powered by Gossamer Threads Inc.