Know every vulnerabilitybefore it knows you.
DevGuard continuously monitors your dependencies and alerts you when CVEs like this one affect your stack — with real-time threat intelligence built for developers.
RUSTSEC-2023-0029
No affected components available
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
INFOmessage - The proxy reads the
INFO, alters thehostJSON field and passes the tamperedINFOback to the client - 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
hostwas set to the common name of said certificate rustlsaccepts the certificate, having verified that the common name matches the attacker-controlled value it was given- The client has been fooled by the MitM proxy into accepting the attacker-controlled certificate
Measures severity based on intrinsic characteristics of the vulnerability, independent of environment.
No exploitation activity has been observed at this time. Continue routine monitoring.
Probability that this vulnerability will be exploited in the wild within the next 30 days.
We did not find any exploit available. Neither in GitHub repositories nor in the Exploit-Database.
Continuously monitor your dependencies and get alerted when vulnerabilities like this one affect your stack.
Checkout DevGuard