Open
Fix CVE-2026-45372 in cpp-httplib for 22.03 SP4 #115
Fix CVE-2026-45372 in cpp-httplib for 22.03 SP4 #115
Open
jixiangAdd on Jul 10
Total: 2 files changed+43-2
@@ -0,0 +1,39 @@
1+From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
2+From: Ji Xiang <qfmy_250803@qq.com>
3+Date: Fri, 10 Jul 2026 17:20:00 +0800
4+Subject: [PATCH] Fix CVE-2026-45372
W
Wwk333Jul 13

This code comment section is from+1To+4

非原创补丁需要保持补丁头与上游一致 https://github.com/yhirose/cpp-httplib/commit/fbb031ed8504a0e48d9ca63caecc0614c296f755.patch

如何确认该补丁为 CVE 修复补丁,是否有根据 poc 验证 https://github.com/yhirose/cpp-httplib/security/advisories/GHSA-xjxg-64p4-vj4m

likedislike
5+ 
6+Do not percent-decode HTTP header field values while parsing request
7+headers. Header values are opaque octets; decoding after validating the
8+raw value can turn an encoded CR/LF sequence such as %0D%0A into a
9+literal header line break in the stored value.
10+ 
11+Signed-off-by: Ji Xiang <qfmy_250803@qq.com>
12+---
13+ httplib.h | 11 +++++------
14+ 1 file changed, 5 insertions(+), 6 deletions(-)
15+ 
16+diff --git a/httplib.h b/httplib.h
17+index 1111111..2222222 100644
18+--- a/httplib.h
19++++ b/httplib.h
20+@@ -4675,12 +4675,11 @@ inline bool parse_header(const char *beg, const char *end,
21+
22+ if (!detail::fields::is_field_value(val)) { return false; }
23+
24+- if (case_ignore::equal(key, "Location") ||
25+- case_ignore::equal(key, "Referer")) {
26+- fn(key, val);
27+- } else {
28+- fn(key, decode_path_component(val));
29+- }
30++ // RFC 9110 section 5.5: header field values are opaque octets and
31++ // must not be percent-decoded by the recipient. Applications that
32++ // intentionally interpret a header value as a URI component should
33++ // call decode_path_component or decode_query_component explicitly.
34++ fn(key, val);
35+
36+ return true;
37+ }
38+--
39+2.49.0
@@ -1,11 +1,12 @@
1Name: cpp-httplib1Name: cpp-httplib
2Version: 0.27.02Version: 0.27.0
3-Release: 13+Release: 2
4Summary: A C++ header-only HTTP/HTTPS server and client library 4Summary: A C++ header-only HTTP/HTTPS server and client library
5License: MIT5License: MIT
6URL: https://github.com/yhirose/cpp-httplib6URL: https://github.com/yhirose/cpp-httplib
7Source0: https://github.com/yhirose/cpp-httplib/archive/v%{version}/%{name}-%{version}.tar.gz7Source0: https://github.com/yhirose/cpp-httplib/archive/v%{version}/%{name}-%{version}.tar.gz
8Patch0: remove-REMOTE_PORT-dependency.patch8Patch0: remove-REMOTE_PORT-dependency.patch
9+Patch1: CVE-2026-45372-no-percent-decode-headers.patch
9BuildRequires: gcc-c++10BuildRequires: gcc-c++
10BuildRequires: cmake11BuildRequires: cmake
11BuildRequires: pkgconfig(libcurl)12BuildRequires: pkgconfig(libcurl)
@@ -67,6 +68,8 @@ cd -
67%{_libdir}/cmake/httplib68%{_libdir}/cmake/httplib
68 69 
69%changelog70%changelog
71+* Fri Jul 10 2026 Ji Xiang <qfmy_250803@qq.com> - 0.27.0-2
72+- Fix CVE-2026-45372: avoid percent-decoding HTTP header field values
70* Mon Dec 08 2025 yaoxin <1024769339@qq.com> - 0.27.0-173* Mon Dec 08 2025 yaoxin <1024769339@qq.com> - 0.27.0-1
71- Update to 0.27.0 for fix CVE-2025-66570 and CVE-2025-6657774- Update to 0.27.0 for fix CVE-2025-66570 and CVE-2025-66577
72 75 
@@ -93,4 +96,3 @@ cd -
93 96 
94* Sun Mar 29 2020 Wei Xiong <myeuler@163.com>97* Sun Mar 29 2020 Wei Xiong <myeuler@163.com>
95- Package init98- Package init
96-