CVE-2026-48107: Russh Unchecked Keyboard-interactive Prompt Count Vulnerability

MODERATE
Advisory Identifier: GHSA-g9g7-5cgw-6v28
CVSS 6.5
CWE-20
Published
Advisory Summary

CVE-2026-48107 is a MODERATE (CVSS 6.5) unchecked keyboard-interactive prompt count vulnerability (CWE-20: Improper Input Validation) affecting Russh libraries in the crates.io ecosystem. The issue involves unchecked keyboard-interactive prompt count in client auth path. Remediation is available by upgrading affected packages to version 0.61.0.

CVE-2026-48107 at a Glance

CVE Identifier CVE-2026-48107
GHSA Identifier GHSA-g9g7-5cgw-6v28
Severity MODERATE
CVSS v3.1 Base Score 6.5
CWE Classification CWE-20: Improper Input Validation
Affected Product Russh
Package Ecosystem crates.io
Published Date
Last Updated

Security Impact

CVSS: 6.5

The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:N/I:N/A:H).

Attack Vector Network (AV:N)
Attack Complexity Low (AC:L)
Privileges Required None (PR:N)
User Interaction Required (UI:R)
Scope Unchanged (S:U)
Confidentiality None (C:N)
Integrity None (I:N)
Availability High (A:H)

How to Fix CVE-2026-48107

To remediate this vulnerability, upgrade all affected Russh dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.

russh fixed: 0.61.0
Upgrade russh to 0.61.0
Verify Direct and Transitive Dependencies

Run the following command in your project directory to verify that all resolved dependencies use the patched release:

inspect dependencies for russh

How to Check if You Are Affected

To determine whether your application is affected by CVE-2026-48107, inspect your project dependencies for Russh:

inspect dependencies for russh

Analyze the terminal output to locate any version of Russh in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 0.61.0), your application is affected.

Note: Verify declared build manifests and deployed runtime container environments.

Technical Details

Vulnerability Mechanism & Technical Analysis

This vulnerability is classified under CWE-20: Improper Input Validation, where the product receives input or data, but it does not validate or incorrectly validates that the input has the properties that are required to process the data safely and correctly. In Russh, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.

Source Advisory Statement

### Summary In the `russh` client keyboard-interactive authentication path, a malicious SSH server could send a `USERAUTH_INFO_REQUEST` with an attacker-controlled prompt count, and the client would use that raw count directly in `Vec::with_capacity(...)` before validating that enough prompt data was actually present in the packet. This is a client-side denial-of-service / resource-exhaustion issue on the keyboard-interactive auth path. ### Details The vulnerable code path is in: - `russh/src/client/encrypted.rs` When the client is in `CurrentRequest::KeyboardInteractive` state and receives `SSH_MSG_USERAUTH_INFO_REQUEST`, it parses: 1. `name` 2. `instructions` 3. `language tag` 4. `n_prompts` Before the fix, the code then did: ```rust let n_prompts = map_err!(u32::decode(&mut r))?; let mut prompts = Vec::with_capacity(n_prompts.try_into().unwrap_or(0)); ``` That means a malicious server could advertise an enormous `n_prompts` value even if the packet contained no prompt bodies at all. The fix rejects inconsistent prompt counts before allocating: ```rust let n_prompts = map_err!(u32::decode(&mut r))?; let max_prompts = r.remaining_len() / 5; let n_prompts = n_prompts as usize; if n_prompts > max_prompts { return Err(crate::Error::Inconsistent.into()); } let mut prompts = Vec::with_capacity(n_prompts); ``` Each prompt needs at least 4 bytes of string length plus 1 byte of echo flag, so `remaining_len() / 5` is a safe upper bound. If the declared count exceeds what the packet can actually contain, the packet is malformed and is now rejected instead of being silently truncated. The tester did not find a same-class server-side bug in the reciprocal `USERAUTH_INFO_RESPONSE` path. The server already bounds the response count by remaining packet length before allocating. Affected package and versions: - package: `russh` - earliest affected stable: `0.37.0` - confirmed affected current release: `0.60.2` The tester does not believe this issue affects the other crates in this workspace (`russh-config`, `russh-cryptovec`, `pageant`, or `russh-util`). ### PoC An in-tree regression test was added: - `client::tests::oversized_keyboard_interactive_prompt_count_is_rejected` The test builds a client session in `WaitingAuthRequest(KeyboardInteractive)` state, feeds it a synthetic `USERAUTH_INFO_REQUEST` packet with: - normal `name` - normal `instructions` - empty language tag - `n_prompts = u32::MAX` - no prompt bodies On the fixed code, the client rejects the packet with `Error::Inconsistent` and does not emit a reply to the caller. For old-code impact verification, the pre-fix path was also checked separately with a constrained-memory repro. On unfixed `upstream/main`, the same malformed packet attempted a very large allocation and failed with: ```text memory allocation of 137438953440 bytes failed ``` Relevant verification commands: ```bash cargo test -p russh oversized_keyboard_interactive_prompt_count_is_rejected -- --nocapture cargo test -p russh --lib --no-default-features --features ring oversized_keyboard_interactive_prompt_count_is_rejected -- --nocapture ``` ### Impact Suggested CVSS v3.1: - `CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:N/I:N/A:H` - Score: `6.5` Reasoning: - `AV:N`: reached by a malicious SSH server over the network - `AC:L`: the packet format is straightforward - `PR:N`: no prior authentication required - `UI:R`: the victim must initiate a connection and proceed into keyboard-interactive auth - `C:N`, `I:N`: Confidentiality or integrity impact were not demonstrated - `A:H`: the server can drive a very large allocation attempt in the client auth path, which can abort or exhaust client-side resources depending on allocator and platform behavior

CVE-2026-48107 Affected Russh Versions

1 component(s)
Fixed Versions:
0.61.0
Product / Package Ecosystem Affected Versions Fixed Version
russh
crates.io
≥ 0.37.0
< 0.61.0
0.61.0

References

Frequently Asked Questions

What is CVE-2026-48107?
CVE-2026-48107 is a security vulnerability in Russh involving Unchecked keyboard-interactive prompt count in client auth path under CWE-20: Improper Input Validation.
Which Russh versions are affected?
Affected versions include releases prior to 0.61.0 across affected packages: russh.
What version fixes CVE-2026-48107?
Upgrading to 0.61.0 (or the latest patched release for your respective branch) resolves the vulnerability.
Is russh affected?
Yes, russh is affected in releases prior to 0.61.0. Upgrade your dependency to 0.61.0 or later.
What is the CVSS score of CVE-2026-48107?
CVE-2026-48107 has a CVSS v3.1 base score of 6.5 (MODERATE) with vector string CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:N/I:N/A:H.
What CWE is associated with CVE-2026-48107?
CVE-2026-48107 is classified under CWE-20: Improper Input Validation (The product receives input or data, but it does not validate or incorrectly validates that the input has the properties that are required to process the data safely and correctly.).
How can I check crates.io dependencies for CVE-2026-48107?
Run the dependency tree command: 'inspect dependencies for russh'. This command lists direct and transitive dependencies in your build configuration so you can verify if a vulnerable version is resolved.
Machine-readable OSV JSON OSV v1.5 Schema
Normalized schema output
{
  "schema_version" : "1.4.0",
  "id" : "GHSA-g9g7-5cgw-6v28",
  "modified" : "2026-06-11T20:28:56Z",
  "published" : "2026-06-11T20:28:56Z",
  "aliases" : [ "CVE-2026-48107" ],
  "summary" : "Russh: Unchecked keyboard-interactive prompt count in client auth path",
  "details" : "### Summary\nIn the `russh` client keyboard-interactive authentication path, a malicious SSH server could send a `USERAUTH_INFO_REQUEST` with an attacker-controlled prompt count, and the client would use that raw count directly in `Vec::with_capacity(...)` before validating that enough prompt data was actually present in the packet.\n\nThis is a client-side denial-of-service / resource-exhaustion issue on the keyboard-interactive auth path.\n\n### Details\nThe vulnerable code path is in:\n\n- `russh/src/client/encrypted.rs`\n\nWhen the client is in `CurrentRequest::KeyboardInteractive` state and receives `SSH_MSG_USERAUTH_INFO_REQUEST`, it parses:\n\n1. `name`\n2. `instructions`\n3. `language tag`\n4. `n_prompts`\n\nBefore the fix, the code then did:\n\n```rust\nlet n_prompts = map_err!(u32::decode(&mut r))?;\nlet mut prompts = Vec::with_capacity(n_prompts.try_into().unwrap_or(0));\n```\n\nThat means a malicious server could advertise an enormous `n_prompts` value even if the packet contained no prompt bodies at all.\n\nThe fix rejects inconsistent prompt counts before allocating:\n\n```rust\nlet n_prompts = map_err!(u32::decode(&mut r))?;\nlet max_prompts = r.remaining_len() / 5;\nlet n_prompts = n_prompts as usize;\nif n_prompts > max_prompts {\n    return Err(crate::Error::Inconsistent.into());\n}\nlet mut prompts = Vec::with_capacity(n_prompts);\n```\n\nEach prompt needs at least 4 bytes of string length plus 1 byte of echo flag, so `remaining_len() / 5` is a safe upper bound. If the declared count exceeds what the packet can actually contain, the packet is malformed and is now rejected instead of being silently truncated.\n\nThe tester did not find a same-class server-side bug in the reciprocal `USERAUTH_INFO_RESPONSE` path. The server already bounds the response count by remaining packet length before allocating.\n\nAffected package and versions:\n\n- package: `russh`\n- earliest affected stable: `0.37.0`\n- confirmed affected current release: `0.60.2`\n\nThe tester does not believe this issue affects the other crates in this workspace (`russh-config`, `russh-cryptovec`, `pageant`, or `russh-util`).\n\n### PoC\nAn in-tree regression test was added:\n\n- `client::tests::oversized_keyboard_interactive_prompt_count_is_rejected`\n\nThe test builds a client session in `WaitingAuthRequest(KeyboardInteractive)` state, feeds it a synthetic `USERAUTH_INFO_REQUEST` packet with:\n\n- normal `name`\n- normal `instructions`\n- empty language tag\n- `n_prompts = u32::MAX`\n- no prompt bodies\n\nOn the fixed code, the client rejects the packet with `Error::Inconsistent` and does not emit a reply to the caller.\n\nFor old-code impact verification, the pre-fix path was also checked separately with a constrained-memory repro. On unfixed `upstream/main`, the same malformed packet attempted a very large allocation and failed with:\n\n```text\nmemory allocation of 137438953440 bytes failed\n```\n\nRelevant verification commands:\n\n```bash\ncargo test -p russh oversized_keyboard_interactive_prompt_count_is_rejected -- --nocapture\ncargo test -p russh --lib --no-default-features --features ring oversized_keyboard_interactive_prompt_count_is_rejected -- --nocapture\n```\n\n### Impact\nSuggested CVSS v3.1:\n\n- `CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:N/I:N/A:H`\n- Score: `6.5`\n\nReasoning:\n\n- `AV:N`: reached by a malicious SSH server over the network\n- `AC:L`: the packet format is straightforward\n- `PR:N`: no prior authentication required\n- `UI:R`: the victim must initiate a connection and proceed into keyboard-interactive auth\n- `C:N`, `I:N`:  Confidentiality or integrity impact were not demonstrated\n- `A:H`: the server can drive a very large allocation attempt in the client auth path, which can abort or exhaust client-side resources depending on allocator and platform behavior",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:N/I:N/A:H"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "crates.io",
      "name" : "russh"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0.37.0"
      }, {
        "fixed" : "0.61.0"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/Eugeny/russh/security/advisories/GHSA-g9g7-5cgw-6v28"
  }, {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2026-48107"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/Eugeny/russh"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-20" ],
    "severity" : "MODERATE",
    "github_reviewed" : true,
    "github_reviewed_at" : "2026-06-11T20:28:56Z",
    "nvd_published_at" : "2026-06-10T22:17:00Z"
  }
}