]> git.ipfire.org Git - thirdparty/apache/httpd.git/commitdiff
Merge r1935007 from trunk:
authorEric Covener <covener@apache.org>
Fri, 5 Jun 2026 10:07:34 +0000 (10:07 +0000)
committerEric Covener <covener@apache.org>
Fri, 5 Jun 2026 10:07:34 +0000 (10:07 +0000)
ap_proxy_cookie_revers: fix dup path/domain

Reviewed By: covener, jailletc36, jfclere

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/2.4.x@1935008 13f79535-47bb-0310-9956-ffa450edef68

modules/proxy/proxy_util.c

index 00fedb1adfbbe2f15b1f345cbc73c138088df798..81b7de2a695887799ac8bf431d3d87c89abb0bf4 100644 (file)
@@ -1036,6 +1036,12 @@ PROXY_DECLARE(const char *) ap_proxy_cookie_reverse_map(request_rec *r,
             poffs = pathp - tmpstr_orig;
             l1 = strlen(pathp);
             pathe = str + poffs + l1;
+            /*
+             * RFC 6265 § 5.3 7): Only the last path= should be meaningful
+             * so reset anything previously found.
+             */
+            newpath = NULL;
+            pdiff = 0;
             if (conf->interpolate_env == 1) {
                 ent = (struct proxy_alias *)rconf->cookie_paths->elts;
             }
@@ -1056,6 +1062,12 @@ PROXY_DECLARE(const char *) ap_proxy_cookie_reverse_map(request_rec *r,
             doffs = domainp - tmpstr_orig;
             l1 = strlen(domainp);
             domaine = str + doffs + l1;
+            /*
+             * RFC 6265 § 5.3 4): Only the last domain= should be meaningful
+             * so reset anything previously found.
+             */
+            newdomain = NULL;
+            ddiff = 0;
             if (conf->interpolate_env == 1) {
                 ent = (struct proxy_alias *)rconf->cookie_domains->elts;
             }