51b23565c0
in mod_rewrite (CVE-2024-38474) Resolves: RHEL-45785 - httpd:2.4/httpd: Encoding problem in mod_proxy (CVE-2024-38473) Resolves: RHEL-45777 - httpd:2.4/httpd: Improper escaping of output in mod_rewrite (CVE-2024-38475) Resolves: RHEL-45758 - httpd:2.4/httpd: null pointer dereference in mod_proxy (CVE-2024-38477) Resolves: RHEL-45743 - httpd:2.4/httpd: Potential SSRF in mod_rewrite (CVE-2024-39573)
30 lines
1.2 KiB
Diff
30 lines
1.2 KiB
Diff
diff --git a/modules/proxy/proxy_util.c b/modules/proxy/proxy_util.c
|
|
index 6244e74..f5c3283 100644
|
|
--- a/modules/proxy/proxy_util.c
|
|
+++ b/modules/proxy/proxy_util.c
|
|
@@ -2406,6 +2406,13 @@ ap_proxy_determine_connection(apr_pool_t *p, request_rec *r,
|
|
apr_pstrcat(p,"URI cannot be parsed: ", *url,
|
|
NULL));
|
|
}
|
|
+
|
|
+ if (!uri->hostname) {
|
|
+ return ap_proxyerror(r, HTTP_BAD_REQUEST,
|
|
+ apr_pstrcat(p,"URI has no hostname: ", *url,
|
|
+ NULL));
|
|
+ }
|
|
+
|
|
if (!uri->port) {
|
|
uri->port = ap_proxy_port_of_scheme(uri->scheme);
|
|
}
|
|
@@ -3727,6 +3734,10 @@ PROXY_DECLARE(int) ap_proxy_create_hdrbrgd(apr_pool_t *p,
|
|
* way. No telling which legacy backend is relying no this.
|
|
*/
|
|
if (dconf->preserve_host == 0) {
|
|
+ if (!uri->hostname) {
|
|
+ rc = HTTP_BAD_REQUEST;
|
|
+ goto cleanup;
|
|
+ }
|
|
if (ap_strchr_c(uri->hostname, ':')) { /* if literal IPv6 address */
|
|
if (uri->port_str && uri->port != DEFAULT_HTTP_PORT) {
|
|
buf = apr_pstrcat(p, "Host: [", uri->hostname, "]:",
|