1 Star 0 Fork 35

panzhe / httpd

forked from src-openEuler / httpd 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
backport-004-CVE-2021-40438.patch 1.55 KB
一键复制 编辑 原始数据 按行查看 历史
eaglegai 提交于 2021-09-29 19:13 . fix CVE-2021-40438 fully and correctly
From 81a8b0133b46c4cf7dfc4b5476ad46eb34aa0a5c Mon Sep 17 00:00:00 2001
From: Stefan Eissing <icing@apache.org>
Date: Thu, 23 Sep 2021 12:31:53 +0000
Subject: [PATCH] backport of 1893519,1893532 from trunk:
*) mod_proxy: Handle UDS URIs with empty hostname ("unix:///...") as if they
had no hostname ("unix:/..."), also in mod_rewrite's is_absolulte_uri().
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/2.4.x@1893559 13f79535-47bb-0310-9956-ffa450edef68
---
modules/mappers/mod_rewrite.c | 2 +-
modules/proxy/proxy_util.c | 3 ++-
2 files changed, 3 insertions(+), 2 deletions(-)
create mode 100644 changes-entries/uds_empty_hostname.txt
--- a/modules/mappers/mod_rewrite.c
+++ b/modules/mappers/mod_rewrite.c
@@ -622,7 +622,7 @@ static unsigned is_absolute_uri(char *ur
case 'U':
if (!ap_cstr_casecmpn(uri, "nix:", 4)) { /* unix: */
*sqs = 1;
- return 5;
+ return (uri[4] == '/' && uri[5] == '/') ? 7 : 5;
}
}
--- a/modules/proxy/proxy_util.c
+++ b/modules/proxy/proxy_util.c
@@ -2217,7 +2217,8 @@ static int fix_uds_filename(request_rec
rv = apr_uri_parse(r->pool, uds_url, &urisock);
*origin_url++ = '|';
- if (rv == APR_SUCCESS && urisock.path && !urisock.hostname) {
+ if (rv == APR_SUCCESS && urisock.path && (!urisock.hostname
+ || !urisock.hostname[0])) {
uds_path = ap_runtime_dir_relative(r->pool, urisock.path);
}
if (!uds_path) {
1
https://gitee.com/panzhe0328/httpd.git
git@gitee.com:panzhe0328/httpd.git
panzhe0328
httpd
httpd
master

搜索帮助