Bug 2115226 (CVE-2022-35922)

Summary: CVE-2022-35922 rust-webscket: untrusted websocket connections can cause an out-of-memory
Product: [Other] Security Response Reporter: TEJ RATHI <trathi>
Component: vulnerabilityAssignee: Red Hat Product Security <security-response-team>
Status: CLOSED UPSTREAM QA Contact:
Severity: medium Docs Contact:
Priority: medium    
Version: unspecifiedCC: rust-sig
Target Milestone: ---Keywords: Security
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: rust-websocket 0.26.5 Doc Type: ---
Doc Text:
A vulnerability was found in rust-websocket, where untrusted websocket connections can cause an out-of-memory (OOM) process abort in a client or a server. The issue occurs during dataframe parsing. A buffer would be allocated 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, hence, a denial of service can only happen when bytes for oversized dataframe or message actually got delivered by the attacker.
Story Points: ---
Clone Of: Environment:
Last Closed: 2022-08-31 19:32:52 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On: 2115227, 2115228    
Bug Blocks: 2113845    

Description TEJ RATHI 2022-08-04 07:59:16 UTC
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.

https://github.com/websockets-rs/rust-websocket/commit/cbf6e9983e839d2ecad86de8cd1b3f20ed43390b
https://github.com/websockets-rs/rust-websocket/security/advisories/GHSA-qrjv-rf5q-qpxc

Comment 1 TEJ RATHI 2022-08-04 07:59:43 UTC
Created rust-websocket tracking bugs for this issue:

Affects: fedora-all [bug 2115228]


Created rust-websocket-base tracking bugs for this issue:

Affects: fedora-all [bug 2115227]

Comment 2 Product Security DevOps Team 2022-08-31 19:32:50 UTC
This CVE Bugzilla entry is for community support informational purposes only as it does not affect a package in a commercially supported Red Hat product. Refer to the dependent bugs for status of those individual community products.