Skip to content
Heist/ feed
Back to feed
UnratedFix available

Unbounded memory allocation based on untrusted length

Type: advisorySources: OSV

## Impact 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. This is a security concern for you, if - your server application handles untrusted websocket connections - OR your client application connects to untrusted websocket servers ## Patches The crashes are fixed in version **0.26.5** by imposing default dataframe size limits. Affected users are advised to update to this version. Note that default memory limits are rather large (100MB dataframes and 200 MB messages), so they can still cause DoS in some environments (i.e. 32-bit). New API has been added to fine tune those limits for specific applications. ### Workarounds * Migrate your project to another, maintained Websocket library like Tungstenite. * Accept only trusted WebSocket traffic. * Filter the WebSocket traffic though some kind of proxy that ensures sanity limits on messages. * Handle process aborts gracefully and limit process mem

Products
websocket
Affected versions
Not specified
Fixed versions
0.26.5
CVEs
CVE-2022-35922
Confirmed fixed CVEs
Not specified
Updated in this feed
30 Oct 2026, 08:43 UTC · Revision 1

Source evidence

Unbounded memory allocation based on untrusted length

core-osv · Original source

Published 1 Aug 2022, 12:00 UTC

## Impact 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. This is a security concern for you, if - your server application handles untrusted websocket connections - OR your client application connects to untrusted websocket servers ## Patches The crashes are fixed in version **0.26.5** by imposing default dataframe size limits. Affected users are advised to update to this version. Note that default memory limits are rather large (100MB dataframes and 200 MB messages), so they can still cause DoS in some environments (i.e. 32-bit). New API has been added to fine tune those limits for specific applications. ### Workarounds * Migrate your project to another, maintained Websocket library like Tungstenite. * Accept only trusted WebSocket traffic. * Filter the WebSocket traffic though some kind of proxy that ensures sanity limits on messages. * Handle process aborts gracefully and limit process mem

osv:RUSTSEC-2022-0035

websocket

Fixed versions: 0.26.5

Complete source record
{
  "id": "24ed8439f40aa72c5847134dc343ef2e9d5b77f4c6057de3a9b97d8cf19afa53",
  "url": "https://osv.dev/vulnerability/RUSTSEC-2022-0035",
  "method": "structured",
  "payload": {
    "kind": "advisory",
    "title": "Unbounded memory allocation based on untrusted length",
    "summary": "## Impact 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. This is a security concern for you, if - your server application handles untrusted websocket connections - OR your client application connects to untrusted websocket servers ## Patches The crashes are fixed in version **0.26.5** by imposing default dataframe size limits. Affected users are advised to update to this version. Note that default memory limits are rather large (100MB dataframes and 200 MB messages), so they can still cause DoS in some environments (i.e. 32-bit). New API has been added to fine tune those limits for specific applications. ### Workarounds * Migrate your project to another, maintained Websocket library like Tungstenite. * Accept only trusted WebSocket traffic. * Filter the WebSocket traffic though some kind of proxy that ensures sanity limits on messages. * Handle process aborts gracefully and limit process mem",
    "evidence": "osv:RUSTSEC-2022-0035",
    "products": [
      {
        "name": {
          "value": "websocket",
          "evidence": "/affected/0/package/name"
        },
        "prerequisites": [],
        "fixed_versions": [
          {
            "value": "0.26.5",
            "evidence": "/affected/0/ranges"
          }
        ],
        "affected_versions": []
      }
    ],
    "severity": "unknown",
    "structured": {
      "id": "RUSTSEC-2022-0035",
      "aliases": [
        "CVE-2022-35922",
        "GHSA-qrjv-rf5q-qpxc",
        "RUSTSEC-2022-0035"
      ],
      "affected": [
        {
          "ranges": [
            {
              "type": "SEMVER",
              "events": [
                {
                  "introduced": "0.0.0-0"
                },
                {
                  "fixed": "0.26.5"
                }
              ]
            }
          ],
          "package": {
            "name": "websocket",
            "purl": "pkg:cargo/websocket",
            "ecosystem": "crates.io"
          },
          "database_specific": {
            "cvss": null,
            "source": "https://github.com/rustsec/advisory-db/blob/osv/crates/RUSTSEC-2022-0035.json",
            "categories": [
              "denial-of-service"
            ],
            "informational": null
          },
          "ecosystem_specific": {
            "affects": {
              "os": [],
              "arch": [],
              "functions": []
            },
            "affected_functions": null
          }
        }
      ],
      "modified": "2026-10-12T18:00:06.812726782Z",
      "provider": "osv",
      "references": [
        "https://crates.io/crates/websocket",
        "https://rustsec.org/advisories/RUSTSEC-2022-0035.html",
        "https://github.com/websockets-rs/rust-websocket/commit/cbf6e9983e839d2ecad86de8cd1b3f20ed43390b"
      ],
      "provider_metadata": {
        "license": "CC0-1.0"
      }
    },
    "related_cves": [
      {
        "value": "CVE-2022-35922",
        "evidence": "/aliases"
      }
    ],
    "security_relevant": true,
    "severity_evidence": null
  },
  "source_id": "core-osv",
  "document_id": 306368,
  "published_at": "2022-08-01T12:00:00+00:00"
}