已开启
fix CVE-2024-40898 #251
wxm创建于 2025年8月29日
fix CVE-2024-40898 #251
已开启
从refs/pull/251/head合入到master
共 2 个文件变更+60-1
| @@ -0,0 +1,52 @@ | |||
| 1 | +From b1560d34a37681ebc18baa78588579ed87f9da70 Mon Sep 17 00:00:00 2001 | ||
| 2 | +From: Eric Covener <covener@apache.org> | ||
| 3 | +Date: Mon, 15 Jul 2024 12:05:57 +0000 | ||
| 4 | +Subject: [PATCH] merge leading slashes by default | ||
| 5 | + | ||
| 6 | +git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1919246 13f79535-47bb-0310-9956-ffa450edef68 | ||
| 7 | +--- | ||
| 8 | + modules/mappers/mod_rewrite.c | 14 ++++++++++++++ | ||
| 9 | + 1 file changed, 14 insertions(+) | ||
| 10 | + | ||
| 11 | +diff --git a/modules/mappers/mod_rewrite.c b/modules/mappers/mod_rewrite.c | ||
| 12 | +index 0d928e4b99..439af886ba 100644 | ||
| 13 | +--- a/modules/mappers/mod_rewrite.c | ||
| 14 | ++++ b/modules/mappers/mod_rewrite.c | ||
| 15 | + static const char* really_last_key = "rewrite_really_last"; | ||
| 16 | + #define RULEFLAG_ESCAPECTLS (1<<21) | ||
| 17 | + #define RULEFLAG_UNSAFE_PREFIX_STAT (1<<22) | ||
| 18 | + #define RULEFLAG_UNSAFE_ALLOW3F (1<<23) | ||
| 19 | ++#define RULEFLAG_UNC (1<<24) | ||
| 20 | + | ||
| 21 | + /* return code of the rewrite rule | ||
| 22 | + * the result may be escaped - or not | ||
| 23 | + static const char *cmd_rewriterule_setflag(apr_pool_t *p, void *_cfg, | ||
| 24 | + else if(!strcasecmp(key, "nsafeAllow3F")) { | ||
| 25 | + cfg->flags |= RULEFLAG_UNSAFE_ALLOW3F; | ||
| 26 | + } | ||
| 27 | ++ else if(!strcasecmp(key, "NC")) { | ||
| 28 | ++ cfg->flags |= RULEFLAG_UNC; | ||
| 29 | ++ } | ||
| 30 | + else { | ||
| 31 | + ++error; | ||
| 32 | + } | ||
| 33 | + static rule_return_type apply_rewrite_rule(rewriterule_entry *p, | ||
| 34 | + return RULE_RC_MATCH; | ||
| 35 | + } | ||
| 36 | + | ||
| 37 | ++ if (!(p->flags & RULEFLAG_UNC)) { | ||
| 38 | ++ /* merge leading slashes, unless they were literals in the sub */ | ||
| 39 | ++ if (!AP_IS_SLASH(p->output[0]) || !AP_IS_SLASH(p->output[1])) { | ||
| 40 | ++ while (AP_IS_SLASH(r->filename[0]) && | ||
| 41 | ++ AP_IS_SLASH(r->filename[1])) { | ||
| 42 | ++ r->filename++; | ||
| 43 | ++ } | ||
| 44 | ++ } | ||
| 45 | ++ } | ||
| 46 | ++ | ||
| 47 | + /* Finally remember the forced mime-type */ | ||
| 48 | + force_type_handler(p, ctx); | ||
| 49 | + | ||
| 50 | +-- | ||
| 51 | +2.25.1 | ||
| 52 | + | ||
| @@ -8,7 +8,7 @@ | |||
| 8 | Name: httpd | 8 | Name: httpd |
| 9 | Summary: Apache HTTP Server | 9 | Summary: Apache HTTP Server |
| 10 | Version: 2.4.58 | 10 | Version: 2.4.58 |
| 11 | -Release: 10 | 11 | +Release: 11 |
| 12 | License: ASL 2.0 | 12 | License: ASL 2.0 |
| 13 | URL: https://httpd.apache.org/ | 13 | URL: https://httpd.apache.org/ |
| 14 | Source0: https://archive.apache.org/dist/httpd/httpd-%{version}.tar.bz2 | 14 | Source0: https://archive.apache.org/dist/httpd/httpd-%{version}.tar.bz2 |
| @@ -103,6 +103,7 @@ Patch49: backport-CVE-2025-23048.patch | |||
| 103 | Patch50: backport-CVE-2024-47252.patch | 103 | Patch50: backport-CVE-2024-47252.patch |
| 104 | Patch51: backport-CVE-2024-43204.patch | 104 | Patch51: backport-CVE-2024-43204.patch |
| 105 | Patch52: backport-CVE-2024-42516.patch | 105 | Patch52: backport-CVE-2024-42516.patch |
| 106 | +Patch53: backport-CVE-2024-40898-merge-leading-slashes-by-default.patch | ||
| 106 | 107 | ||
| 107 | BuildRequires: gcc autoconf pkgconfig findutils xmlto perl-interpreter perl-generators systemd-devel | 108 | BuildRequires: gcc autoconf pkgconfig findutils xmlto perl-interpreter perl-generators systemd-devel |
| 108 | BuildRequires: zlib-devel libselinux-devel lua-devel brotli-devel | 109 | BuildRequires: zlib-devel libselinux-devel lua-devel brotli-devel |
| @@ -540,6 +541,12 @@ exit $rv | |||
| 540 | %{_rpmconfigdir}/macros.d/macros.httpd | 541 | %{_rpmconfigdir}/macros.d/macros.httpd |
| 541 | 542 | ||
| 542 | %changelog | 543 | %changelog |
| 544 | +* Fri Aug 29 2025 wangxiaomeng <wangxiaomeng@kylinos.cn> - 2.4.58-11 | ||
| 545 | +- Type:CVE | ||
| 546 | +- ID:CVE-2024-40898 | ||
| 547 | +- SUG:NA | ||
| 548 | +- DESC:fix CVE-2024-40898 | ||
| 549 | + | ||
| 543 | * Wed Aug 13 2025 yanglu <yanglu72@h-partners.com> - 2.4.58-10 | 550 | * Wed Aug 13 2025 yanglu <yanglu72@h-partners.com> - 2.4.58-10 |
| 544 | - Type:CVE | 551 | - Type:CVE |
| 545 | - CVE:CVE-2025-49812,CVE-2025-23048,CVE-2024-47252,CVE-2024-43204,CVE-2024-42516 | 552 | - CVE:CVE-2025-49812,CVE-2025-23048,CVE-2024-47252,CVE-2024-43204,CVE-2024-42516 |