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-111061 Overview
The russh Rust SSH client and server library contains a resource exhaustion vulnerability in its SSH agent protocol implementation. Versions prior to 0.64.1 spawn a separate long-lived task for every SSH_AGENT_CONSTRAIN_LIFETIME record received in a constrained add-key request. The loop accepts repeated lifetime records, clones the key blob into each spawned task, and fails to roll back tasks when later constraint parsing fails. An attacker who can speak the agent protocol locally or through SSH agent forwarding can exhaust memory and asynchronous tasks until the agent process is starved or terminated. The flaw is tracked as [CWE-770: Allocation of Resources Without Limits or Throttling] and resolved in russh version 0.64.1.
Critical Impact
Denial of service against the SSH agent process through unbounded task spawning and key blob cloning triggered by malformed add-key requests.
Affected Products
- russh Rust SSH client and server library prior to version 0.64.1
- Applications embedding the russh agent server implementation
- Deployments exposing the agent via local sockets or SSH agent forwarding
Discovery Timeline
- 2026-10-19 - CVE-2026-111061 published to NVD
- 2026-10-19 - Last updated in NVD database
Technical Details for CVE-2026-111061
Vulnerability Analysis
The defect resides in the agent server implementation at russh/src/keys/agent/server.rs. When handling a constrained add-key request, the server iterates through constraint records and spawns a dedicated Tokio task for each SSH_AGENT_CONSTRAIN_LIFETIME entry encountered. The implementation does not deduplicate or cap these lifetime constraints, nor does it validate the remaining constraint stream before committing resources.
Each spawned task clones the full key blob into its own state, multiplying memory usage per request. If a later constraint record in the same message fails to parse, the server returns an error but leaves every previously spawned lifetime task running. An attacker can send repeated add-key messages carrying many duplicate lifetime records, forcing the agent to allocate and persist tasks until the process is starved of memory or the Tokio runtime is saturated.
Root Cause
The root cause is missing bounds enforcement on constraint records and absent transactional rollback semantics during constraint parsing. The agent treats each SSH_AGENT_CONSTRAIN_LIFETIME entry as an independent long-lived scheduling obligation rather than consolidating lifetimes into a single timer per key.
Attack Vector
Exploitation requires the ability to speak the SSH agent protocol to a vulnerable russh agent server. This is reachable through a local Unix domain socket on a shared host or through SSH agent forwarding when a user forwards their agent to a system the attacker controls. No authentication is required beyond access to the agent socket, and no user interaction is needed.
// Patch excerpt from russh/src/keys/agent/server.rs
// Source: https://github.com/Eugeny/russh/commit/4c305033d72f8e5dd21a3fd4c53a6c291a16ebd1
use tokio::time::sleep;
use {std, tokio};
-use super::{msg, Constraint};
-use crate::helpers::{sign_with_hash_alg, EncodedExt};
-use crate::keys::key::PrivateKeyWithHashAlg;
-use crate::keys::Error;
+use super::{Constraint, msg};
use crate::CryptoVec;
+use crate::helpers::{EncodedExt, sign_with_hash_alg};
+use crate::keys::Error;
+use crate::keys::key::PrivateKeyWithHashAlg;
const MAX_AGENT_FRAME_LEN: usize = 256 * 1024;
The accompanying regression test confirms the server now rejects duplicate lifetime constraints:
// Source: https://github.com/Eugeny/russh/commit/4c305033d72f8e5dd21a3fd4c53a6c291a16ebd1
#[tokio::test]
#[cfg(unix)]
async fn test_agent_rejects_duplicate_lifetime() {
#[derive(Clone)]
struct X {}
impl agent::server::Agent for X {}
let dir = tempfile::tempdir().unwrap();
let agent_path = dir.path().join("agent");
let mut listener = tokio::net::UnixListener::bind(&agent_path).unwrap();
tokio::spawn(async move {
agent::server::serve(
Incoming { listener: &mut listener },
X {},
).await
});
let key = decode_secret_key(ED25519_KEY, Some("blabla")).unwrap();
let stream = tokio::net::UnixStream::connect(&agent_path).await.unwrap();
let mut client = agent::client::AgentClient::connect(stream);
let lifetime = || agent::Constraint::KeyLifetime { seconds: 60 };
assert!(client.add_identity(&key, &[lifetime(), lifetime()]).await;
}
Detection Methods for CVE-2026-111061
Indicators of Compromise
- Rapid growth of resident memory in processes linking the russh agent server component.
- Unusual volume of SSH2_AGENTC_ADD_ID_CONSTRAINED messages arriving on an agent socket.
- Agent process termination by the OOM killer or runtime task saturation errors in logs.
Detection Strategies
- Audit application dependencies for russh versions earlier than 0.64.1 using cargo tree or software bill of materials tooling.
- Instrument the agent server to log add-key requests containing multiple SSH_AGENT_CONSTRAIN_LIFETIME records.
- Monitor Tokio runtime metrics for anomalous spikes in active task counts correlated with agent traffic.
Monitoring Recommendations
- Alert on sustained memory growth or restart loops for services embedding russh.
- Collect telemetry on open agent socket connections and the originating processes or forwarded sessions.
- Review SSH agent forwarding policies and log forwarded agent endpoints that interact with untrusted hosts.
How to Mitigate CVE-2026-111061
Immediate Actions Required
- Upgrade all applications and services depending on russh to version 0.64.1 or later.
- Disable SSH agent forwarding to untrusted or multi-tenant hosts until patched builds are deployed.
- Restrict filesystem permissions on agent Unix sockets to the owning user only.
Patch Information
The fix is published in russhv0.64.1. Technical details are available in the GitHub Security Advisory GHSA-4wc5-f2rc-q74m and the upstream commit, which rejects duplicate lifetime constraints and prevents orphaned task spawning.
Workarounds
- Avoid exposing the russh agent server to untrusted local users or forwarded sessions.
- Enforce process-level resource limits using systemd or cgroups to cap memory and task counts for agent hosts.
- Terminate SSH sessions that do not require agent forwarding using ssh -a or explicit ForwardAgent no configuration.
# Enforce ForwardAgent no in SSH client configuration
cat >> ~/.ssh/config <<'EOF'
Host *
ForwardAgent no
EOF
# Verify installed russh version in a Rust project
cargo tree -i russh
# Upgrade to the patched release
cargo update -p russh --precise 0.64.1
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

