CVE-2026-73429: Russh Denial of Service Vulnerability

MODERATE
Advisory Identifier: GHSA-g9hv-x236-4qp3
CVSS 5.3
CWE-704 CWE-754
Published
Advisory Summary

CVE-2026-73429 is a MODERATE (CVSS 5.3) denial of service vulnerability (CWE-704: Incorrect Type Conversion or Cast) affecting Russh libraries in the crates.io ecosystem. The issue involves client wrong-length x25519 `clone_from_slice` panic (pre-auth dos). Remediation is available by upgrading affected packages to version 0.62.4.

CVE-2026-73429 at a Glance

CVE Identifier CVE-2026-73429
GHSA Identifier GHSA-g9hv-x236-4qp3
Severity MODERATE
CVSS v3.1 Base Score 5.3
CWE Classification CWE-704: Incorrect Type Conversion or Cast
Affected Product Russh
Package Ecosystem crates.io
Published Date
Last Updated

Security Impact

CVSS: 5.3

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:N/S:U/C:N/I:N/A:L).

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

How to Fix CVE-2026-73429

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.62.4
Upgrade russh to 0.62.4
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-73429, 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.62.4), 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-704: Incorrect Type Conversion or Cast, where the product does not correctly convert an object, resource, or structure from one type to a different type. 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 A malicious SSH server can crash a `russh` client session with a single malformed key-exchange reply, causing a pre-authentication Denial-of-Service before the server host key is verified. The embedding process itself stays up, but the connection is killed deterministically. ### Details Every *other* kex path in `russh` validates the peer ephemeral length before cloning: - `Curve25519Kex::server_dh` (`russh/src/kex/curve25519.rs:61-65`) checks `if pubkey_len != 32 { return Err(crate::Error::Kex); }` before `clone_from_slice`. - The hybrid ML-KEM, ECDH-NIST, and DH/GEX paths all validate lengths. Only the client-side curve25519 `compute_shared_secret` is missing the check. This asymmetric validation gap makes the bug easy to miss in code review: a malicious *client* cannot panic a `russh` server this way (the server path checks the length), but a malicious *server* can panic a `russh` client. Incriminated source code (repo-relative paths): - Vulnerable `compute_shared_secret`: `russh/src/kex/curve25519.rs:110-117` (panic at line 113) - Client-side entry point: `russh/src/client/kex.rs:266-277` (`KEX_ECDH_REPLY` → `Bytes::decode` → `compute_shared_secret`) - Server-side contrast (has the length check): `russh/src/kex/curve25519.rs:51-88` (`server_dh`) - Session spawn site: `russh/src/client/mod.rs` (`connect_stream` → `russh_util::runtime::spawn`) - Runtime wrapper: `russh-util/src/runtime.rs:37-48` (`spawn` wraps `tokio::spawn`; panic surfaces as `JoinError`) ### PoC A standalone, self-contained Cargo PoC is provided in `vuln_poc/vuln_002_client_wronglen_x25519_panic/` in this repo. It installs a global panic hook that sets an `AtomicBool` if any panic fires, starts a malicious raw SSH server on `127.0.0.1:0` that completes the SSH id and `KEXINIT` exchange, reads the client `KEX_ECDH_INIT`, and sends `KEX_ECDH_REPLY` with a 16-byte server ephemeral (instead of 32) and a fake signature. It then calls `russh::client::connect` with `Preferred::kex` set to `curve25519-sha256` and a handler that accepts any server key (the check is never reached because the client panics first) and prints a clear verdict. Build & run: ```bash cd vuln_poc/vuln_002_client_wronglen_x25519_panic cargo run --release ``` Expected output (verdict line, from a successful reproduction): ``` [poc] panic captured: panicked at russh/src/kex/curve25519.rs:113:25: copy_from_slice: source slice length (16) does not match destination slice length (32) [!] Vulnerability reproduced: russh client panicked in Curve25519Kex::compute_shared_secret on a wrong-length (16-byte) server ephemeral before verifying the host key signature (pre-auth client DoS). ``` The malicious payload is the `f` field of `KEX_ECDH_REPLY`: ``` MSG_KEX_ECDH_REPLY (1 byte, value 0x1f) string K_S (server host key blob — any valid-looking bytes) string f (server ephemeral — 16 bytes of 0x00 instead of 32) string signature (fake; never verified by the client) ``` The length prefix of `f` is `4` (u32 BE) = 16, followed by 16 bytes. The `russh` client decodes this into `exchange.server_ephemeral` (a `Vec<u8>` of length 16) and passes it to `compute_shared_secret`, which panics on `clone_from_slice`. ### Impact **What kind of vulnerability:** CWE-704 (incorrect type conversion / cast — `clone_from_slice` length mismatch) → deterministic panic → pre-authentication per-connection Denial-of-Service. The attacker does not need the server's private key; any network position that can deliver a malformed `KEX_ECDH_REPLY` (a rogue server, or a MitM before authentication) suffices. **Who is impacted:** any deployment that uses `russh::client::connect` (or `connect_stream`) to connect to an attacker-controlled or MitM-reachable SSH server, and that negotiates `curve25519-sha256` (the default and most-preferred kex algorithm in `russh`). A single malformed `KEX_ECDH_REPLY` kills the client session; the attack is deterministic and single-packet. The panic is isolated to the spawned session task (`tokio::spawn` catches it and surfaces a `JoinError`), so the embedding process keeps running — the impact is per-connection DoS, not process crash, unless the embedder installs a custom panic hook that calls `std::process::abort`. **Workaround:** until a fix is released, clients can reduce exposure by disabling `curve25519-sha256` in the `Preferred::kex` list and preferring a kex algorithm whose peer-ephemeral length is validated (e.g. the ECDH-NIST or DH/GEX paths). This is a mitigation, not a fix. **Suggested fix (one-line length check, mirrors the existing server-side `server_dh` check):** ```rust // russh/src/kex/curve25519.rs, at the top of compute_shared_secret: fn compute_shared_secret(&mut self, remote_pubkey_: &[u8]) -> Result<(), crate::Error> { if remote_pubkey_.len() != 32 { return Err(crate::Error::Kex); } let local_secret = self.local_secret.take().ok_or(crate::Error::KexInit)?; let mut remote_pubkey = MontgomeryPoint([0; 32]); remote_pubkey.0.clone_from_slice(remote_pubkey_); let shared = local_secret * remote_pubkey; self.shared_secret = Some(shared); Ok(()) } ``` This makes the client-side `compute_shared_secret` consistent with the existing server-side `server_dh` check at `russh/src/kex/curve25519.rs:61-65` and with the other kex paths that already validate peer ephemeral lengths. [vuln_poc.zip](https://github.com/user-attachments/files/29255207/vuln_poc.zip)

CVE-2026-73429 Affected Russh Versions

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

References

Frequently Asked Questions

What is CVE-2026-73429?
CVE-2026-73429 is a security vulnerability in Russh involving client wrong-length X25519 `clone_from_slice` panic (pre-auth DoS) under CWE-704: Incorrect Type Conversion or Cast.
Which Russh versions are affected?
Affected versions include releases prior to 0.62.4 across affected packages: russh.
What version fixes CVE-2026-73429?
Upgrading to 0.62.4 (or the latest patched release for your respective branch) resolves the vulnerability.
Is russh affected?
Yes, russh is affected in releases prior to 0.62.4. Upgrade your dependency to 0.62.4 or later.
What is the CVSS score of CVE-2026-73429?
CVE-2026-73429 has a CVSS v3.1 base score of 5.3 (MODERATE) with vector string CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:L.
What CWE is associated with CVE-2026-73429?
CVE-2026-73429 is classified under CWE-704: Incorrect Type Conversion or Cast (The product does not correctly convert an object, resource, or structure from one type to a different type.).
How can I check crates.io dependencies for CVE-2026-73429?
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-g9hv-x236-4qp3",
  "modified" : "2026-08-12T20:53:25Z",
  "published" : "2026-07-24T16:47:16Z",
  "aliases" : [ "CVE-2026-73429" ],
  "summary" : "Russh: client wrong-length X25519 `clone_from_slice` panic (pre-auth DoS)",
  "details" : "### Summary\nA malicious SSH server can crash a `russh` client session with a single\nmalformed key-exchange reply, causing a pre-authentication Denial-of-Service\nbefore the server host key is verified. The embedding process itself stays\nup, but the connection is killed deterministically.\n\n### Details\nEvery *other* kex path in `russh` validates the peer ephemeral length before\ncloning:\n\n- `Curve25519Kex::server_dh` (`russh/src/kex/curve25519.rs:61-65`) checks\n  `if pubkey_len != 32 { return Err(crate::Error::Kex); }` before\n  `clone_from_slice`.\n- The hybrid ML-KEM, ECDH-NIST, and DH/GEX paths all validate lengths.\n\nOnly the client-side curve25519 `compute_shared_secret` is missing the check.\nThis asymmetric validation gap makes the bug easy to miss in code review: a\nmalicious *client* cannot panic a `russh` server this way (the server path\nchecks the length), but a malicious *server* can panic a `russh` client.\n\nIncriminated source code (repo-relative paths):\n\n- Vulnerable `compute_shared_secret`: `russh/src/kex/curve25519.rs:110-117` (panic at line 113)\n- Client-side entry point: `russh/src/client/kex.rs:266-277` (`KEX_ECDH_REPLY` → `Bytes::decode` → `compute_shared_secret`)\n- Server-side contrast (has the length check): `russh/src/kex/curve25519.rs:51-88` (`server_dh`)\n- Session spawn site: `russh/src/client/mod.rs` (`connect_stream` → `russh_util::runtime::spawn`)\n- Runtime wrapper: `russh-util/src/runtime.rs:37-48` (`spawn` wraps `tokio::spawn`; panic surfaces as `JoinError`)\n\n### PoC\nA standalone, self-contained Cargo PoC is provided in\n`vuln_poc/vuln_002_client_wronglen_x25519_panic/` in this repo. It installs a\nglobal panic hook that sets an `AtomicBool` if any panic fires, starts a\nmalicious raw SSH server on `127.0.0.1:0` that completes the SSH id and\n`KEXINIT` exchange, reads the client `KEX_ECDH_INIT`, and sends\n`KEX_ECDH_REPLY` with a 16-byte server ephemeral (instead of 32) and a fake\nsignature. It then calls `russh::client::connect` with `Preferred::kex` set\nto `curve25519-sha256` and a handler that accepts any server key (the check\nis never reached because the client panics first) and prints a clear verdict.\n\nBuild & run:\n\n```bash\ncd vuln_poc/vuln_002_client_wronglen_x25519_panic\ncargo run --release\n```\n\nExpected output (verdict line, from a successful reproduction):\n\n```\n[poc] panic captured: panicked at russh/src/kex/curve25519.rs:113:25:\n  copy_from_slice: source slice length (16) does not match destination slice length (32)\n[!] Vulnerability reproduced: russh client panicked in Curve25519Kex::compute_shared_secret\n  on a wrong-length (16-byte) server ephemeral before verifying the host key signature\n  (pre-auth client DoS).\n```\n\nThe malicious payload is the `f` field of `KEX_ECDH_REPLY`:\n\n```\nMSG_KEX_ECDH_REPLY (1 byte, value 0x1f)\n  string K_S            (server host key blob — any valid-looking bytes)\n  string f              (server ephemeral — 16 bytes of 0x00 instead of 32)\n  string signature      (fake; never verified by the client)\n```\n\nThe length prefix of `f` is `4` (u32 BE) = 16, followed by 16 bytes. The\n`russh` client decodes this into `exchange.server_ephemeral` (a `Vec<u8>` of\nlength 16) and passes it to `compute_shared_secret`, which panics on\n`clone_from_slice`.\n\n### Impact\n**What kind of vulnerability:** CWE-704 (incorrect type conversion / cast —\n`clone_from_slice` length mismatch) → deterministic panic → pre-authentication\nper-connection Denial-of-Service. The attacker does not need the server's\nprivate key; any network position that can deliver a malformed\n`KEX_ECDH_REPLY` (a rogue server, or a MitM before authentication) suffices.\n\n**Who is impacted:** any deployment that uses `russh::client::connect` (or\n`connect_stream`) to connect to an attacker-controlled or MitM-reachable SSH\nserver, and that negotiates `curve25519-sha256` (the default and\nmost-preferred kex algorithm in `russh`). A single malformed\n`KEX_ECDH_REPLY` kills the client session; the attack is deterministic and\nsingle-packet. The panic is isolated to the spawned session task\n(`tokio::spawn` catches it and surfaces a `JoinError`), so the embedding\nprocess keeps running — the impact is per-connection DoS, not process crash,\nunless the embedder installs a custom panic hook that calls\n`std::process::abort`.\n\n**Workaround:** until a fix is released, clients can reduce exposure by\ndisabling `curve25519-sha256` in the `Preferred::kex` list and preferring a\nkex algorithm whose peer-ephemeral length is validated (e.g. the ECDH-NIST\nor DH/GEX paths). This is a mitigation, not a fix.\n\n**Suggested fix (one-line length check, mirrors the existing server-side\n`server_dh` check):**\n\n```rust\n// russh/src/kex/curve25519.rs, at the top of compute_shared_secret:\nfn compute_shared_secret(&mut self, remote_pubkey_: &[u8]) -> Result<(), crate::Error> {\n    if remote_pubkey_.len() != 32 {\n        return Err(crate::Error::Kex);\n    }\n    let local_secret = self.local_secret.take().ok_or(crate::Error::KexInit)?;\n    let mut remote_pubkey = MontgomeryPoint([0; 32]);\n    remote_pubkey.0.clone_from_slice(remote_pubkey_);\n    let shared = local_secret * remote_pubkey;\n    self.shared_secret = Some(shared);\n    Ok(())\n}\n```\n\nThis makes the client-side `compute_shared_secret` consistent with the\nexisting server-side `server_dh` check at `russh/src/kex/curve25519.rs:61-65`\nand with the other kex paths that already validate peer ephemeral lengths.\n\n[vuln_poc.zip](https://github.com/user-attachments/files/29255207/vuln_poc.zip)",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:L"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "crates.io",
      "name" : "russh"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "0.62.4"
      } ]
    } ],
    "database_specific" : {
      "last_known_affected_version_range" : "<= 0.62.3"
    }
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/Eugeny/russh/security/advisories/GHSA-g9hv-x236-4qp3"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/Eugeny/russh/commit/a7fc1eb5717264e31c3c5f7dd849b73989a08f3d"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/Eugeny/russh"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/Eugeny/russh/releases/tag/v0.62.4"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-704", "CWE-754" ],
    "severity" : "MODERATE",
    "github_reviewed" : true,
    "github_reviewed_at" : "2026-07-24T16:47:16Z",
    "nvd_published_at" : null
  }
}