Bug 2439091 (CVE-2026-2369) - CVE-2026-2369 libsoup: libsoup: Buffer overread due to integer underflow when handling zero-length resources
Summary: CVE-2026-2369 libsoup: libsoup: Buffer overread due to integer underflow when...
Keywords:
Status: NEW
Alias: CVE-2026-2369
Product: Security Response
Classification: Other
Component: vulnerability
Version: unspecified
Hardware: All
OS: Linux
medium
medium
Target Milestone: ---
Assignee: Product Security DevOps Team
QA Contact:
URL:
Whiteboard:
Depends On: 2439118 2439119
Blocks:
TreeView+ depends on / blocked
 
Reported: 2026-02-11 20:23 UTC by OSIDB Bzimport
Modified: 2026-02-11 20:36 UTC (History)
0 users

Fixed In Version:
Clone Of:
Environment:
Last Closed:
Embargoed:


Attachments (Terms of Use)

Description OSIDB Bzimport 2026-02-11 20:23:39 UTC
Integer underflow in CVE-2025-32052 fix when resource_length=0

The fix for CVE-2025-32052 (commit a5b86bfc) introduces a potential integer underflow vulnerability when resource_length is 0.

Affected Code: libsoup/soup-content-sniffer.c, line 507

Issue: The patch changes the condition from: while ((index_stream < resource_length) && ...) to: while ((index_stream < resource_length - 1) && ...)

When buffer->length = 0:

resource_length = MIN(512, 0) = 0
resource_length - 1 underflows to UINT_MAX (gsize is unsigned)
Condition (0 < UINT_MAX) = TRUE
Loop executes on empty buffer → buffer overread
Fix: Add guard before has_ws path: if (resource_length == 0) continue;

This matches the pattern used in the else branch which already checks: if (resource_length < type_row->pattern_length) continue;

Patch :

--- a/libsoup/soup-content-sniffer.c
+++ b/libsoup/soup-content-sniffer.c
@@ -498,6 +498,11 @@ sniff_unknown (SoupContentSniffer *sniffer, SoupBuffer *buffer,
 		if (!sniff_scriptable && type_row->scriptable)
 			continue;
 
+		/* Ensure we have data to sniff - prevents underflow in resource_length - 1 */
+		if (resource_length == 0)
+			continue;
+
 		if (type_row->has_ws) {
 			guint index_stream = 0;
 			guint index_pattern = 0;


Note You need to log in before you can comment on or make changes to this bug.