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 nats

Dependencies

(28 total, 10 outdated, 4 possibly insecure)

CrateRequiredLatestStatus
 base64^0.13.00.22.1out of date
 base64-url^1.4.103.0.2out of date
 blocking^1.1.01.6.2up to date
 crossbeam-channel^0.5.10.5.15up to date
 fastrand^1.5.02.3.0out of date
 itoa^1.0.11.0.17up to date
 json^0.12.40.12.4up to date
 lazy_static^1.4.01.5.0up to date
 libc^0.2.980.2.182up to date
 log^0.4.140.4.29up to date
 memchr^2.4.02.8.0up to date
 nkeys^0.3.20.4.5out of date
 nuid^0.3.10.6.0out of date
 once_cell^1.8.01.21.3up to date
 parking_lot^0.12.00.12.5up to date
 regex^1.5.51.12.3up to date
 ring ⚠️^0.160.17.14out of date
 rustls ⚠️^0.210.23.37out of date
 rustls-native-certs^0.60.8.3out of date
 rustls-pemfile^1.0.22.2.0out of date
 serde^1.0.1261.0.228up to date
 serde_json^1.0.641.0.149up to date
 serde_nanos^0.1.10.1.4up to date
 serde_repr^0.1.70.1.20up to date
 time ⚠️^0.3.60.3.47maybe insecure
 url^2.2.22.5.8up to date
 rustls-webpki ⚠️^0.100.00.103.9out of date
 winapi^0.3.90.3.9up to date

Dev dependencies

(8 total, 5 outdated, 1 possibly insecure)

CrateRequiredLatestStatus
 criterion^0.3.50.8.2out of date
 env_logger^0.9.00.11.9out of date
 historian^4.0.44.0.4up to date
 nats ⚠️^0.16.00.25.0out of date
 quicli^0.4.00.4.0up to date
 rand^0.8.40.10.0out of date
 smol^1.2.52.0.2out of date
 structopt^0.3.210.3.26up to date

Security Vulnerabilities

nats: TLS certificate common name validation bypass

RUSTSEC-2023-0029

The NATS official Rust clients are vulnerable to MitM when using TLS.

The common name of the server's TLS certificate is validated against the hostname provided by the server's plaintext INFO message during the initial connection setup phase. A MitM proxy can tamper with the host field's value by substituting it with the common name of a valid certificate it controls, fooling the client into accepting it.

Reproduction steps

  1. The NATS Rust client tries to establish a new connection
  2. The connection is intercepted by a MitM proxy
  3. The proxy makes a separate connection to the NATS server
  4. The NATS server replies with an INFO message
  5. The proxy reads the INFO, alters the host JSON field and passes the tampered INFO back to the client
  6. The proxy upgrades the client connection to TLS, presenting a certificate issued by a certificate authority present in the client's keychain. In the previous step the host was set to the common name of said certificate
  7. rustls accepts the certificate, having verified that the common name matches the attacker-controlled value it was given
  8. The client has been fooled by the MitM proxy into accepting the attacker-controlled certificate

rustls-webpki: rustls-webpki: CPU denial of service in certificate path building

RUSTSEC-2023-0053

When this crate is given a pathological certificate chain to validate, it will spend CPU time exponential with the number of candidate certificates at each step of path building.

Both TLS clients and TLS servers that accept client certificate are affected.

We now give each path building operation a budget of 100 signature verifications.

The original webpki crate is also affected.

This was previously reported in the original crate https://github.com/briansmith/webpki/issues/69 and re-reported to us recently by Luke Malinowski.

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.

ring: Some AES functions may panic when overflow checking is enabled.

RUSTSEC-2025-0009

ring::aead::quic::HeaderProtectionKey::new_mask() may panic when overflow checking is enabled. In the QUIC protocol, an attacker can induce this panic by sending a specially-crafted packet. Even unintentionally it is likely to occur in 1 out of every 2**32 packets sent and/or received.

On 64-bit targets operations using ring::aead::{AES_128_GCM, AES_256_GCM} may panic when overflow checking is enabled, when encrypting/decrypting approximately 68,719,476,700 bytes (about 64 gigabytes) of data in a single chunk. Protocols like TLS and SSH are not affected by this because those protocols break large amounts of data into small chunks. Similarly, most applications will not attempt to encrypt/decrypt 64GB of data in one chunk.

Overflow checking is not enabled in release mode by default, but RUSTFLAGS="-C overflow-checks" or overflow-checks = true in the Cargo.toml profile can override this. Overflow checking is usually enabled by default in debug mode.

time: Denial of Service via Stack Exhaustion

RUSTSEC-2026-0009

Impact

When user-provided input is provided to any type that parses with the RFC 2822 format, a denial of service attack via stack exhaustion is possible. The attack relies on formally deprecated and rarely-used features that are part of the RFC 2822 format used in a malicious manner. Ordinary, non-malicious input will never encounter this scenario.

Patches

A limit to the depth of recursion was added in v0.3.47. From this version, an error will be returned rather than exhausting the stack.

Workarounds

Limiting the length of user input is the simplest way to avoid stack exhaustion, as the amount of the stack consumed would be at most a factor of the length of the input.