نسخههای متأثر
بازهها نیاز به بررسی دارند.
- نسخههای متأثر
- >=0.0.0-0 <0.29.0
- نسخهٔ اصلاحشده
- 0.29.0
- نسخههای متأثر
- < 0.29.0
- نسخهٔ اصلاحشده
- 0.29.0
شرح آسیبپذیری
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
The NATS Rust client tries to establish a new connection
The connection is intercepted by a MitM proxy
The proxy makes a separate connection to the NATS server
The NATS server replies with an
INFOmessageThe proxy reads the
INFO, alters thehostJSON field and passes the tamperedINFOback to the clientThe 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
hostwas set to the common name of said certificaterustlsaccepts the certificate, having verified that the common name matches the attacker-controlled value it was givenThe client has been fooled by the MitM proxy into accepting the attacker-controlled certificate
پیوندها
- https://crates.io/crates/async-nats
- https://github.com/advisories/GHSA-f5v5-ccqc-6w36
- https://github.com/nats-io/nats.rs
- https://github.com/nats-io/nats.rs/commit/817a7b942c462fa9d9938dcb62124173634132fb#diff-767d442397fcaaf2f83e8f924d4a70317a2ce4703a49964d6007707949cfa5f5L303-R304
- https://rustsec.org/advisories/RUSTSEC-2023-0027.html

