Under attack right now? hello@incursor.io
BlogResearch

CVE-2026-12478: the bug libsoup’s fix left behind

A security fix for libsoup protected only one of the two paths through its WebSocket frame parser. We found the unprotected one. This walkthrough goes from a 10-byte frame to the verified fix.

Gerard Capdevila Oct 2026 · 8 min read · CVE-2026-12478
KEY TAKEAWAYS
CVE-2026-12478 is an out-of-bounds read in libsoup’s WebSocket client, left open by an incomplete fix for CVE-2026-0716.
A malicious WebSocket server can crash a libsoup client, or make it read memory past its buffer, with a single 10-byte frame.
The client must have the message size limit disabled (max_incoming_payload_size = 0). CVSS 4.8, Medium.
The bug is fixed in libsoup merge request 518, and we verified the fix.

1. An incomplete fix

In early 2026, libsoup fixed CVE-2026-0716, an integer overflow in WebSocket frame processing (commit 6ff7ef0, version 3.6.6). libsoup is the GNOME project’s HTTP library; many Linux applications use it, and it ships with Red Hat Enterprise Linux. Reading the fix, we noticed that the new check sat inside an if (masked) block, so it only protected masked frames.

2. Why the client path stayed open

RFC 6455 requires clients to always mask their frames and servers never to mask theirs. The fix therefore protected a libsoup server receiving data from a client. A libsoup client receiving data from a server always runs with masked = FALSE, so the check never executes. The code is process_frame(), in libsoup/websocket/soup-websocket-connection.c.

/* line 1144: length check, never protected on the client side */
if (len < at + payload_len)      /* the 64-bit addition wraps */
        return FALSE;

/* lines 1149-1158: the fix for CVE-2026-0716 */
if (masked) {
        if (payload_len > G_MAXSIZE - 14) {
                bad_data_error_and_close (self);
                return FALSE;
        }
        ...
}

3. A 10-byte frame

The malicious server sends an unmasked binary frame that announces a length of 2^64 − 10 bytes. In process_frame(), at is 10 and payload_len is 0xFFFFFFFFFFFFFFF6, and their sum, computed as an unsigned 64-bit value, wraps to 0. The check len < 0 is false and processing continues. process_contents() then truncates the length to 32 bits (0xFFFFFFF6, about 4 GB) and tries to copy 4 GB out of a 1,024-byte buffer.

\x82 \x7f \xff \xff \xff \xff \xff \xff \xff \xf6

0x82                 FIN = 1, opcode = binary
0x7f                 MASK = 0, 64-bit length
0xFFFFFFFFFFFFFFF6   payload_len = 2^64 - 10

at + payload_len = 10 + 0xFFFFFFFFFFFFFFF6 = 0 (mod 2^64)

4. Reproducing the crash

We wrote three files: a malicious WebSocket server in Python, a minimal libsoup client in C, and a small program that reproduces the arithmetic on its own, without libsoup. Built with AddressSanitizer, the client stops on an out-of-bounds read of more than 4 GB. Without AddressSanitizer it crashes with SIGSEGV (exit code 139).

==62960==ERROR: AddressSanitizer: heap-buffer-overflow
READ of size 4294967286 at 0x619000005e80 thread T0
    #0 memcpy
    #1 g_array_append_vals
    #2 on_web_socket_input   <-- process_frame -> process_contents
0x619000005e80 is located 0 bytes after 1024-byte region

5. Who is affected, and how badly

Two conditions are needed. An application uses libsoup’s WebSocket client and connects to a server the attacker controls, and the size limit is disabled with max_incoming_payload_size = 0. That option is documented (“or 0 to not limit it”) and the Autobahn compliance test suite uses it. The default 128 KB limit blocks the attack. The impact is a client crash and a possible information leak; no data is modified. The CVSS 3.1 score is 4.8, Medium (AV:N/AC:H/PR:N/UI:N/S:U/C:L/I:N/A:L), and Red Hat lists Red Hat Enterprise Linux 10 among the affected products.

Low
Medium
High
Critical

6. The fix and a hardening note

Merge request 518 replaces the old check with a single guard that covers both the masked and unmasked paths. We verified it with AddressSanitizer: the previous build reproduces the crash, and the patched build closes the connection cleanly with code 1007 (BAD_DATA). We also tested other extreme lengths and the new regression tests. The guard still runs after the addition that wraps. That is not exploitable today, but code added later between those two lines could bring the bug back, so we recommended checking before the arithmetic.

/* recommended: check before adding */
if (payload_len > G_MAXSIZE - 14) {
        bad_data_error_and_close (self);
        return FALSE;
}
if (len < at + payload_len)
        return FALSE;

7. Timeline

We reported the bug with Adel Bouachraoui through coordinated disclosure to GNOME’s security programme on YesWeHack. Three other reports of the same issue arrived shortly after ours.

18 February 2026: bug reported
10 July 2026: CVE-2026-12478 assigned, CVSS score adjusted to 4.8
14 July 2026: CVE published, with both our names in the credits
3 September 2026: fix verified, case closed

8. Sources

Official records for further reading:

WHAT TO DO NOW
→Update libsoup as soon as your distribution ships the fixed version.
→Search your code for max_incoming_payload_size = 0 and set a sensible limit.
→Do not connect a WebSocket client without a size limit to a server you do not control.
→After every security fix, check the other paths through the same code.

What people ask us about this CVE

Am I affected?

Only if one of your applications uses libsoup’s WebSocket client with max_incoming_payload_size = 0 and connects to servers you do not control. The default 128 KB limit blocks the attack.

Why is the score only 4.8?

The victim has to connect to a malicious server with a specific configuration, which makes the attack complexity high. The bug is an out-of-bounds read, so data integrity is not affected, and the initial score of 5.6 was lowered to 4.8 for that reason.

What if I cannot update right away?

Restore a size limit on incoming messages and restrict WebSocket connections to trusted servers until you can apply the update.

Related services Audit & Pentest Incursor Reaper

Have a security fix you want checked before it ships?

Test us. An expert hacker replies within one business day.
Incursor
© 2026 Incursor Security · Paris · Barcelona · Amsterdam · EU based
{{ rIncidentQ }} hello@incursor.io
Incursor {{ menuLabel }}
{{ navServices }} {{ navEngagements }} {{ navMethod }} {{ navTeam }} {{ navBlog }}
{{ navContact }}
{{ navBlog }}{{ arCat }}

{{ arT }}

{{ arLede }}

{{ arAuthor }} {{ arMeta }}
{{ arTldrT }}
{{ b }}

{{ sec.n }}. {{ sec.h }}

{{ sec.p }}

{{ sec.code }}
{{ li.t }} {{ li.t }}
{{ heatLowL }}
{{ heatMediumL }}
{{ heatHighL }}
{{ heatCriticalL }}
{{ arFlagsT }}
{{ arFlagMark }}{{ f }}

{{ arFaqT }}

{{ q.q }}

{{ q.a }}

{{ arSvcT }} {{ sv.t }}

{{ arCta }}

{{ rHmEndBtn }} {{ rHmEndNote }}
Incursor
© 2026 Incursor Security · {{ cities }}