CVE-2026-42189 — Vulnerability in russh — CVE Details
russh has pre-auth DoS via unbounded allocation in its keyboard-interactive auth handler
What Should I Do?
Address in Next Maintenance Window
Low exploitation probability (0.76%). Schedule for your next planned update.
Does your project use an affected russh version?
Paste your Cargo.lock to check it for CVE-2026-42189 and every other known vulnerability, with CISA KEV and EPSS on each finding. Free with no signup for up to 10 packages, or up to 500 per scan with a free account, which also keeps up to 200 packages in saved projects.
Summary
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():
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
- Attacker connects via TCP, completes key exchange (no credentials needed -- this is the anonymous DH handshake, not authentication)
- Sends
USERAUTH_REQUESTwith methodkeyboard-interactive - Server handler returns
Auth::Partialwith prompts (standard for 2FA/TOTP) - Attacker sends
USERAUTH_INFO_RESPONSEwithn = 0x10000000and no response data - 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 prompts to the client). The default handler returns Auth::reject() and is not affected.
Source code review suggests that downstream projects using keyboard-interactive for multi-step auth (e.g., TOTP/2FA) follow the affected pattern, since returning Auth::Partial before credential verification is the intended API usage for prompting.
Confirmed End-to-End PoC
There is a complete Docker-contained PoC confirming the OOM kill:
- Minimal russh server returning
Auth::Partialfor keyboard-interactive - Python client (paramiko for key exchange) sends malformed
USERAUTH_INFO_RESPONSE - Container with 512MB memory limit; server is OOM-killed (exit code 137)
Available on request.
Proposed Fix
Cap the Vec::with_capacity allocation to what the remaining packet data can actually contain. Each response requires at least 4 bytes (length prefix), so:
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())
}
This bounds the allocation to at most the packet size (~256KB), while preserving the existing behavior for well-formed packets. This fix has been implemented, tested, and contributed via the temporary private fork.
Severity
Pre-auth, remote, no credentials required, crashes the server process affecting all active sessions.
Advisory Timeline
- First published April 24, 2026 (216 days ago).
- Last revised November 12, 2026 — 202 days after initial publication.
Remediation
Upgrade to the fixed version using your package manager.
cargo update -p russh --precise 0.60.1
After upgrading, scan your dependencies again to confirm the vulnerability is resolved.
Affected Packages (1)
Affects 1 ecosystem: crates.io (1).
| Package | Fixed In |
|---|---|
| russh crates.io · Affected: All versions | 0.60.1 |
Vulnerability Classification
Common Weakness Enumeration (CWE) identifiers for this vulnerability type.
- CWE-770Allocation of Resources Without LimitsMITRE
- CWE-789
CVSS Score Breakdown
What the CVSS (Common Vulnerability Scoring System) 7.5 score means for each attack dimension.
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H
References
- https://github.com/Eugeny/russh/security/advisories/GHSA-f5v4-2wr6-hqmgWEB
- https://nvd.nist.gov/vuln/detail/CVE-2026-42189ADVISORY
- https://github.com/Eugeny/russh/commit/6c3c80a9b6d60763d6227d60fa8310e57172a4d1WEB
- https://github.com/Eugeny/russhPACKAGE
- https://github.com/Eugeny/russh/releases/tag/v0.60.1WEB
Frequently Asked Questions
- What is CVE-2026-42189?
- russh has pre-auth DoS via unbounded allocation in its keyboard-interactive auth handler. This vulnerability has been assigned a severity rating of HIGH (CVSS score: 7.5/10).
- How do I check if my project is affected by CVE-2026-42189?
- CVE-2026-42189 affects russh. It has a 0.8% probability of exploitation within 30 days (EPSS score). Use GeekWala's free vulnerability scanner to check your dependencies against CVE-2026-42189 and 200,000+ other known vulnerabilities.
Severity & Exploitability
Significant impact if exploited, or exploitable with modest effort.
This is an above-median EPSS score — 51.5% of tracked vulnerabilities score at or below it, putting its exploitation likelihood in the upper half of the tracked corpus.
Also Known As
Related CVEs
- CVE-2026-48110HIGH
SSH message fields allocated before their size is checked
- CVE-2026-102823HIGH
russh: Client-side channel-scoped Handler callbacks fire for channel IDs the client never opened
- CVE-2026-48110HIGH
Russh SSH message fields were decoded through allocation-first parsers before field-specific bounds
- CVE-2026-46673HIGH
Russh: Unchecked CryptoVec allocation and growth handling is reachable
- CVE-2026-102821MEDIUM
Russh: Unbounded memory exhaustion via CHANNEL_OPEN flood during a client-stalled rekey
- CVE-2023-48795MEDIUM
Prefix Truncation Attack against ChaCha20-Poly1305 and Encrypt-then-MAC aka Terrapin
- CVE-2026-48107MEDIUM
Russh: Unchecked keyboard-interactive prompt count in client auth path
- CVE-2025-54804MEDIUM
russh is missing overflow checks during channel windows adjust