This project contains known security vulnerabilities. Find detailed information at the bottom.

Crate russh

Dependencies

(59 total, 41 outdated, 1 insecure, 4 possibly insecure)

CrateRequiredLatestStatus
 aes^0.80.9.3out of date
 aes-gcm ⚠️^0.100.11.1out of date
 async-trait^0.1.500.1.92up to date
 bitflags^2.02.13.2up to date
 block-padding^0.30.4.2out of date
 byteorder^1.41.5.0up to date
 bytes ⚠️^1.71.12.1maybe insecure
 cbc^0.10.2.1out of date
 chacha20^0.90.10.2out of date
 ctr^0.90.10.1out of date
 curve25519-dalek^4.1.35.0.0out of date
 data-encoding^2.32.11.1up to date
 delegate^0.130.13.5up to date
 der^0.70.8.2out of date
 des^0.8.10.9.0out of date
 digest^0.100.11.3out of date
 ecdsa^0.160.17.0out of date
 ed25519-dalek^2.03.0.0out of date
 elliptic-curve^0.130.14.1out of date
 enum_dispatch^0.3.130.3.13up to date
 flate2^1.0.151.1.10up to date
 futures^0.30.3.34up to date
 generic-array^0.141.4.5out of date
 getrandom^0.2.150.4.3out of date
 hex-literal^0.41.1.0out of date
 hmac^0.120.13.0out of date
 home^0.50.5.12up to date
 inout^0.10.2.2out of date
 log^0.4.110.4.34up to date
 md5^0.70.8.1out of date
 num-bigint^0.4.20.5.1out of date
 once_cell^1.131.21.4up to date
 p256^0.130.14.0out of date
 p384^0.130.14.0out of date
 p521^0.130.14.0out of date
 pageant^0.0.30.2.3out of date
 pbkdf2^0.120.13.0out of date
 pkcs1^0.70.7.5up to date
 pkcs5^0.70.8.1out of date
 pkcs8^0.100.11.0out of date
 poly1305^0.80.9.1out of date
 rand^0.80.10.2out of date
 rand_core^0.6.40.10.1out of date
 rsa ⚠️^0.90.9.10insecure
 russh-cryptovec ⚠️^0.51.00.62.0out of date
 russh-util^0.51.00.52.0out of date
 sec1^0.70.8.1out of date
 sha1^0.10.50.11.0out of date
 sha2^0.10.60.11.0out of date
 signature^2.23.0.0out of date
 spki^0.70.8.0out of date
 ssh-encoding^0.20.3.0out of date
 internal-russh-forked-ssh-key=0.6.100.6.18+upstream-0.6.7out of date
 subtle^2.42.6.1up to date
 thiserror^1.0.302.0.20out of date
 tokio ⚠️^1.17.01.53.1maybe insecure
 typenum^1.171.20.1up to date
 yasna^0.5.00.6.0out of date
 zeroize^1.71.9.0up to date

Dev dependencies

(12 total, 6 outdated, 1 possibly insecure)

CrateRequiredLatestStatus
 anyhow^1.0.41.0.104up to date
 clap^3.2.34.6.7out of date
 env_logger^0.60.11.11out of date
 rand^0.8.50.10.2out of date
 ratatui^0.29.00.30.2out of date
 russh-sftp^2.0.53.0.0out of date
 shell-escape^0.10.1.5up to date
 tempfile^3.14.03.27.0up to date
 termion^24.0.6out of date
 tokio ⚠️^1.17.01.53.1maybe insecure
 tokio-fd^0.30.3.0up to date
 tokio-stream^0.1.30.1.19up to date

Security Vulnerabilities

tokio: reject_remote_clients Configuration corruption

RUSTSEC-2023-0001

On Windows, configuring a named pipe server with pipe_mode will force ServerOptions::reject_remote_clients as false.

This drops any intended explicit configuration for the reject_remote_clients that may have been set as true previously.

The default setting of reject_remote_clients is normally true meaning the default is also overridden as false.

Workarounds

Ensure that pipe_mode is set first after initializing a ServerOptions. For example:

let mut opts = ServerOptions::new();
opts.pipe_mode(PipeMode::Message);
opts.reject_remote_clients(true);

rsa: Marvin Attack: potential key recovery through timing sidechannels

RUSTSEC-2023-0071

Impact

Due to a non-constant-time implementation, information about the private key is leaked through timing information which is observable over the network. An attacker may be able to use that information to recover the key.

Patches

No patch is yet available, however work is underway to migrate to a fully constant-time implementation.

Workarounds

The only currently available workaround is to avoid using the rsa crate in settings where attackers are able to observe timing information, e.g. local use on a non-compromised computer is fine.

References

This vulnerability was discovered as part of the "Marvin Attack", which revealed several implementations of RSA including OpenSSL had not properly mitigated timing sidechannel attacks.

aes-gcm: Plaintext exposed in decrypt_in_place_detached even on tag verification failure

RUSTSEC-2023-0096

Summary

In the AES GCM implementation of decrypt_in_place_detached, the decrypted ciphertext (i.e. the correct plaintext) is exposed even if tag verification fails.

Impact

If a program using the aes-gcm crate's decrypt_in_place* APIs accesses the buffer after decryption failure, it will contain a decryption of an unauthenticated input. Depending on the specific nature of the program this may enable Chosen Ciphertext Attacks (CCAs) which can cause a catastrophic breakage of the cipher including full plaintext recovery.

Details

As seen in the implementation of decrypt_in_place_detached for AES GCM, if the tag verification fails, an error is returned. Because the decryption of the ciphertext is done in place, the plaintext contents are now exposed via buffer.

This should ideally not be the case - as noted in page 17 of NIST's publication Recommendation for Block Cipher Modes of Operation: Galois/Counter Mode (GCM) and GMAC:

In Step 8, the result of Step 7 is compared with the authentication tag that was received as an input: if they are identical, then the plaintext is returned; otherwise,FAIL is returned.

This is seems correctly addressed in the AES GCM SIV implementation, where the decrypted buffer is encrypted again before the error is returned - this fix is straightforward to implement in AES GCM. To ensure that these types of cases are covered during testing, it would be valuable to add test cases like 23, 24 etc from project wycheproof to ensure that when a bad tag is used, there is an error on decryption and that the plaintext value is not exposed.

PoC

To reproduce this issue, I'm using test case 23 from project wycheproof.

    let key = GenericArray::from_slice(&hex!("000102030405060708090a0b0c0d0e0f"));
    let nonce = GenericArray::from_slice(&hex!("505152535455565758595a5b"));
    let tag = GenericArray::from_slice(&hex!("d9847dbc326a06e988c77ad3863e6083")); // bad tag
    let mut ct = hex!("eb156d081ed6b6b55f4612f021d87b39");
    let msg = hex!("202122232425262728292a2b2c2d2e2f");
    let aad = hex!("");
    let cipher = Aes128Gcm::new(&key);
    let _plaintext = cipher.decrypt_in_place_detached(&nonce, &aad, &mut ct, &tag);
    assert_eq!(ct, msg);

bytes: Integer overflow in `BytesMut::reserve`

RUSTSEC-2026-0007

In the unique reclaim path of BytesMut::reserve, the condition

if v_capacity >= new_cap + offset

uses an unchecked addition. When new_cap + offset overflows usize in release builds, this condition may incorrectly pass, causing self.cap to be set to a value that exceeds the actual allocated capacity. Subsequent APIs such as spare_capacity_mut() then trust this corrupted cap value and may create out-of-bounds slices, leading to UB.

This behavior is observable in release builds (integer overflow wraps), whereas debug builds panic due to overflow checks.

PoC

use bytes::*;

fn main() {
    let mut a = BytesMut::from(&b"hello world"[..]);
    let mut b = a.split_off(5);

    // Ensure b becomes the unique owner of the backing storage
    drop(a);

    // Trigger overflow in new_cap + offset inside reserve
    b.reserve(usize::MAX - 6);

    // This call relies on the corrupted cap and may cause UB & HBO
    b.put_u8(b'h');
}

Workarounds

Users of BytesMut::reserve are only affected if integer overflow checks are configured to wrap. When integer overflow is configured to panic, this issue does not apply.

russh-cryptovec: Unchecked `CryptoVec` allocation and growth handling

RUSTSEC-2026-0153

CryptoVec used unchecked capacity growth, unchecked length arithmetic, and unsafe allocation and locking paths. In affected russh releases, attacker-controlled input could reach these code paths through buffer resizing operations.

Two affected reachability paths were identified:

  • Current russh releases (0.60.x before the fix) Local SSH agent peers could provide attacker-controlled frame lengths that were used to resize internal buffers before validation in:

    • AgentClient::read_response
    • agent::server::Connection::run
  • Historical russh releases before 0.58.0 CryptoVec was also used for non-secret transport and compression buffers, allowing remote SSH traffic to trigger CryptoVec growth through:

    • transport packet reads
    • zlib decompression output

These remote paths were removed in 0.58.0 when CryptoVec stopped being used for those buffers.

Under constrained memory conditions, historical russh versions prior to 0.58.0 can abort the process when remote compressed payload expansion causes allocation failure in CryptoVec. This was reproduced through the compression path and resulted in process termination in the Unix allocation/locking implementation after null pointer allocation failure.

For current affected releases, oversized local SSH agent frame lengths could trigger untrusted-input-driven buffer growth prior to validation.

No practical remote code execution, integrity or confidentiality impact has been demonstrated.

Fixed by validating CryptoVec growth operations and rejecting oversized SSH agent frame lengths before buffer allocation.