REDHAT-BUG-2543296: Buffer Overflow
A heap buffer overflow was found in libsoup's WebSocket permessage-deflate outgoing path.
soupwebsocketextensiondeflateprocessoutgoingmessage() stored deflateBound()'s uLong result in a guint and grew a GByteArray by that amount. For payloads approaching 4 GiB, the bound exceeds GMAXUINT; truncation allowed buffer->len + maxlength to wrap on later growth, and zlib wrote through nextout past the allocation.
Fixed by refusing payloads whose compressed bound cannot fit in a GByteArray and by checking each incremental growth (commit dbd0417e, libsoup 3.7.3).
References: https://gitlab.gnome.org/GNOME/libsoup/-/workitems/554 (Bug 8) https://gitlab.gnome.org/GNOME/libsoup/-/commit/dbd0417e
Affected Software
Remediation
Recommended actions to resolve this vulnerability, in priority order.
- Upgrade
Upgrade
libsoupto a version that resolves this vulnerability.Fixed in 3.7.3Patch dbd0417e
Event History
Frequently Asked Questions
What conditions are required to trigger the overflow?
The vulnerable outgoing permessage-deflate path must process a WebSocket payload approaching 4 GiB. The issue occurs when the compressed-size bound exceeds G_MAXUINT, is truncated to guint, and subsequent buffer growth wraps before zlib writes output.
Which versions contain the fix?
The issue was fixed in libsoup 3.7.3 by rejecting payloads whose compressed bound cannot fit in a GByteArray and validating each incremental buffer growth.
What can be done if upgrading is not immediately possible?
Prevent or reject WebSocket messages approaching 4 GiB on paths using permessage-deflate. This avoids the payload size condition that causes the compressed bound to exceed G_MAXUINT.