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 2013/07/26 23:18:04 UTC

[Bug 55315] New: error in ProxyPass URL parsing with interpolation

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

            Bug ID: 55315
           Summary: error in ProxyPass URL parsing with interpolation
           Product: Apache httpd-2
           Version: 2.2.25
          Hardware: PC
            Status: NEW
          Severity: regression
          Priority: P2
         Component: mod_proxy
          Assignee: bugs@httpd.apache.org
          Reporter: jason.guild@alaska.gov

Possible parsing regression in mod_proxy regarding interpolation of environment
variables into URLs specified in ProxyPass and ProxyPassReverse directives.

I have a virtual host which acts as a reverse proxy to an application 
running elsewhere which must preserve the protocol used by the incoming request
(HTTP or HTTPS) when making the proxied request.

This was accomplished easily in httpd 2.2.21 with the following statements:

     ProxyPassInterpolateEnv On
     RewriteEngine On

     RewriteCond %{HTTPS} =off
     RewriteRule . - [E=protocol:http]
     RewriteCond %{HTTPS} =on
     RewriteRule . - [E=protocol:https]

     ProxyPass /my_app/ ${protocol}://1.2.3.4/my_app/ interpolate
     ProxyPassReverse /my_app/ ${protocol}://1.2.3.4/my_app/ interpolate

When I upgraded to httpd 2.2.25, the server now chokes on parsing the 
URLs of the ProxyPass and ProxyPassReverse statements above.
Removing the ${protocol} from those URLs allows the server to start.

I am using the official binary distribution of httpd available from:
http://www.us.apache.org/dist//httpd/binaries/win32/httpd-2.2.25-win32-x86-openssl-0.9.8y.msi

I just downgraded to the last official win32 binary for 2.2.22 and I can
confirm that this problem does not exist there.

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

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


[Bug 55315] error in ProxyPass URL parsing with interpolation

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=55315

Jason Guild <ja...@alaska.gov> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 OS|                            |Windows 7

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

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


[Bug 55315] error in ProxyPass URL parsing with interpolation

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=55315

Mike Rumph <mi...@oracle.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 OS|                            |All

--- Comment #1 from Mike Rumph <mi...@oracle.com> ---
My tests have confirmed that the same result occurs on Linux.

Running Apache httpd 2.2.22 with the described configuration successfully
proxies over to the target server.

Running Apache httpd 2.2.25 fails to start.
- $bin/apachectl -k start
  - Syntax error of line n of .../conf/httpd.conf:
  - ProxyPass Unable to parse URL
And replacing the ${protocol} with http allows the server to start and
successfully proxies over to the target server.

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

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


[Bug 55315] error in ProxyPass URL parsing with interpolation

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=55315

Jason Guild <ja...@alaska.gov> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 OS|                            |Windows 7

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

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


[Bug 55315] error in ProxyPass URL parsing with interpolation

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=55315

--- Comment #4 from Mike Rumph <mi...@oracle.com> ---
Created attachment 30799
  --> https://issues.apache.org/bugzilla/attachment.cgi?id=30799&action=edit
Alternative patch that doesn't change the httpd API

It was pointed out on the httpd dev mailing list that the previous patch can
not be applied to the branches, since it changes the API by adding a parameter.

So I've submitted an alternative patch that is applied directly against
add_pass() in mod_proxy.c.

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

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


[Bug 55315] error in ProxyPass URL parsing with interpolation

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=55315

--- Comment #2 from Mike Rumph <mi...@oracle.com> ---
Created attachment 30727
  --> https://issues.apache.org/bugzilla/attachment.cgi?id=30727&action=edit
A quick patch to allow mod_proxy interpolation characters through URI parsing

This bug is described as a regression in Apache httpd 2.2.25.
But it is actually a regression in Apache APR-util 1.5.2.
The regression occurs as result of the fix for APR-util bug 52479.
The apr_uri_parse function in apr-util/uri/apr_uri.c was no longer allowing the
mod_proxy interpolation characters to pass through unaltered.

I have attached a patch that allows the characters to pass through clean.
The listed directives will now work as the reporter expected.

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

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


[Bug 55315] error in ProxyPass URL parsing with interpolation

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=55315

Jeff Trawick <tr...@apache.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|RESOLVED                    |CLOSED

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

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


[Bug 55315] error in ProxyPass URL parsing with interpolation

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=55315

Jeff Trawick <tr...@apache.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|---                         |WONTFIX

--- Comment #5 from Jeff Trawick <tr...@apache.org> ---
Lack of support for interpolation within scheme will be a permanent limitation.
 An alternate configuration mechanism for switching between http and https is
now provided in the documentation, along with a statement for lack of support.

Trunk: http://svn.apache.org/r1532816
2.4.x branch: http://svn.apache.org/r1532824
2.2.x branch:  http://svn.apache.org/r1532825

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

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


[Bug 55315] error in ProxyPass URL parsing with interpolation

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=55315

--- Comment #3 from Mike Rumph <mi...@oracle.com> ---
Created attachment 30777
  --> https://issues.apache.org/bugzilla/attachment.cgi?id=30777&action=edit
A patch to support interpolation within the scheme portion of a URL

Since the URL validation in the apr_uri_parse function in util/apr_uri.c has
become more strict in how the scheme portion is handled, I am submitting a
patch to the mod_proxy code to handle the special case of interpolating a
variable in the scheme portion of a URL.

This patch is against httpd trunk.

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

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


[Bug 55315] error in ProxyPass URL parsing with interpolation

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=55315

Mike Rumph <mi...@oracle.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |PatchAvailable

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

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