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

Crate tor-llcrypto

Dependencies

(29 total, 7 outdated, 1 insecure, 2 possibly insecure)

CrateRequiredLatestStatus
 aes^0.80.8.4up to date
 base64ct^1.5.11.7.3up to date
 cipher^0.4.30.4.4up to date
 ctr^0.90.9.2up to date
 curve25519-dalek ⚠️^4.14.1.3maybe insecure
 der-parser^910.0.0out of date
 derive-deftly^0.14.21.0.1out of date
 derive_more^1.0.02.0.1out of date
 digest^0.10.00.10.7up to date
 ed25519-dalek^2.12.1.1up to date
 educe^0.4.60.6.0out of date
 getrandom^0.2.30.3.2out of date
 hex^0.40.4.3up to date
 openssl ⚠️^0.10.480.10.71maybe insecure
 rand_core^0.6.20.9.3out of date
 rsa ⚠️^0.9.00.9.8insecure
 safelog^0.4.20.4.4up to date
 serde^1.0.1031.0.219up to date
 sha1^0.10.00.10.6up to date
 sha2^0.10.00.10.8up to date
 sha3^0.10.60.10.8up to date
 signature^22.2.0up to date
 subtle^22.6.1up to date
 thiserror^22.0.12up to date
 tor-memquota^0.25.00.28.0out of date
 typenum^1.15.01.18.0up to date
 visibility^0.1.00.1.1up to date
 x25519-dalek^2.0.02.0.1up to date
 zeroize^11.8.1up to date

Dev dependencies

(5 total, 3 outdated)

CrateRequiredLatestStatus
 cipher^0.4.10.4.4up to date
 hex-literal^0.41.0.0out of date
 rand^0.80.9.0out of date
 serde_test^1.0.1241.0.177up to date
 tor-basic-utils^0.25.00.28.0out of date

Security Vulnerabilities

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.

curve25519-dalek: Timing variability in `curve25519-dalek`'s `Scalar29::sub`/`Scalar52::sub`

RUSTSEC-2024-0344

Timing variability of any kind is problematic when working with potentially secret values such as elliptic curve scalars, and such issues can potentially leak private keys and other secrets. Such a problem was recently discovered in curve25519-dalek.

The Scalar29::sub (32-bit) and Scalar52::sub (64-bit) functions contained usage of a mask value inside a loop where LLVM saw an opportunity to insert a branch instruction (jns on x86) to conditionally bypass this code section when the mask value is set to zero as can be seen in godbolt:

A similar problem was recently discovered in the Kyber reference implementation:

https://groups.google.com/a/list.nist.gov/g/pqc-forum/c/hqbtIGFKIpU/m/cnE3pbueBgAJ

As discussed on that thread, one portable solution, which is also used in this PR, is to introduce a volatile read as an optimization barrier, which prevents the compiler from optimizing it away.

The fix can be validated in godbolt here:

The problem was discovered and the solution independently verified by Alexander Wagner [email protected] and Lea Themint [email protected] using their DATA tool:

https://github.com/Fraunhofer-AISEC/DATA

openssl: ssl::select_next_proto use after free

RUSTSEC-2025-0004

In openssl versions before 0.10.70, ssl::select_next_proto can return a slice pointing into the server argument's buffer but with a lifetime bound to the client argument. In situations where the server buffer's lifetime is shorter than the client buffer's, this can cause a use after free. This could cause the server to crash or to return arbitrary memory contents to the client.

openssl 0.10.70 fixes the signature of ssl::select_next_proto to properly constrain the output buffer's lifetime to that of both input buffers.

In standard usage of ssl::select_next_proto in the callback passed to SslContextBuilder::set_alpn_select_callback, code is only affected if the server buffer is constructed within the callback. For example:

Not vulnerable - the server buffer has a 'static lifetime:

builder.set_alpn_select_callback(|_, client_protos| {
    ssl::select_next_proto(b"\x02h2", client_protos).ok_or_else(AlpnError::NOACK)
});

Not vulnerable - the server buffer outlives the handshake:

let server_protos = b"\x02h2".to_vec();
builder.set_alpn_select_callback(|_, client_protos| {
    ssl::select_next_proto(&server_protos, client_protos).ok_or_else(AlpnError::NOACK)
});

Vulnerable - the server buffer is freed when the callback returns:

builder.set_alpn_select_callback(|_, client_protos| {
    let server_protos = b"\x02h2".to_vec();
    ssl::select_next_proto(&server_protos, client_protos).ok_or_else(AlpnError::NOACK)
});