{"answers":{"affected":"3 open source packages ship an affected version, including nats.","exploited":"There is no known exploitation of GHSA-wvc4-j7g5-4f79 in the wild and no public exploit code.","fix":"Upgrade nats to 0.24.1 or later.","what":"GHSA-wvc4-j7g5-4f79 is a vulnerability in nats, published on 24 Mar 2023. An attacker can exploit it over the internet without logging in, with no action from the victim."},"fix_prompt":"Check this codebase for GHSA-wvc4-j7g5-4f79 and fix it if it is affected.\n\nWhat it is: GHSA-wvc4-j7g5-4f79 is a vulnerability in nats, published on 24 Mar 2023. An attacker can exploit it over the internet without logging in, with no action from the victim.\nExploitation: There is no known exploitation of GHSA-wvc4-j7g5-4f79 in the wild and no public exploit code.\n\nAffected packages and fixed versions:\n- nats (crates.io): affected from 0.9.0; fixed in 0.24.1\n- nats (crates.io): affected from 0.9.0; fixed in 0.24.1\n- nats (crates.io): affected from 0.9.0; fixed in 0.24.1\n\nTask:\n1. Search the dependency manifests and lockfiles (for example package.json, package-lock.json, requirements.txt, poetry.lock, uv.lock, pom.xml, build.gradle, go.mod, Cargo.lock, Gemfile.lock) and any Dockerfiles for the affected packages, including transitive dependencies.\n2. If an affected version is in use, upgrade it to the fixed version for its release line with the project's package manager, so the lockfile is regenerated. Prefer the smallest upgrade that fixes it.\n3. If there is no fix, or the upgrade would break the build, do not guess: explain the risk and the safest workaround instead.\n4. Run the tests and summarise what changed and why.\n5. If nothing in the project is affected, say so and change nothing.\n\nReference: https://insights.sbomify.com/GHSA-wvc4-j7g5-4f79/ (Markdown: https://insights.sbomify.com/GHSA-wvc4-j7g5-4f79/index.md)","id":"GHSA-wvc4-j7g5-4f79","markdown":"https://insights.sbomify.com/GHSA-wvc4-j7g5-4f79/index.md","name":"GHSA-wvc4-j7g5-4f79","record":{"aliases":["RUSTSEC-2023-0029"],"analysis":{"component_type":"library","fix_type":"upgrade","impacts":["security_bypass","data_read"],"network_reachable":"yes","non_default_config":false,"product_category":"NATS Rust client","requires_auth":"none","summary":"A Man-in-the-Middle attacker can bypass TLS certificate validation in the NATS Rust client by tampering with the server's INFO message, allowing interception of traffic.","user_interaction":"not_required","vuln_class":"security_feature_bypass"},"analysis_generated_by":"qwen3.8-flash-next","assigner":null,"cpe":[],"cvss":{"score":null,"severity":null,"source":null,"vector":null,"version":null},"cwes":[],"description":"The NATS official Rust clients are vulnerable to MitM when using TLS.\n\nA fix for the `nats` crate hasn't been released yet. Since the `nats` crate is going to be deprecated anyway, consider switching to `async-nats` `\u003e= 0.29` which already fixed this vulnerability.\n\nThe common name of the server's TLS certificate is validated against the `host`name 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.\n\n## Reproduction steps\n\n1. The NATS Rust client tries to establish a new connection\n2. The connection is intercepted by a MitM proxy\n3. The proxy makes a separate connection to the NATS server\n4. The NATS server replies with an `INFO` message\n5. The proxy reads the `INFO`, alters the `host` JSON field and passes the tampered `INFO` back to the client\n6. 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\n7. `rustls` accepts the certificate, having verified that the common name matches the attacker-controlled value it was given\n9. The client has been fooled by the MitM proxy into accepting the attacker-controlled certificate","ecosystems":["crates.io"],"exploits":{"exploitdb":null,"first_seen":null,"github_poc":null,"max_poc_stars":null,"metasploit":null,"nuclei":null,"refs":[],"tier":null},"has_fix":true,"headline":"NATS TLS certificate common name validation bypass","id":"GHSA-wvc4-j7g5-4f79","indexable":true,"kev":null,"kind":"advisory","links":{"ecosystem":"crates.io","product":null,"products":[],"type":"security_feature_bypass","year":"2023"},"n_packages":3,"n_references":null,"packages":[{"ecosystem":"crates.io","fixed":["0.24.1"],"introduced":["0.9.0"],"last_affected":[],"package":"nats","purl":null,"source":"GHSA-wvc4-j7g5-4f79"},{"ecosystem":"crates.io","fixed":["0.24.1"],"introduced":["0.9.0"],"last_affected":[],"package":"nats","purl":"pkg:cargo/nats","source":"GHSA-wvc4-j7g5-4f79"},{"ecosystem":"crates.io","fixed":["0.24.1"],"introduced":["0.9.0"],"last_affected":[],"package":"nats","purl":"pkg:cargo/nats","source":"RUSTSEC-2023-0029"}],"products":null,"published":"2023-03-24","related":[],"sources":[{"class":"attribution","licence":"CC BY 4.0","name":"GitHub Advisory Database","prefix":"GHSA"},{"class":"open","licence":"CC0 1.0","name":"RustSec","prefix":"RUSTSEC"}],"ssvc":{"automatable":null,"exploitation":null,"technical_impact":null},"state":null,"updated":null,"vendors":null},"summary":"A Man-in-the-Middle attacker can bypass TLS certificate validation in the NATS Rust client by tampering with the server's INFO message, allowing interception of traffic.","url":"https://insights.sbomify.com/GHSA-wvc4-j7g5-4f79/"}