NewYour coding agent can read the release notes before it upgrades.Set up the MCP server →
crates.io
crates.io, #3404 most downloaded on crates.io
A vector which zeroes its memory on clears and reallocations.
Latest stable
0.62.0
Last release 4 months ago
02 Jul 2026
Release timing varies
gaps range from 1 weeks to 11 months
Most releases are documented
notes for 9 of 15 stable releases
Nothing withdrawn
no release was ever pulled
5 years old
19 releases · first in 2022
Drag across the ruler to compare, or tap a release to open it.
This changes the signature of the Handler::channel_open_* functions to allow you to make the channel accept/reject decision outside of the main event
This changes the signature of the Handler::channel_open_* functions to allow you to make the channel accept/reject decision outside of the main event loop. Instead of immediately returning a bool, they take an additional reply: ChannelOpenHandle argument, which you can move into another async task to confirm or reject the channel later. After the handler function returns, the event loop is immediately unblocked.
This also lets you specify the protocol-level rejection reason.
Migrating your existing code:
async fn channel_open_session(
&mut self,
channel: Channel<Msg>,
+ reply: server::ChannelOpenHandle,
session: &mut Session,
- ) -> Result<bool, Self::Error> {
+ ) -> Result<(), Self::Error> {
if (...) {
- Ok(false)
+ reply.reject(ChannelOpenFailure::AdministrativelyProhibited).await;
} else {
- Ok(true)
+ reply.accept().await;
}
+ Ok(())
}
Full Changelog: https://github.com/Eugeny/russh/compare/v0.61.2...v0.62.0
32fd46f: Reduce russh write-path copies with direct Bytes sends (#695) (Mika Cohen) #695
Your coding agent can read these notes before it upgrades. Set up the MCP server →
32fd46f: Reduce russh write-path copies with direct Bytes sends (#695) (Mika Cohen) #695
Channel::data_bytesChannel::extended_data_bytesChannelWriteHalf::data_bytesChannelWriteHalf::extended_data_bytesdeps: migrate to stable versions pkcs5 / pkcs8 / ed25519 and loosen prerelease pins (extends #697) (#702) #702 (escapecode)
72b250a: migrate to upstream ssh-key crate and update RustCrypto crates (#709) (Eugene) #709
Part of the hardening efforts by @mjc
russh server implementation would not correctly reset its internal state (allowed methods and "partial success" state), which could lead to incorrect responses to the client.
keyboard-interactive authentication request, the prompt counter was used to directly allocate memory without verifying it, which can lead to denial of service.russh server did not enfore the SSH protocol header validation strictly enough, allowing a client to hold the connection open indefinitely, wasting resources.When compression is negotiated, an attacker can craft a "ZIP bomb" style packet that would bypass the maximum packet size checks. This could allow the
When compression is negotiated, an attacker can craft a "ZIP bomb" style packet that would bypass the maximum packet size checks. This could allow the attacker to hit the OOM limit and either get the server process killed by the OS, or, prior to russh@0.58.0, aborted. A similar issue existed in the AgentClient as well, which could be triggered by a malformed SSH agent response.
084dbcf: Replace Deprecated Function Calls to criterion::black_box() (#683) (Roger Knecht) #683
eliminate mlock/munlock overhead for non-secret buffers (~21% throughput improvement) (#653) #653 (Mika Cohen)
eliminate mlock/munlock overhead for non-secret buffers (~21% throughput improvement) (#653) #653 (Mika Cohen)
CryptoVec, reducing the performance overhead. A few public functions that took CryptoVec now take impl Into<Bytes> instead.6f70150: Remove heap allocations from SshId (#656) (kpcyrd) #656
SshId::Standard() now contains a Cow<'static, str> instead of a String.0f51860: Expose HostConfig fields to external consumers (#652) (François Bernier) #652
e75de5a: Add russh/serde feature to enable serde on russh::keys::PublicKey (#655) (kpcyrd) #655
replace memset with zeroize in resize() method (#634) #634 (Eric Rodrigues Pires)
bump thiserror to latest version (#651) #651 (Roger Knecht)
b7ce487: Remove Home Crate Dependency (#667) (Roger Knecht) #667
bebe8c0: fixed #658 - make Handle::tcpip_forward and Handle::streamlocal_forward take &self (Eugene)
make ChannelWriteHalf::make_writer[_ext] public, fix #498 (#499) #499 (Mingwei Samuel)
ChannelWriteHalf::make_writer[_ext] public, fix #498 (#499) #499 (Mingwei Samuel)ChannelReadHalf::make_reader[_ext], #498 (#502) #502 (Mingwei Samuel)Handle::send_keepalive (#511) (Uli Schlachter) #511client::Handle::debug (#510) (Pascal Grange) #510make ChannelWriteHalf::make_writer[_ext] public, fix #498 (#499) #499 (Mingwei Samuel)
ChannelWriteHalf::make_writer[_ext] public, fix #498 (#499) #499 (Mingwei Samuel)ChannelReadHalf::make_reader[_ext], #498 (#502) #502 (Mingwei Samuel)Handle::send_keepalive (#511) (Uli Schlachter) #511client::Handle::debug (#510) (Pascal Grange) #51071cd4ab: fixed #468 - allow RSA keys below 2048-bit length
russh has previously disallowed <2048-bit RSA keys - whether as private or as server host keys, both as server and client due to a security check in the ssh-key crate.
This behaviour has now been changed to allow these keys, and the decision to accept or reject them now lies on the library consumer. To recreate the old behaviour within your Handler, add the following check to your check_server_key implementation. You'll need to import the rsa crate.
async fn check_server_key(
&mut self,
server_public_key: &PublicKey,
) -> Result<bool, Self::Error> {
use rsa::traits::PublicKeyParts;
if let Some(ssh_pk) = server_public_key.key_data().rsa() {
let rsa_pk: rsa::RsaPublicKey = ssh_pk.try_into()?;
if rsa_pk.size() < 2048 {
return Ok(false);
}
}
...
}
partial_success support (#478) #478best_supported_rsa_hash method. Previously there was a race condition between calling best_supported_rsa_hash and the server sending the EXT_INFO message. Now russh will wait for up to one second to receive EXT_INFO when you call best_supported_rsa_hash.Channel::split() to allow splitting a channel into a read half and a write half (#482) (Uli Schlachter) #482libc dependency with nix (#483) #483 (iHsin)Nothing published for this version
e574068: fixed #460 - do not panic on mlock failures (#464) (Eugene) #464
russh-cryptovec@0.50.2Reverted a change from 0.50.0 that made cryptovec panic when the OS fails to mlock() the memory.
Instead, russh-cryptovec will log a one-time log warning about this.
A common cause for these errors is running on Linux under a low RLIMIT_MEMLOCK limit
23cc724: (#450) - the russh_keys crate has been fully merged into russh. If you have been importing from russh::keys, no changes are needed, otherwise
russh_keys merged into russhrussh_keys crate has been fully merged into russh. If you have been importing from russh::keys, no changes are needed, otherwise remove the russh_keys dependency and replace all use russh_keys imports with use russh::keys.client::Handler, server::Handler and other traits are now native Rust async traits. In most cases, you can simply remove the #[async_trait] macro from your trait impl. Alternatively, you can enable the async_trait feature, which will turn the traits into #[async_trait]s again. Note that the old async_trait support will be removed soon.Russh client now supports the server-sig-algs OpenSSH extension and can automatically select the strongest hash for RSA keys.
You can use russh::client::Handle::best_supported_rsa_hash() to choose the hash.
PrivateKeyWithHashAlg::new is now infallible and will ignore hash_alg for non-RSA keys, so you don't have to build separate logic just for RSA keys:
session.authenticate_publickey(
user,
PrivateKeyWithHashAlg::new(
Arc::new(key_pair),
session.best_supported_rsa_hash().await?.unwrap_or(...), // some fallback Option<HashAlg>
),
).await?;
If you just want to fall back to SHA1 / ssh-rsa in case the server does not support server-sig-algs:
session.authenticate_publickey(
user,
PrivateKeyWithHashAlg::new(
Arc::new(key_pair),
session.best_supported_rsa_hash().await?.flatten(),
),
).await?;
Config::channel_buffer_size to control how many channel messages can be buffered before backpressure propagates over the network. Previously russh would simply buffer unread channel messages infinitely, eventually causing an out-of-RAM situation, and now it will block the connection until you consume them. Even if the server does not write data to the channel (e.g. it's a write-only channel for you as a client), it is still writing flow control messages, which you must consume.So, any time you open a channel, make sure you have a loop somewhere that is either polling .wait() or reads from the AsyncRead side of its ChannelStream.
ssh-key traitsrussh has migrated to its own fork of the ssh-key crate, removed bundled workarounds - if you were relying on traits directly imported from ssh_key, you might need to import them from russh::keys::ssh_key instead.diffie-hellman-group-exchange-sha256 KEX is now on the default kex list. To take advantage of dynamic DH groups, pre-generate some safe primes and implement dynamic group lookup in the server::Handler::lookup_dh_gex_group method - see this method's docs for more info.authentication_banner method to server::Handler (#415) (Eric Rodrigues Pires) #415 - you can now send a dynamic SSH banner to clients.MSRV for the russh crate is now 1.75
des dependency (#424) (Eric Seppanen) #424Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
One column per quarter.