Skip to main content
Vulnerability Database/CVE-2026-102821

CVE-2026-102821: Russh SSH Library DOS Vulnerability

CVE-2026-102821 is a denial of service vulnerability in Russh SSH library that allows authenticated attackers to exhaust server memory through message flooding. This article covers technical details, affected versions, and mitigation strategies.

Published:

Disclaimer: This content was generated using AI. While we strive for accuracy, please verify critical information with official sources.

Sources: National Vulnerability Database, CISA KEV, Exploit-DB

CVE-2026-102821 Overview

CVE-2026-102821 is a resource exhaustion vulnerability in Russh, a Rust SSH client and server library. An authenticated remote peer can trigger unbounded memory growth by sending an SSH_MSG_KEXINIT message without the required SSH_MSG_KEX_ECDH_INIT follow-up, then flooding the server with SSH_MSG_CHANNEL_OPEN messages. While the session key exchange state remains InProgress, the priority_receiver in russh/src/server/session.rs cannot be drained. The server continues enqueuing a ChannelOpenReply for each request on an unbounded channel, causing one connection to consume memory until the process is terminated. The issue is fixed in version 0.63.2.

Critical Impact

A single authenticated attacker can exhaust server memory and crash the Russh-based SSH service, resulting in denial of service for all connected clients.

Affected Products

  • Russh SSH library versions prior to 0.63.2
  • Rust-based SSH servers built on Russh
  • Applications embedding Russh for SSH server functionality

Discovery Timeline

  • 2026-09-29 - CVE-2026-102821 published to NVD
  • 2026-09-29 - Last updated in NVD database

Technical Details for CVE-2026-102821

Vulnerability Analysis

The vulnerability resides in Russh's server-side session handling logic. During SSH key exchange, the server enters a SessionKexState::InProgress state after receiving SSH_MSG_KEXINIT from the client. The protocol expects the client to follow up with SSH_MSG_KEX_ECDH_INIT to complete the exchange. An attacker can omit this message, keeping the session stuck in the InProgress state indefinitely.

While in this state, the priority_receiver channel in russh/src/server/session.rs is not drained. However, the server continues accepting and processing other network messages, including SSH_MSG_CHANNEL_OPEN requests. Each channel open request causes the server to enqueue a ChannelOpenReply on an unbounded channel, allowing an attacker to inflate memory consumption without limit. This maps to [CWE-400: Uncontrolled Resource Consumption].

Root Cause

The root cause is a design flaw combining two conditions: an unbounded internal message channel used for ChannelOpenReply messages, and continued processing of channel-open requests while key exchange is stalled. The server does not backpressure or reject incoming channel requests during SessionKexState::InProgress, and the priority queue remains blocked from drainage.

Attack Vector

Exploitation requires network access and valid authentication credentials on the target SSH server. The attacker completes authentication, sends SSH_MSG_KEXINIT without the expected SSH_MSG_KEX_ECDH_INIT, then floods the session with SSH_MSG_CHANNEL_OPEN messages. A single connection is sufficient to grow server memory until the operating system terminates the process.

rust
// Security patch in russh/src/client/kex.rs
// Adds tracking for whether the peer's KEXINIT has arrived
pub fn peer_kexinit_received(&self) -> bool {
    !matches!(self.state, ClientKexState::Created)
}

// Security patch in russh/src/client/mod.rs
// Resets pending message length counter when beginning re-key
fn begin_rekey(&mut self) -> Result<(), crate::Error> {
    debug!("beginning re-key");
    self.pending_len = 0;
    let mut kex = ClientKex::new(
        self.common.config.clone(),
        &self.common.config.client_id,
    );
}

Source: GitHub Commit a282af3

Detection Methods for CVE-2026-102821

Indicators of Compromise

  • Sudden and sustained memory growth in a Russh-based SSH server process tied to a single connection
  • SSH sessions that authenticate, send SSH_MSG_KEXINIT, then never complete key exchange
  • High rate of SSH_MSG_CHANNEL_OPEN messages from a single authenticated peer without corresponding channel activity
  • Out-of-memory (OOM) kills or process restarts on SSH server hosts running Russh

Detection Strategies

  • Monitor per-connection memory attribution on SSH server processes and alert on outliers
  • Instrument Russh with connection-level metrics tracking pending ChannelOpenReply queue depth
  • Correlate authentication logs with subsequent key-exchange completion; flag sessions stalled in InProgress state
  • Track anomalous ratios of SSH_MSG_CHANNEL_OPEN messages to established channels per session

Monitoring Recommendations

  • Deploy resource limits (cgroups, systemd MemoryMax) on SSH server processes and alert on enforcement events
  • Log and rate-limit inbound SSH connections at the network perimeter
  • Enable OS-level auditing for OOM kills and unexpected SSH service restarts
  • Aggregate host telemetry into a central SIEM to correlate memory anomalies with authentication events

How to Mitigate CVE-2026-102821

Immediate Actions Required

  • Upgrade all applications using Russh to version 0.63.2 or later immediately
  • Audit dependency trees with cargo tree to identify transitive Russh dependencies requiring updates
  • Restrict SSH access to trusted networks and enforce strong authentication controls
  • Apply per-process memory limits to Russh-based SSH services to contain exploitation impact

Patch Information

The fix is available in Russh v0.63.2. The patch is described in GHSA-35g8-35p8-c8fw and implemented in commit a282af3. Update the dependency in Cargo.toml and rebuild affected binaries.

Workarounds

  • Terminate long-running SSH sessions that fail to complete key exchange within a short timeout
  • Reduce the number of authenticated users on Russh-based servers until patches are applied
  • Place Russh-based SSH services behind a bastion host or SSH proxy that enforces protocol conformance
  • Configure operating system OOM policies to restart the SSH service automatically on memory exhaustion
bash
# Update Russh in Cargo.toml to the patched version
[dependencies]
russh = "0.63.2"

# Rebuild and verify the resolved version
cargo update -p russh
cargo tree | grep russh

# Apply a systemd memory limit as a defense-in-depth control
# /etc/systemd/system/my-ssh-service.service.d/limits.conf
[Service]
MemoryMax=512M
Restart=on-failure

Disclaimer: This content was generated using AI. While we strive for accuracy, please verify critical information with official sources.

Sources: National Vulnerability Database, CISA KEV, Exploit-DB

Experience the Most Advanced Cybersecurity Platform

See how the world’s most intelligent, autonomous cybersecurity platform can protect your organization today and into the future.