Executive brief
A vulnerability exists in the SSH protocol handler of libwebsockets, a networking library used by various applications to manage web and SSH connections. An unauthenticated remote attacker can send a specially crafted small packet that forces the server to allocate a large amount of memory. This can lead to a denial-of-service condition where the server crashes or becomes unresponsive due to memory exhaustion, potentially impacting business operations and service availability.
Technical details
A vulnerability in the SSH protocol plugin of libwebsockets (specifically in `plugins/protocol_lws_ssh_base/sshd.c`) stems from a missing upper-bound check on the `msg_len` argument within the `lws_ssh_parse_plaintext` function. An unauthenticated remote attacker can manipulate the 4-byte `msg_len` field in a pre-authentication packet. When the `msg_id` is set to `SSH_MSG_KEXINIT`, the library uses this unchecked length to perform a heap allocation via `sshd_zalloc` (which calls `malloc` and `memset`). By sending multiple connections with large `msg_len` values, an attacker can trigger the system's Out-Of-Memory (OOM) killer to terminate the server process. A patch (commit 3f9f0c6) introduces `LWS_SSH_MAX_PACKET_SIZE` to enforce a 256KB limit.
Affected products
- warmcat libwebsockets up to 4.5.8
Timeline
- 2026-06-02: advisory: NVD publication date
- 2026-06-02: disclosed: Vulnerability details and PoC published by researcher
- 2026-06-02: patched: Patch commit 3f9f0c6ecaf0e6f3f219d30632c5d1f2479d7498 released
References
- https://github.com/biniamf/pocs/blob/main/libwebsockets_sshd-parse-ic-unbounded-alloc/poc_sshd_unbounded_alloc.py
- https://github.com/biniamf/pocs/tree/main/libwebsockets_sshd-parse-ic-unbounded-alloc
- https://github.com/warmcat/libwebsockets/
- https://github.com/warmcat/libwebsockets/commit/3f9f0c6ecaf0e6f3f219d30632c5d1f2479d7498
- https://vuldb.com/cve/CVE-2026-10650
- https://vuldb.com/submit/830261
- https://vuldb.com/vuln/367955