{"id":"CVE-2022-35922","published":"2022-08-01T21:35:11Z","modified":"2025-04-23T17:54:31Z","title":"Memory allocation based on untrusted length in rust-websocket","vendor":"websockets-rs","product":"rust-websocket","tier":"tail","description":{"text":"Rust-WebSocket is a WebSocket (RFC6455) library written in Rust. In versions prior to 0.26.5 untrusted websocket connections can cause an out-of-memory (OOM) process abort in a client or a server. The root cause of the issue is during dataframe parsing. Affected versions would allocate a buffer based on the declared dataframe size, which may come from an untrusted source. When `Vec::with_capacity` fails to allocate, the default Rust allocator will abort the current process, killing all threads. This affects only sync (non-Tokio) implementation. Async version also does not limit memory, but does not use `with_capacity`, so DoS can happen only when bytes for oversized dataframe or message actually got delivered by the attacker. The crashes are fixed in version 0.26.5 by imposing default dataframe size limits. Affected users are advised to update to this version. Users unable to upgrade are advised to filter websocket traffic externally or to only accept trusted traffic.","provenance":"source","from":"CVE.org"},"cvss":{"score":7.5,"severity":"HIGH","version":"3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H","provenance":"source","from":"CVE.org CNA"},"epss":{"score":0.01918,"percentile":0.80396,"provenance":"source"},"cwes":[{"id":"CWE-400","name":"Uncontrolled Resource Consumption"}],"references":[{"url":"https://github.com/websockets-rs/rust-websocket/security/advisories/GHSA-qrjv-rf5q-qpxc","tags":["x_refsource_CONFIRM"]},{"url":"https://github.com/websockets-rs/rust-websocket/commit/cbf6e9983e839d2ecad86de8cd1b3f20ed43390b","tags":["x_refsource_MISC"]},{"url":"https://lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/HYPNCM4H4OFBIZI6XMJ2DUTS54FT2TWP/","tags":["vendor-advisory","x_refsource_FEDORA"]},{"url":"https://lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/4V2EOOU5OLEHVMKAH6BALQXKDKIZRXCI/","tags":["vendor-advisory","x_refsource_FEDORA"]}],"priority":{"score":21.3,"factors":[{"name":"EPSS percentile","points":16.08},{"name":"CVSS severity","points":5.25}]},"vendorSlug":"websockets-rs","affectedVersions":[{"vendor":"websockets-rs","product":"rust-websocket","versions":["< 0.26.5"]}],"ssvc":{"exploitation":"none","automatable":"yes","technicalImpact":"partial","timestamp":"2025-04-23T15:52:31.426268Z","from":"CISA ADP","provenance":"source"},"affected":[{"ecosystem":"crates.io","package":"websocket","vulnerableRanges":["<0.26.5",">=0.0.0-0, <0.26.5"],"patched":["0.26.5"],"from":["GHSA-qrjv-rf5q-qpxc","RUSTSEC-2022-0035"],"provenance":"source"}],"summary":{"text":"The rust-websocket library (WebSocket RFC6455 implementation in Rust, versions prior to 0.26.5) allocates a buffer sized by the dataframe length declared in incoming data during parsing, which can be attacker-controlled, and this affects only the sync, non-Tokio implementation. An attacker who can open a websocket connection to a client or server built on the affected sync implementation, with no authentication or user interaction required, can send a dataframe declaring an oversized length so that memory allocation fails and aborts the whole process, killing all threads.","provenance":"ai","model":"claude-haiku-5-5","generatedAt":"2026-11-20T07:08:20Z"},"euvd":{"id":"EUVD-2022-6611","exploited":false,"provenance":"source"}}