High severity7.5NVD Advisory· Published May 8, 2026· Updated May 14, 2026
CVE-2026-42189
CVE-2026-42189
Description
Russh is a Rust SSH client & server library. Prior to version 0.60.1, 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. This issue has been patched in version 0.60.1.
Affected packages
Versions sourced from the GitHub Security Advisory.
| Package | Affected versions | Patched versions |
|---|---|---|
russhcrates.io | < 0.60.1 | 0.60.1 |
Patches
16c3c80a9b6d6Merge commit from fork
1 file changed · +7 −1
russh/src/server/encrypted.rs+7 −1 modified@@ -522,7 +522,13 @@ async fn read_userauth_info_response<H: Handler + Send, R: Reader>( if let Some(CurrentRequest::KeyboardInteractive { ref submethods }) = auth_request.current { let n = map_err!(u32::decode(r))?; - let mut responses = Vec::with_capacity(n as usize); + // 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()) }
Vulnerability mechanics
Generated by null/stub on May 9, 2026. Inputs: CWE entries + fix-commit diffs from this CVE's patches. Citations validated against bundle.
References
5- github.com/Eugeny/russh/commit/6c3c80a9b6d60763d6227d60fa8310e57172a4d1nvdPatchWEB
- github.com/Eugeny/russh/security/advisories/GHSA-f5v4-2wr6-hqmgnvdExploitMitigationVendor AdvisoryWEB
- github.com/advisories/GHSA-f5v4-2wr6-hqmgghsaADVISORY
- nvd.nist.gov/vuln/detail/CVE-2026-42189ghsaADVISORY
- github.com/Eugeny/russh/releases/tag/v0.60.1nvdProductRelease NotesWEB
News mentions
0No linked articles in our index yet.