# CVE-2026-50161: libre: Integer overflow in websock_decode() masked frame length check leads to heap buffer overflow

- Severity: Critical 9.3 (CVSS:4.0, scored by GitHub_M) `CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:H/VI:H/VA:H/SC:N/SI:N/SA:N`
- Known to be exploited: not in CISA's catalogue, which lists only what CISA has confirmed
- Likelihood of exploitation in the next 30 days (EPSS): 0.53%, higher than 46% of CVEs (2026-12-01)
- Published: 2026-08-18T17:53:01.696Z
- Modified: 2026-10-22T22:10:00.250Z
- Weaknesses: CWE-190, CWE-787
- SSVC (CISA-ADP): exploitation none, automatable yes, technical impact partial
- Assigned by: GitHub_M

## 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.

(As written by CVE List.)

## Affected

- baresip re: < 4.8.1

## References

- <https://github.com/baresip/re/security/advisories/GHSA-hvxv-v2gp-v93h>
- <https://github.com/baresip/re/pull/1584>
- <https://github.com/baresip/re/commit/718b92615c7963670d26c1a2b246968b58d782e8>
- <https://github.com/baresip/re/releases/tag/v4.8.1>

## Sources

- CVE List: [CVE-2026-50161](https://www.cve.org/CVERecord?id=CVE-2026-50161), CVE Terms of Use, modified 2026-08-19
- NVD: [CVE-2026-50161](https://nvd.nist.gov/vuln/detail/CVE-2026-50161), Public domain, modified 2026-10-22

---

Page: https://cve.day/CVE-2026-50161 · Whole record: https://cve.day/CVE-2026-50161.json · Rebuilt by cve.day 2026-11-25T22:59:33.536Z
