Skip to content

Commit f13ef2d

Browse files
[AUTO-CHERRYPICK] [High] Patch libsoup for CVE-2025-32913, CVE-2025-32906 - branch main (#13495)
Co-authored-by: Kevin Lockwood <57274670+kevin-b-lockwood@users.noreply.github.com>
1 parent 4ef16b4 commit f13ef2d

3 files changed

Lines changed: 75 additions & 1 deletion

File tree

SPECS/libsoup/CVE-2025-32906.patch

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
From e0831346d685ee907065fa5e489e133f8ca12013 Mon Sep 17 00:00:00 2001
2+
From: Patrick Griffis <pgriffis@igalia.com>
3+
Date: Wed, 12 Feb 2025 11:30:02 -0600
4+
Subject: [PATCH] headers: Handle parsing only newlines
5+
6+
Closes #404
7+
Closes #407
8+
9+
Link: https://gitlab.gnome.org/GNOME/libsoup/-/commit/af5b9a4a3945c52b940d5ac181ef51bb12011f1f.patch
10+
---
11+
libsoup/soup-headers.c | 4 ++--
12+
1 file changed, 2 insertions(+), 2 deletions(-)
13+
14+
diff --git a/libsoup/soup-headers.c b/libsoup/soup-headers.c
15+
index a0cf351..88aafc9 100644
16+
--- a/libsoup/soup-headers.c
17+
+++ b/libsoup/soup-headers.c
18+
@@ -193,7 +193,7 @@ soup_headers_parse_request (const char *str,
19+
/* RFC 2616 4.1 "servers SHOULD ignore any empty line(s)
20+
* received where a Request-Line is expected."
21+
*/
22+
- while ((*str == '\r' || *str == '\n') && len > 0) {
23+
+ while (len > 0 && (*str == '\r' || *str == '\n')) {
24+
str++;
25+
len--;
26+
}
27+
@@ -378,7 +378,7 @@ soup_headers_parse_response (const char *str,
28+
* after a response, which we then see prepended to the next
29+
* response on that connection.
30+
*/
31+
- while ((*str == '\r' || *str == '\n') && len > 0) {
32+
+ while (len > 0 && (*str == '\r' || *str == '\n')) {
33+
str++;
34+
len--;
35+
}
36+
--
37+
2.34.1
38+

SPECS/libsoup/CVE-2025-32913.patch

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
From 260ce178f526f4b8baaa1cafc6e1e81fab225f53 Mon Sep 17 00:00:00 2001
2+
From: Patrick Griffis <pgriffis@igalia.com>
3+
Date: Fri, 27 Dec 2024 18:00:39 -0600
4+
Subject: [PATCH] soup_message_headers_get_content_disposition: strdup
5+
truncated filenames
6+
7+
This table frees the strings it contains.
8+
Link: https://gitlab.gnome.org/GNOME/libsoup/-/commit/f4a761fb66512fff59798765e8ac5b9e57dceef0.patch
9+
---
10+
libsoup/soup-message-headers.c | 2 +-
11+
1 file changed, 1 insertion(+), 1 deletion(-)
12+
13+
diff --git a/libsoup/soup-message-headers.c b/libsoup/soup-message-headers.c
14+
index bcee5b9..18cbf98 100644
15+
--- a/libsoup/soup-message-headers.c
16+
+++ b/libsoup/soup-message-headers.c
17+
@@ -1611,7 +1611,7 @@ soup_message_headers_get_content_disposition (SoupMessageHeaders *hdrs,
18+
char *filename = strrchr (orig_value, '/');
19+
20+
if (filename)
21+
- g_hash_table_insert (*params, g_strdup (orig_key), filename + 1);
22+
+ g_hash_table_insert (*params, g_strdup (orig_key), g_strdup (filename + 1));
23+
}
24+
return TRUE;
25+
}
26+
--
27+
2.34.1
28+

SPECS/libsoup/libsoup.spec

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
Summary: libsoup HTTP client/server library
33
Name: libsoup
44
Version: %{BaseVersion}.4
5-
Release: 2%{?dist}
5+
Release: 3%{?dist}
66
License: GPLv2
77
Vendor: Microsoft Corporation
88
Distribution: Mariner
@@ -13,6 +13,10 @@ Source0: https://ftp.gnome.org/pub/GNOME/sources/libsoup/%{BaseVersion}/%
1313
Patch: CVE-2024-52530.patch
1414
Patch: CVE-2024-52531.patch
1515
Patch: CVE-2024-52532.patch
16+
# CVE-2025-32913 will be fixed in 3.6.2 by https://gitlab.gnome.org/GNOME/libsoup/-/commit/f4a761fb66512fff59798765e8ac5b9e57dceef0
17+
Patch: CVE-2025-32913.patch
18+
# CVE-2025-32906 will be fixed in 3.6.5 by https://gitlab.gnome.org/GNOME/libsoup/-/commit/af5b9a4a3945c52b940d5ac181ef51bb12011f1f
19+
Patch: CVE-2025-32906.patch
1620

1721
BuildRequires: meson
1822
BuildRequires: autogen
@@ -124,6 +128,10 @@ find %{buildroot} -type f -name "*.la" -delete -print
124128
%defattr(-,root,root)
125129

126130
%changelog
131+
* Wed Apr 16 2025 Kevin Lockwood <v-klockwood@microsoft.com> - 3.0.4-3
132+
- Add patch for CVE-2025-32913
133+
- Add patch for CVE-2025-32906
134+
127135
* Fri Nov 15 2024 Thien Trung Vuong <tvuong@microsoft.com> - 3.0.4-2
128136
- Add patches for CVE-2024-52530, CVE-2024-52531, CVE-2024-52532
129137

0 commit comments

Comments
 (0)