{"id":"CVE-2026-50161","summary":"libre: Integer overflow in websock_decode() masked frame length check leads to heap buffer overflow","details":"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-\u003elen can wrap when hdr-\u003elen 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.","aliases":["GHSA-hvxv-v2gp-v93h"],"modified":"2026-08-21T08:19:10.908229Z","published":"2026-08-18T17:53:01.696Z","database_specific":{"cna_assigner":"GitHub_M","cwe_ids":["CWE-190","CWE-787"],"osv_generated_from":"https://github.com/CVEProject/cvelistV5/tree/main/cves/2026/50xxx/CVE-2026-50161.json"},"references":[{"type":"WEB","url":"https://github.com/baresip/re/releases/tag/v4.8.1"},{"type":"ADVISORY","url":"https://github.com/CVEProject/cvelistV5/tree/main/cves/2026/50xxx/CVE-2026-50161.json"},{"type":"ADVISORY","url":"https://github.com/baresip/re/security/advisories/GHSA-hvxv-v2gp-v93h"},{"type":"ADVISORY","url":"https://nvd.nist.gov/vuln/detail/CVE-2026-50161"},{"type":"FIX","url":"https://github.com/baresip/re/commit/718b92615c7963670d26c1a2b246968b58d782e8"},{"type":"FIX","url":"https://github.com/baresip/re/pull/1584"}],"affected":[{"ranges":[{"type":"GIT","repo":"https://github.com/baresip/re","events":[{"introduced":"0"},{"fixed":"718b92615c7963670d26c1a2b246968b58d782e8"},{"fixed":"89aed31f37449da32004ba608e5d1aa483b8bb21"}],"database_specific":{"extracted_events":[{"introduced":"0"},{"fixed":"4.8.1"}],"source":["AFFECTED_FIELD","REFERENCES"]}}],"versions":["v4.8.0","v4.7.0","v4.6.0","v4.5.0","v4.4.0","v4.3.0","v4.2.0","v4.1.0","v4.0.0","v3.24.0","v3.23.0","v3.22.0","v3.21.1","v3.21.0","v3.20.0","v3.19.0","v3.18.0","v3.17.0","v3.16.0","v3.15.0","v3.14.0","v3.13.0","v3.12.0","v3.11.0","v3.10.0","v3.9.0","v3.8.0","v3.7.0","v3.6.0","v3.5.1","v3.5.0","v3.4.0","v3.3.0","v3.2.0","v3.1.0","v3.0.0","v2.12.0","v2.11.0","v2.10.0","v2.9.0","v2.8.0","v2.7.0","v2.6.1","v2.6.0","v2.5.0","v2.4.0","v2.3.0","v2.2.2","v2.2.1","v2.2.0","v2.1.1","v2.1.0","v2.0.1-dev17","v2.0.1-dev15","v2.0.1-dev14","v2.0.1-dev13","v2.0.1-dev12","v2.0.1-dev11","v2.0.1-dev10","v2.0.1-dev9","v2.0.1-dev8","v2.0.1-dev7","v2.0.1","v2.0.0","v1.1.0","v1.0.0","v0.6.1","v0.6.0","v0.5.9","v0.5.8","v0.5.7","v0.5.6","v0.5.5","v0.5.4","v0.5.3","v0.5.2","v0.5.1","v0.5.0","v0.4.17","v0.4.16","v0.4.15"],"database_specific":{"source":"https://storage.googleapis.com/cve-osv-conversion/osv-output/CVE-2026-50161.json","vanir_signatures_modified":"2026-08-21T08:19:10Z","vanir_signatures":[{"id":"CVE-2026-50161-268399b0","signature_type":"Function","signature_version":"v1","source":"https://github.com/baresip/re/commit/718b92615c7963670d26c1a2b246968b58d782e8","target":{"file":"src/websock/websock.c","function":"websock_decode"},"deprecated":false,"digest":{"function_hash":"90791744945993249034159393964522523580","length":1144}},{"digest":{"line_hashes":["205653894276177882845976994735089349577","319107032716303536559689801603816600260","98417606615468948801619787221641535150","60674254189263708024869926526995698480"],"threshold":0.9},"id":"CVE-2026-50161-8e345095","signature_type":"Line","signature_version":"v1","source":"https://github.com/baresip/re/commit/718b92615c7963670d26c1a2b246968b58d782e8","target":{"file":"src/websock/websock.c"},"deprecated":false}]}}],"schema_version":"1.9.0","severity":[{"type":"CVSS_V4","score":"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"}]}