Files
buildroot/package/libsoup/0003-sniffer-fix-potential-overflow.patch
Titouan Christophe eee0f6c078 package/libsoup: add many security patches
Import all security patches from OpenEmbedded for libsoup.
This fixes the following 18 known vulnerabilities:

- CVE-2024-52530:
    GNOME libsoup before 3.6.0 allows HTTP request smuggling in some
    configurations because '\0' characters at the end of header names are
    ignored, i.e., a "Transfer-Encoding\0: chunked" header is treated the
    same as a "Transfer-Encoding: chunked" header.
    https://www.cve.org/CVERecord?id=CVE-2024-52530

- CVE-2024-52531:
    GNOME libsoup before 3.6.1 allows a buffer overflow in applications that
    perform conversion to UTF-8 in soup_header_parse_param_list_strict.
    There is a plausible way to reach this remotely via
    soup_message_headers_get_content_type (e.g., an application may want to
    retrieve the content type of a request or response).
    https://www.cve.org/CVERecord?id=CVE-2024-52531

- CVE-2024-52532:
    GNOME libsoup before 3.6.1 has an infinite loop, and memory consumption.
    During the reading of certain patterns of WebSocket data from clients.
    https://www.cve.org/CVERecord?id=CVE-2024-52532

- CVE-2025-2784:
    Libsoup: heap buffer over-read in `skip_insignificant_space`
    when sniffing content
    https://www.cve.org/CVERecord?id=CVE-2025-2784

- CVE-2025-4476:
    Libsoup: null pointer dereference in libsoup may lead to denial of service
    https://www.cve.org/CVERecord?id=CVE-2025-4476

- CVE-2025-4948:
    Libsoup: integer underflow in soup_multipart_new_from_message() leading to
    denial of service in libsoup
    https://www.cve.org/CVERecord?id=CVE-2025-4948

- CVE-2025-4969:
    Libsoup: off-by-one out-of-bounds read in find_boundary() in soup-multipart.c
    https://www.cve.org/CVERecord?id=CVE-2025-4969

- CVE-2025-32050:
    Libsoup: integer overflow in append_param_quoted
    https://www.cve.org/CVERecord?id=CVE-2025-32050

- CVE-2025-32052:
    Libsoup: heap buffer overflow in sniff_unknown()
    https://www.cve.org/CVERecord?id=CVE-2025-32052

- CVE-2025-32053:
    Libsoup: heap buffer overflows in sniff_feed_or_html() and
    skip_insignificant_space()
    https://www.cve.org/CVERecord?id=CVE-2025-32053

- CVE-2025-32906:
    Libsoup: out of bounds reads in soup_headers_parse_request()
    https://www.cve.org/CVERecord?id=CVE-2025-32906

- CVE-2025-32910:
    Libsoup: null pointer deference on libsoup via /auth/soup-auth-digest.c
    through "soup_auth_digest_authenticate" on client when server omits the
    "realm" parameter in an unauthorized response with digest authentication
    https://www.cve.org/CVERecord?id=CVE-2025-32910

- CVE-2025-32911:
    Libsoup: double free on soup_message_headers_get_content_disposition()
    through "soup-message-headers.c" via "params" ghashtable value
    https://www.cve.org/CVERecord?id=CVE-2025-32911

- CVE-2025-32912:
    Libsoup: null pointer dereference in client when server omits the "nonce"
    parameter in an unauthorized response with digest authentication
    https://www.cve.org/CVERecord?id=CVE-2025-32912

- CVE-2025-32913:
    Libsoup: null pointer dereference in
    soup_message_headers_get_content_disposition when "filename" parameter is
    present, but has no value in content-disposition header
    https://www.cve.org/CVERecord?id=CVE-2025-32913

- CVE-2025-32914:
    Libsoup: oob read on libsoup through function
    "soup_multipart_new_from_message" in soup-multipart.c leads to crash or
    exit of process
    https://www.cve.org/CVERecord?id=CVE-2025-32914

- CVE-2025-46420:
    Libsoup: memory leak on soup_header_parse_quality_list() via soup-headers.c
    https://www.cve.org/CVERecord?id=CVE-2025-46420

- CVE-2025-46421:
    Libsoup: information disclosure may leads libsoup client sends authorization
    header to a different host when being redirected by a server
    https://www.cve.org/CVERecord?id=CVE-2025-46421

Signed-off-by: Titouan Christophe <titouan.christophe@mind.be>
Signed-off-by: Julien Olivain <ju.o@free.fr>
2025-07-04 18:51:51 +02:00

60 lines
2.1 KiB
Diff

From 2eacbd762332795e00692ddab2515c6da23198d3 Mon Sep 17 00:00:00 2001
From: Changqing Li <changqing.li@windriver.com>
Date: Mon, 12 May 2025 14:06:41 +0800
Subject: [PATCH] sniffer: Add better coverage of skip_insignificant_space()
CVE: CVE-2025-2784
Upstream-Status: Backport
[https://gitlab.gnome.org/GNOME/libsoup/-/merge_requests/435/diffs?commit_id=242a10fbb12dbdc12d254bd8fc8669a0ac055304;
https://gitlab.gnome.org/GNOME/libsoup/-/merge_requests/442/diffs?commit_id=c415ad0b6771992e66c70edf373566c6e247089d]
Test code is not added since it uses some functions not defined in
version 2.74. These tests are not used now, so just ignore them.
Upstream: https://git.openembedded.org/meta-openembedded/plain/meta-oe/recipes-support/libsoup/libsoup-2.4/CVE-2025-2784.patch
Signed-off-by: Changqing Li <changqing.li@windriver.com>
Signed-off-by: Titouan Christophe <titouan.christophe@mind.be>
---
libsoup/soup-content-sniffer.c | 9 +++----
1 files changed, 3 insertions(+), 4 deletions(-)
diff --git a/libsoup/soup-content-sniffer.c b/libsoup/soup-content-sniffer.c
index 5f2896e..9554636 100644
--- a/libsoup/soup-content-sniffer.c
+++ b/libsoup/soup-content-sniffer.c
@@ -612,8 +612,10 @@ 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 +634,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 +644,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.34.1