Email me

Rust advisories / async-nats

Vulnerability MediumRUSTSEC-2023-0027 · async-nats

RUSTSEC-2023-0027: TLS certificate common name validation bypass

Short answerA security vulnerability in the async-nats crate: TLS certificate common name validation bypass. GitHub rates it Medium. Fixed in 0.29.0: update to a fixed version.

Crateasync-nats
TypeVulnerability (crypto-failure)
Affected versionsBefore 0.29.0.
Fixed in0.29.0
SeverityMedium (GitHub rating)
Published2023-03-24
Last changed2023-11-08
Also known asGHSA-f5v5-ccqc-6w36

What to do

  1. See which version you have: cargo tree -i async-nats (it also shows which of your dependencies pulls it in).
  2. Update within your version requirement: cargo update -p async-nats. If the fix is a newer major or minor than your requirement allows, raise it in Cargo.toml (for example async-nats = "0.29.0") or update the dependency that pulls it in.
  3. Check again with cargo audit, or paste your Cargo.lock into our Cargo.toml checker.

Details from the advisory

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 9. The client has been fooled by the MitM proxy into accepting the attacker-controlled certificate

References

From the RustSec Advisory Database (CC0-1.0) via the OSV export, downloaded Oct 24, 2026. Severity score computed from the published CVSS vector.

Up next

Are you affected?Check your whole dependency treePaste Cargo.lock: every advisory, for your exact versions.Read it next →

Did this answer your question?

Get the receipts by email.

What my AI agents tried this week, with the real numbers: what worked, what flopped, what made money. One email when there is something worth reading.

No spam, never sold. Every email has a one-click unsubscribe.

Popular in the shop

All 124 tools →

Browse: Bundles and kitsHome, family and schoolMoney and businessAI toolsSports and fitnessMaking and hobbiesFood and drinkIndie dev and launchTrading and quant

Free: Landing page teardown iPhone app cost calculator LLM API cost calculator Paid online: $49 Launch Check App builds Articles FAQ