]> git.ipfire.org Git - thirdparty/apache/httpd.git/commit
mpm_proxy: Fix possible reuse/merging of Proxy(Pass)Match workers. PR 65419.
authorYann Ylavic <ylavic@apache.org>
Fri, 2 Jul 2021 14:58:46 +0000 (14:58 +0000)
committerYann Ylavic <ylavic@apache.org>
Fri, 2 Jul 2021 14:58:46 +0000 (14:58 +0000)
commit542efc0f007bc5b36486a929bc37a2d749f2a3d8
tree84a11c88f8c6465a11fb2400d42d221241fc4f3f
parent90743b00c7ff34f1fa45d51cb29b9b21209f776a
mpm_proxy: Fix possible reuse/merging of Proxy(Pass)Match workers.  PR 65419.

We can't truncate ProxyMatch's worker name/url to the first '$' substitution
without possibly colliding with other workers. This also makes the matching
done at runtime by ap_proxy_strcmp_ematch() completely pointless.

To fix this and still address r1878467 (i.e. make http://host:port$1 a "valid"
URL), we need to remove '$' substitutions from the :port part of the URL only
since it's allowed anywhere else by apr_uri_parse().

So let's strip them before apr_uri_parse() and prepend them back in the path
before apr_uri_unparse() to restore the original URL. Non-matchable workers are
not concerned so ap_proxy_define_worker() is made a local helper (w/o the ap_
prefix) which takes "matchable" as argument and can then be called by both
ap_proxy_define_[match_]worker() functions.

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1891206 13f79535-47bb-0310-9956-ffa450edef68
changes-entries/proxy_define_matchable_worker.txt [new file with mode: 0644]
modules/proxy/proxy_util.c