GHSA-f5v4-2wr6-hqmg
## Summary A pre-authentication denial-of-service vulnerability exists in the server's keyboard-interactive authentication handler. A malicious client can crash any russh-based server that implements keyboard-interactive auth (e.g., for 2FA/TOTP) with a single malformed packet, requiring no credentials. ## Vulnerability Details In `russh/src/server/encrypted.rs`, the function `read_userauth_info_response` decodes a `u32` count from the client's `SSH_MSG_USERAUTH_INFO_RESPONSE` and passes it directly to `Vec::with_capacity()`: ```rust let n = map_err!(u32::decode(r))?; // Bound both allocation and iteration by remaining packet data to // prevent a malicious client from causing a multi-GB allocation or // billions of loop iterations with a crafted count. // Each response needs at least 4 bytes (length prefix). let max_responses = r.remaining_len().saturating_add(3) / 4; let n = (n as usize).min(max_responses); let mut responses = Vec::with_capacity(n); for _ in 0..n { responses.push(Bytes::decode(r).ok()) } ``` An attacker can send `n = 0x10000000` (268M) or larger in a minimal packet (~50 bytes after encryption). The server attempts to allocate `n * ~24 bytes` (size of `Option<Bytes>`) = ~6.4GB, causing an OOM crash. ## Attack Flow 1. Attacker connects via TCP, completes key exchange (no credentials needed -- this is the anonymous DH handshake, not authentication) 2. Sends `USERAUTH_REQUEST` with method `keyboard-interactive` 3. Server handler returns `Auth::Partial` with prompts (standard for 2FA/TOTP) 4. Attacker sends `USERAUTH_INFO_RESPONSE` with `n = 0x10000000` and no response data 5. Server calls `Vec::with_capacity(268_435_456)`, OOM killed No authentication is required. The allocation occurs before the handler validates any credentials. The attack is repeatable faster than the server can restart. ## Affected Configurations Any russh-based server where the `Handler::auth_keyboard_interactive` implementation returns `Auth::Partial` (i.e., sends
Properties
- ghsa_id
- GHSA-f5v4-2wr6-hqmg
- summary
- russh has pre-auth DoS via unbounded allocation in its keyboard-interactive auth handler
- severity
- high
- cvss_score
- 7.5
- cve_id
- GHSA-f5v4-2wr6-hqmg
- cvss_vector
- CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H
- is_ghsa_only
- true
- ghsa_published
- 2026-04-24T15:39:37Z
- source_url
- https://github.com/advisories/GHSA-f5v4-2wr6-hqmg
- ghsa_updated
- 2026-04-24T15:39:40Z
Related Entities (5)
HAS_WEAKNESS (2)
REPORTED_BY (1)
VULNERABLE_TO (1)
AFFECTS (1)
Explore deeper with Ninja Signal's threat intelligence graph