Memory allocation based on untrusted length in rust-websocket
Key facts
- Attack vector
- Network
- Privileges required
- None
- User interaction
- None
- Attack complexity
- Low
- Impact type
- Denial of service
- Confidentiality · integrity · availability
- None · None · High
- Fix status
- Fixed
Attack profile from CVSS 3.1 · CNA. Fix status from CNA and GitHub. Impact type from CWE-400.
Summary
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.
Why it matters now
SSVC decision points
CISA ADP · SSVC 2.0.3
- Exploitation
- None
- Automatable
- Yes
- Technical impact
- Partial
The decision (Track, Attend, Act) also depends on your mission and well-being impact; see CISA's SSVC guide.
Affected products
| Vendor | Product | Affected versions | Fixed in | Status | Source |
|---|---|---|---|---|---|
| websockets-rs | rust-websocket | before 0.26.5 | 0.26.5 | Patch available | CNA |
| — | websocket (crates.io) | before 0.26.5 | 0.26.5 | Patch available | GHSA-qrjv-rf5q-qpxc |
- rust-websocket Vendorwebsockets-rs Affected before 0.26.5 Fixed in 0.26.5 Patch available CNA
- websocket (crates.io) Vendor— Affected before 0.26.5 Fixed in 0.26.5 Patch available GHSA-qrjv-rf5q-qpxc
CPE configurations NVD · 3
| CPE | Versions | Role | Vendor |
|---|---|---|---|
| cpe:2.3:a:rust-websocket_project:rust-websocket:*:*:*:*:*:*:*:* | before 0.26.5 | Vulnerable | Rust-websocket Project |
| cpe:2.3:o:fedoraproject:fedora:35:*:*:*:*:*:*:* | 35 | Vulnerable | Fedoraproject |
| cpe:2.3:o:fedoraproject:fedora:36:*:*:*:*:*:*:* | 36 | Vulnerable | Fedoraproject |
- cpe:2.3:a:rust-websocket_project:rust-websocket:*:*:*:*:*:*:*:* Versions before 0.26.5 Vulnerable ·Rust-websocket Project
- cpe:2.3:o:fedoraproject:fedora:35:*:*:*:*:*:*:* Versions 35 Vulnerable ·Fedoraproject
- cpe:2.3:o:fedoraproject:fedora:36:*:*:*:*:*:*:* Versions 36 Vulnerable ·Fedoraproject
Remediation
- Fix · CNA rust-websocket (websockets-rs) Fixed in 0.26.5
- Fix · GHSA-qrjv-rf5q-qpxc websocket (crates.io) Fixed in 0.26.5 Advisory →
Vendor assessments
Timeline
- 2026-10-02 Threatist record created from CVE-2022-35922
- 2026-10-03 Alias added: GHSA-qrjv-rf5q-qpxc
References
Patch 1
Advisory 4
Other 4
- https://github.com/websockets-rs/rust-websocket
- https://lists.fedoraproject.org/archives/list/[email protected]/message/4V2EOOU5OLEHVMKAH6BALQXKDKIZRXCI
- https://lists.fedoraproject.org/archives/list/[email protected]/message/HYPNCM4H4OFBIZI6XMJ2DUTS54FT2TWP
- https://rustsec.org/advisories/RUSTSEC-2022-0035.html
Sources
- CVE-2022-35922 · CVE Program
- CVE-2022-35922 · NVD
- FIRST EPSS
- GHSA-qrjv-rf5q-qpxc · GitHub Advisory Database · CC BY 4.0
- CVE-2022-35922 · Red Hat security data · CC BY 4.0
This product uses the NVD API but is not endorsed or certified by the NVD. Sources and licences