This project might be open to known security vulnerabilities, which can be prevented by tightening the version range of affected dependencies. Find detailed information at the bottom.

Crate mongodb

Dependencies

(55 total, 13 outdated, 5 possibly insecure)

CrateRequiredLatestStatus
 async-trait^0.1.420.1.87up to date
 base64^0.13.00.22.1out of date
 bitflags^1.1.02.9.0out of date
 bson^2.13.02.14.0up to date
 chrono ⚠️^0.4.70.4.40maybe insecure
 derive-where^1.2.71.2.7up to date
 derive_more^0.99.172.0.1out of date
 flate2^1.01.1.0up to date
 futures-core^0.3.140.3.31up to date
 futures-executor^0.3.140.3.31up to date
 futures-io^0.3.210.3.31up to date
 futures-util^0.3.140.3.31up to date
 hex^0.4.00.4.3up to date
 hickory-proto ⚠️^0.24.20.24.4maybe insecure
 hickory-resolver^0.24.20.24.4up to date
 hmac^0.12.10.12.1up to date
 log^0.4.170.4.26up to date
 macro_magic^0.5.10.6.0out of date
 md-5^0.10.10.10.6up to date
 mongocrypt^0.2.10.2.1up to date
 mongodb-internal-macros^3.2.23.2.2up to date
 num_cpus^1.13.11.16.0up to date
 once_cell^1.19.01.21.1up to date
 openssl ⚠️^0.10.380.10.71maybe insecure
 openssl-probe^0.1.50.1.6up to date
 pbkdf2^0.11.00.12.2out of date
 pem^3.0.43.0.5up to date
 percent-encoding^2.0.02.3.1up to date
 pkcs8^0.10.20.10.2up to date
 rand^0.8.30.9.0out of date
 rayon^1.5.31.10.0up to date
 reqwest^0.12.120.12.14up to date
 rustc_version_runtime^0.3.00.3.0up to date
 rustls ⚠️^0.21.60.23.23out of date
 rustls-pemfile^1.0.12.2.0out of date
 serde^1.0.1251.0.219up to date
 serde_bytes^0.11.50.11.17up to date
 serde_with^3.8.13.12.0up to date
 sha-1^0.10.00.10.1up to date
 sha2^0.10.20.10.8up to date
 snap^1.0.51.1.1up to date
 socket2^0.5.50.5.8up to date
 stringprep^0.1.20.1.5up to date
 strsim^0.11.10.11.1up to date
 take_mut^0.2.20.2.2up to date
 thiserror^1.0.242.0.12out of date
 tokio ⚠️^1.17.01.44.1maybe insecure
 tokio-openssl^0.6.30.6.5up to date
 tokio-rustls^0.24.10.26.2out of date
 tokio-util^0.7.00.7.14up to date
 tracing^0.1.360.1.41up to date
 typed-builder^0.10.00.20.1out of date
 uuid^1.1.21.15.1up to date
 webpki-roots^0.25.20.26.8out of date
 zstd^0.11.20.13.3out of date

Dev dependencies

(21 total, 2 outdated, 1 possibly insecure)

CrateRequiredLatestStatus
 anyhow^1.01.0.97up to date
 approx^0.5.10.5.1up to date
 backtrace^0.3.680.3.74up to date
 ctrlc^3.2.23.4.5up to date
 function_name^0.2.10.3.0out of date
 futures^0.30.3.31up to date
 hex^0.40.4.3up to date
 home^0.50.5.11up to date
 lambda_runtime^0.6.00.13.0out of date
 pkcs8^0.10.20.10.2up to date
 pretty_assertions^1.3.01.4.1up to date
 regex^1.6.01.11.1up to date
 reqwest^0.12.20.12.14up to date
 semver^1.0.01.0.26up to date
 serde>=0.0.01.0.219up to date
 serde-hex^0.1.00.1.0up to date
 serde_json^1.0.641.0.140up to date
 serde_path_to_error^0.10.1.17up to date
 time^0.3.90.3.39up to date
 tokio ⚠️>=0.0.01.44.1maybe insecure
 tracing-subscriber^0.3.160.3.19up to date

Security Vulnerabilities

chrono: Potential segfault in `localtime_r` invocations

RUSTSEC-2020-0159

Impact

Unix-like operating systems may segfault due to dereferencing a dangling pointer in specific circumstances. This requires an environment variable to be set in a different thread than the affected functions. This may occur without the user's knowledge, notably in a third-party library.

Workarounds

No workarounds are known.

References

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);

rustls: `rustls::ConnectionCommon::complete_io` could fall into an infinite loop based on network input

RUSTSEC-2024-0336

If a close_notify alert is received during a handshake, complete_io does not terminate.

Callers which do not call complete_io are not affected.

rustls-tokio and rustls-ffi do not call complete_io and are not affected.

rustls::Stream and rustls::StreamOwned types use complete_io and are affected.

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)
});

hickory-proto: Hickory DNS failure to verify self-signed RRSIG for DNSKEYs

RUSTSEC-2025-0006

Summary

The DNSSEC validation routines treat entire RRsets of DNSKEY records as trusted once they have established trust in only one of the DNSKEYs. As a result, if a zone includes a DNSKEY with a public key that matches a configured trust anchor, all keys in that zone will be trusted to authenticate other records in the zone. There is a second variant of this vulnerability involving DS records, where an authenticated DS record covering one DNSKEY leads to trust in signatures made by an unrelated DNSKEY in the same zone.

Details

verify_dnskey_rrset() will return Ok(true) if any record's public key matches a trust anchor. This results in verify_rrset() returning a Secure proof. This ultimately results in successfully verifying a response containing DNSKEY records. verify_default_rrset() looks up DNSKEY records by calling handle.lookup(), which takes the above code path. There's a comment following this that says "DNSKEYs were already validated by the inner query in the above lookup", but this is not the case. To fully verify the whole RRset of DNSKEYs, it would be necessary to check self-signatures by the trusted key over the other keys. Later in verify_default_rrset(), verify_rrset_with_dnskey() is called multiple times with different keys and signatures, and if any call succeeds, then its Proof is returned.

Similarly, verify_dnskey_rrset() returns Ok(false) if any DNSKEY record is covered by a DS record. A comment says "If all the keys are valid, then we are secure", but this is only checking that one key is authenticated by a DS in the parent zone's delegation point. This time, after control flow returns to verify_rrset(), it will call verify_default_rrset(). The special handling for DNSKEYs in verify_default_rrset() will then call verify_rrset_with_dnskey() using each KSK DNSKEY record, and if one call succeeds, return its Proof. If there are multiple KSK DNSKEYs in the RRset, then this leads to another authentication break. We need to either pass the authenticated DNSKEYs from the DS covering check to the RRSIG validation, or we need to perform this RRSIG validation of the DNSKEY RRset inside verify_dnskey_rrset() and cut verify_default_rrset() out of DNSKEY RRset validation entirely.