Resource exhaustion in Rust-Websocket Project
CVE-2022-35922
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.
Vulnerability class: DoS (Denial of Service)
EPSS: 0.015 (71.3th percentile) — read the EPSS interpretation.
CVSS v3 metric
CVSS v3 base score 7.5 (High). Vector: CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H.
Affected products
- Rust-websocket_project Rust-websocket
- Websockets-rs Rust-websocket — versions < 0.26.5
- Fedoraproject Fedora — versions 35, 36
Weakness classification (CWE)
References
- security-advisories@github.com (x_refsource_CONFIRM, Third Party Advisory)
- security-advisories@github.com (Patch, Third Party Advisory, x_refsource_MISC)
- security-advisories@github.com (x_refsource_FEDORA, vendor-advisory)
- security-advisories@github.com (x_refsource_FEDORA, vendor-advisory)
Frequently asked questions
- What is CVE-2022-35922?
- CVE-2022-35922 is a high-severity vulnerability in Rust-Websocket Project, classified under Uncontrolled Resource Consumption. CVSS score: 7.5/10. Published 2022-08-01.
- How severe is CVE-2022-35922?
- High severity. CVSS v3 base score is 7.5 out of 10.