From 839926d27289bf4bf0197fd3680d32a7c8377ced Mon Sep 17 00:00:00 2001 From: tomcruiseqi <10762123+tomcruiseqi@user.noreply.gitee.com> Date: Fri, 13 Jun 2025 13:39:09 +0800 Subject: [PATCH] [CVE] FIX CVE-2025-2784 to #20122 add patch to fix CVE-2025-2784 Project: TC2024080204 Signed-off-by: tomcruiseqi <10762123+tomcruiseqi@user.noreply.gitee.com> --- 0014-bugfix-for-CVE-2025-2784.patch | 48 +++++++++++++++++++++++++++++ libsoup.spec | 6 +++- 2 files changed, 53 insertions(+), 1 deletion(-) create mode 100644 0014-bugfix-for-CVE-2025-2784.patch diff --git a/0014-bugfix-for-CVE-2025-2784.patch b/0014-bugfix-for-CVE-2025-2784.patch new file mode 100644 index 0000000..726abb9 --- /dev/null +++ b/0014-bugfix-for-CVE-2025-2784.patch @@ -0,0 +1,48 @@ +From b7213fc6c639b5ca6c91e215aee18cea36d9dc95 Mon Sep 17 00:00:00 2001 +From: Patrick Griffis +Date: Tue, 18 Feb 2025 14:29:50 -0600 +Subject: [PATCH] sniffer: Add better coverage of skip_insignificant_space() + +--- + libsoup/soup-content-sniffer.c | 10 +++++----- + 1 file changed, 5 insertions(+), 5 deletions(-) + +diff --git a/libsoup/soup-content-sniffer.c b/libsoup/soup-content-sniffer.c +index 698d05e4..3fb29adf 100644 +--- a/libsoup/soup-content-sniffer.c ++++ b/libsoup/soup-content-sniffer.c +@@ -612,8 +612,11 @@ sniff_text_or_binary (SoupContentSniffer *sniffer, SoupBuffer *buffer) + } + + static gboolean +-skip_insignificant_space (const char *resource, int *pos, int resource_length) ++skip_insignificant_space (const char *resource, gsize *pos, gsize resource_length) + { ++ if (*pos >= resource_length) ++ return TRUE; ++ + while ((resource[*pos] == '\x09') || + (resource[*pos] == '\x20') || + (resource[*pos] == '\x0A') || +@@ -632,7 +635,7 @@ sniff_feed_or_html (SoupContentSniffer *sniffer, SoupBuffer *buffer) + { + const char *resource = (const char *)buffer->data; + int resource_length = MIN (512, buffer->length); +- int pos = 0; ++ gsize pos = 0; + + if (resource_length < 3) + goto text_html; +@@ -642,9 +645,6 @@ sniff_feed_or_html (SoupContentSniffer *sniffer, SoupBuffer *buffer) + pos = 3; + + look_for_tag: +- if (pos > resource_length) +- goto text_html; +- + if (skip_insignificant_space (resource, &pos, resource_length)) + goto text_html; + +-- +2.49.0 + diff --git a/libsoup.spec b/libsoup.spec index 8233d95..5f85671 100644 --- a/libsoup.spec +++ b/libsoup.spec @@ -1,4 +1,4 @@ -%define anolis_release 13 +%define anolis_release 14 %define glib2_version 2.58 %{!?with_docs: %global with_docs 1} @@ -25,6 +25,7 @@ Patch10: 0010-bugfix-for-CVE-2025-32911-CVE-2025-32913.patch Patch11: 0011-bugfix-for-CVE-2025-32906.patch Patch12: 0012-bugfix-for-CVE-2025-32914.patch Patch13: 0013-bugfix-for-CVE-2025-32049.patch +Patch14: 0014-bugfix-for-CVE-2025-2784.patch BuildRequires: gettext BuildRequires: glib-networking @@ -134,6 +135,9 @@ This package contains developer documentation for %{name}. %endif %changelog +* Fri Jun 13 2025 tomcruiseqi <10762123+tomcruiseqi@user.noreply.gitee.com> - 2.74.3-14 +- fix CVE-2025-2784 + * Fri Jun 13 2025 tomcruiseqi <10762123+tomcruiseqi@user.noreply.gitee.com> - 2.74.3-13 - fix CVE-2025-32049 -- Gitee