]> git.ipfire.org Git - thirdparty/apache/httpd.git/commitdiff
mod_proxy: Check the query-string for proxy-noencode too.
authorYann Ylavic <ylavic@apache.org>
Fri, 10 Mar 2023 21:02:31 +0000 (21:02 +0000)
committerYann Ylavic <ylavic@apache.org>
Fri, 10 Mar 2023 21:02:31 +0000 (21:02 +0000)
Follow up to r1907972 and r1908095.

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1908257 13f79535-47bb-0310-9956-ffa450edef68

modules/http2/mod_proxy_http2.c
modules/proxy/mod_proxy_ajp.c
modules/proxy/mod_proxy_balancer.c
modules/proxy/mod_proxy_http.c
modules/proxy/mod_proxy_wstunnel.c

index 719c2119f93f2e8eb056763c84d5127be7c245a0..f1c1bb92f4eb645dc240f07b4b19a8eda510a147 100644 (file)
@@ -162,16 +162,16 @@ static int proxy_http2_canon(request_rec *r, char *url)
             path = ap_proxy_canonenc(r->pool, url, (int)strlen(url),
                                      enc_path, 0, r->proxyreq);
             search = r->args;
-            if (search && *(ap_scan_vchar_obstext(search))) {
-                /*
-                 * We have a raw control character or a ' ' in r->args.
-                 * Correct encoding was missed.
-                 */
-                ap_log_rerror(APLOG_MARK, APLOG_ERR, 0, r, APLOGNO(10412)
-                              "To be forwarded query string contains control "
-                              "characters or spaces");
-                return HTTP_FORBIDDEN;
-            }
+        }
+        if (search && *ap_scan_vchar_obstext(search)) {
+            /*
+             * We have a raw control character or a ' ' in r->args.
+             * Correct encoding was missed.
+             */
+            ap_log_rerror(APLOG_MARK, APLOG_ERR, 0, r, APLOGNO(10412)
+                          "To be forwarded query string contains control "
+                          "characters or spaces");
+            return HTTP_FORBIDDEN;
         }
         break;
     case PROXYREQ_PROXY:
index ddbb098f12b7b9bd3ec0dc11913da492f43530d0..d7fd47574c6ff2f12ff2240563567a641f9195f2 100644 (file)
@@ -73,16 +73,16 @@ static int proxy_ajp_canon(request_rec *r, char *url)
         path = ap_proxy_canonenc(r->pool, url, strlen(url), enc_path, 0,
                                  r->proxyreq);
         search = r->args;
-        if (search && *(ap_scan_vchar_obstext(search))) {
-            /*
-             * We have a raw control character or a ' ' in r->args.
-             * Correct encoding was missed.
-             */
-             ap_log_rerror(APLOG_MARK, APLOG_ERR, 0, r, APLOGNO(10406)
-                           "To be forwarded query string contains control "
-                           "characters or spaces");
-             return HTTP_FORBIDDEN;
-        }
+    }
+    if (search && *ap_scan_vchar_obstext(search)) {
+        /*
+         * We have a raw control character or a ' ' in r->args.
+         * Correct encoding was missed.
+         */
+         ap_log_rerror(APLOG_MARK, APLOG_ERR, 0, r, APLOGNO(10406)
+                       "To be forwarded query string contains control "
+                       "characters or spaces");
+         return HTTP_FORBIDDEN;
     }
     if (path == NULL)
         return HTTP_BAD_REQUEST;
index 5d77d23429c467017b36c04a030aa2f9abc63791..0d510113670e7bec9e5ec03f2747929e12593391 100644 (file)
@@ -110,16 +110,16 @@ static int proxy_balancer_canon(request_rec *r, char *url)
         path = ap_proxy_canonenc(r->pool, url, strlen(url), enc_path, 0,
                                  r->proxyreq);
         search = r->args;
-        if (search && *(ap_scan_vchar_obstext(search))) {
-            /*
-             * We have a raw control character or a ' ' in r->args.
-             * Correct encoding was missed.
-             */
-             ap_log_rerror(APLOG_MARK, APLOG_ERR, 0, r, APLOGNO(10407)
-                           "To be forwarded query string contains control "
-                           "characters or spaces");
-             return HTTP_FORBIDDEN;
-        }
+    }
+    if (search && *ap_scan_vchar_obstext(search)) {
+        /*
+         * We have a raw control character or a ' ' in r->args.
+         * Correct encoding was missed.
+         */
+         ap_log_rerror(APLOG_MARK, APLOG_ERR, 0, r, APLOGNO(10407)
+                       "To be forwarded query string contains control "
+                       "characters or spaces");
+         return HTTP_FORBIDDEN;
     }
     if (path == NULL)
         return HTTP_BAD_REQUEST;
index 5d2826a14bd92953e4e15c7160b1a51c164f0459..1ec5fe1134040659b78c76ca5a786757b76d9045 100644 (file)
@@ -126,16 +126,16 @@ static int proxy_http_canon(request_rec *r, char *url)
             path = ap_proxy_canonenc(r->pool, url, strlen(url),
                                      enc_path, 0, r->proxyreq);
             search = r->args;
-            if (search && *(ap_scan_vchar_obstext(search))) {
-                /*
-                 * We have a raw control character or a ' ' in r->args.
-                 * Correct encoding was missed.
-                 */
-                ap_log_rerror(APLOG_MARK, APLOG_ERR, 0, r, APLOGNO(10408)
-                              "To be forwarded query string contains control "
-                              "characters or spaces");
-                return HTTP_FORBIDDEN;
-            }
+        }
+        if (search && *ap_scan_vchar_obstext(search)) {
+            /*
+             * We have a raw control character or a ' ' in r->args.
+             * Correct encoding was missed.
+             */
+            ap_log_rerror(APLOG_MARK, APLOG_ERR, 0, r, APLOGNO(10408)
+                          "To be forwarded query string contains control "
+                          "characters or spaces");
+            return HTTP_FORBIDDEN;
         }
         break;
     case PROXYREQ_PROXY:
index b2349d4a24bc7706fd392b647bb07446083dd2e8..d1db872e119e2963d527cf8cdb145f692fd94c19 100644 (file)
@@ -203,16 +203,16 @@ static int proxy_wstunnel_canon(request_rec *r, char *url)
         path = ap_proxy_canonenc(r->pool, url, strlen(url), enc_path, 0,
                                  r->proxyreq);
         search = r->args;
-        if (search && *(ap_scan_vchar_obstext(search))) {
-            /*
-             * We have a raw control character or a ' ' in r->args.
-             * Correct encoding was missed.
-             */
-            ap_log_rerror(APLOG_MARK, APLOG_ERR, 0, r, APLOGNO(10409)
-                          "To be forwarded query string contains control "
-                          "characters or spaces");
-            return HTTP_FORBIDDEN;
-        }
+    }
+    if (search && *ap_scan_vchar_obstext(search)) {
+        /*
+         * We have a raw control character or a ' ' in r->args.
+         * Correct encoding was missed.
+         */
+        ap_log_rerror(APLOG_MARK, APLOG_ERR, 0, r, APLOGNO(10409)
+                      "To be forwarded query string contains control "
+                      "characters or spaces");
+        return HTTP_FORBIDDEN;
     }
     if (path == NULL)
         return HTTP_BAD_REQUEST;