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

(29 total, 6 outdated, 1 possibly insecure)

CrateRequiredLatestStatus
 base64^0.13.00.22.1out of date
 base64-url^1.4.103.0.0out of date
 blocking^1.1.01.6.1up to date
 crossbeam-channel^0.5.10.5.13up to date
 fastrand^1.5.02.2.0out of date
 itoa^1.0.11.0.11up to date
 json^0.12.40.12.4up to date
 lazy_static^1.4.01.5.0up to date
 libc^0.2.980.2.162up to date
 log^0.4.140.4.22up to date
 memchr^2.4.02.7.4up to date
 nkeys^0.4.10.4.4up to date
 nuid^0.3.10.5.0out of date
 once_cell^1.8.01.20.2up to date
 parking_lot^0.12.00.12.3up to date
 portable-atomic^11.9.0up to date
 regex^1.5.51.11.1up to date
 ring^0.170.17.8up to date
 rustls ⚠️^0.220.23.16out of date
 rustls-native-certs^0.70.8.0out of date
 rustls-pemfile^22.2.0up to date
 serde^1.0.1261.0.215up to date
 serde_json^1.0.641.0.132up to date
 serde_nanos^0.1.10.1.4up to date
 serde_repr^0.1.70.1.19up to date
 time^0.3.60.3.36up to date
 url^2.2.22.5.3up to date
 rustls-webpki^0.1020.102.8up to date
 winapi^0.3.90.3.9up to date

Dev dependencies

(8 total, 4 outdated, 1 possibly insecure)

CrateRequiredLatestStatus
 criterion^0.3.50.5.1out of date
 env_logger^0.9.00.11.5out 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.8.5up to 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: `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.