CVE-2026-50161
Received Received - Intake

Integer Overflow in Libre WebSocket Frame Handling

Vulnerability report for CVE-2026-50161, including description, CVSS score, EPSS score, affected products, exploitability, helpful resources, and attack-flow context.

Publication date: 2026-08-18

Last updated on: 2026-08-18

Assigner: GitHub, Inc.

Description

libre is a generic library for real-time communications with asynchronous input and output support. Prior to 4.8.1, the websock_decode() function in src/websock/websock.c contains an integer overflow when validating a masked WebSocket frame that uses the 64-bit extended length encoding. The expression 4 + hdr->len can wrap when hdr->len is close to UINT64_MAX, causing the mbuf_get_left() bounds check to pass. The subsequent XOR unmasking loop then writes beyond the heap buffer. Applications using websock_accept() or websock_accept_proto() to implement a WebSocket server are affected, and exploitation can cause attacker-controlled heap corruption or denial of service after the HTTP WebSocket upgrade handshake. This issue is fixed in version 4.8.1.

CVSS Scores

EPSS Scores

Probability:
Percentile:

Meta Information

Published
2026-08-18
Last Modified
2026-08-18
Generated
2026-08-18
AI Q&A
2026-08-18
EPSS Evaluated
N/A
NVD
EUVD

Affected Vendors & Products

Showing 1 associated CPE
Vendor Product Version / Range
libre libre to 4.8.1 (exc)

Helpful Resources

Exploitability

CWE
CWE Icon
KEV
KEV Icon
CWE ID Description
CWE-787 The product writes data past the end, or before the beginning, of the intended buffer.
CWE-190 The product performs a calculation that can produce an integer overflow or wraparound when the logic assumes that the resulting value will always be larger than the original value. This occurs when an integer value is incremented to a value that is too large to store in the associated representation. When this occurs, the value may become a very small or negative number.

Attack-Flow Graph

AI Quick Actions

Instant insights powered by AI
Executive Summary

This vulnerability is an integer overflow in the websock_decode() function of the libre library. When processing a masked WebSocket frame with a 64-bit extended length close to UINT64_MAX, the bounds check (4 + hdr->len) wraps around due to overflow, causing it to incorrectly pass. This allows the XOR unmasking loop to write beyond the buffer's memory, leading to heap corruption or crashes.

Detection Guidance

Detecting this vulnerability requires monitoring for malformed WebSocket frames with extremely large payload lengths. Inspect network traffic for WebSocket handshake requests followed by frames with 64-bit extended length fields close to UINT64_MAX. Use tools like Wireshark with WebSocket protocol filters or custom scripts to analyze frame lengths and detect potential overflow conditions.

Impact Analysis

Exploitation can cause attacker-controlled heap corruption or denial of service after the HTTP WebSocket upgrade handshake. Applications using websock_accept() or websock_accept_proto() as WebSocket servers are affected. An attacker can send a crafted 14-byte WebSocket frame to trigger heap corruption.

Mitigation Strategies

Immediately upgrade to libre version 4.8.1 or later. If upgrading is not possible, disable WebSocket support in affected applications or implement strict input validation to reject WebSocket frames with payload lengths exceeding SIZE_MAX - 4. Monitor systems for crashes or memory corruption as potential indicators of exploitation.

Chat Assistant

Ask questions about this CVE
Hi! I’m here to help you understand CVE-2026-50161. Ask me anything about the vulnerability, its impact, or mitigation strategies.
0/70

EPSS Chart