{"answers":{"affected":"2 open source packages ship an affected version, including nats.","exploited":"There is no known exploitation of GHSA-prmc-5v5w-c465 in the wild and no public exploit code.","fix":"Upgrade nats to 2.0.0-209 or later.","what":"GHSA-prmc-5v5w-c465 is a vulnerability in nats, published on 6 Apr 2021. An attacker can exploit it over the internet without logging in, with no action from the victim."},"fix_prompt":"Check this codebase for GHSA-prmc-5v5w-c465 and fix it if it is affected.\n\nWhat it is: GHSA-prmc-5v5w-c465 is a vulnerability in nats, published on 6 Apr 2021. 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-prmc-5v5w-c465 in the wild and no public exploit code.\n\nAffected packages and fixed versions:\n- nats (npm): affected from 2.0.0-201; fixed in 2.0.0-209\n- nats (npm): affected from 2.0.0-201; fixed in 2.0.0-209\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-prmc-5v5w-c465/ (Markdown: https://insights.sbomify.com/GHSA-prmc-5v5w-c465/index.md)","id":"GHSA-prmc-5v5w-c465","markdown":"https://insights.sbomify.com/GHSA-prmc-5v5w-c465/index.md","name":"GHSA-prmc-5v5w-c465","record":{"aliases":[],"analysis":{"component_type":"library","fix_type":"upgrade","impacts":["data_read","security_bypass"],"network_reachable":"yes","non_default_config":true,"product_category":"NATS Node.js client","requires_auth":"none","summary":"NATS Node.js client leaks TLS private keys to the server during connection, exposing credentials if mutual TLS is used with untrusted servers.","user_interaction":"not_required","vuln_class":"information_disclosure"},"analysis_generated_by":"qwen3.8-flash-next","assigner":null,"cpe":[],"cvss":{"score":null,"severity":null,"source":null,"vector":null,"version":null},"cwes":[],"description":"Nats is a Node.js client for the NATS messaging system.\n\n## Problem Description\n\n_Preview versions_ of two NPM packages and one Deno package from the NATS project contain an information disclosure flaw, leaking options to the NATS server; for one package, this includes TLS private credentials.\n\nThe _connection_ configuration options in these JavaScript-based implementations were fully serialized and sent to the server in the client's `CONNECT` message, immediately after TLS establishment.\n\nThe nats.js client supports Mutual TLS and the credentials for the TLS client key are included in the connection configuration options; disclosure of the client's TLS private key to the server has been observed.\n\nMost authentication mechanisms are handled after connection, instead of as part of connection, so other authentication mechanisms are unaffected.\nFor clarity: NATS account NKey authentication **is NOT affected**.\n\nNeither the nats.ws nor the nats.deno clients support Mutual TLS: the affected versions listed below are those where the logic flaw is\npresent.  We are including the nats.ws and nats.deno versions out of an abundance of caution, as library maintainers, but rate as minimal the likelihood of applications leaking sensitive data.\n\n## Affected versions\n\n### Security impact\n\n* NPM package nats.js:\n  + **mainline is unaffected**\n  + beta branch is vulnerable from 2.0.0-201, fixed in 2.0.0-209\n\n### Logic flaw\n\n* NPM package nats.ws:\n  + status: preview\n  + flawed from 1.0.0-85, fixed in 1.0.0-111\n\n* Deno repository https://github.com/nats-io/nats.deno\n  + status: preview\n  + flawed in all git tags prior to fix\n  + fixed with git tag v1.0.0-9\n\n## Impact\n\nFor deployments using TLS client certificates (for mutual TLS), private key material for TLS is leaked from the client application to the\nserver.  If the server is untrusted (run by a third party), or if the client application also disables TLS verification (and so the true identity of the server is unverifiable) then authentication credentials are leaked.\n\n## Workaround\n\n*None*\n\n## Solution\n\nUpgrade your package dependencies to fixed versions, and then reissue any TLS client credentials (with new keys, not just new certificates) and revoke the old ones.","ecosystems":["npm"],"exploits":{"exploitdb":null,"first_seen":null,"github_poc":null,"max_poc_stars":null,"metasploit":null,"nuclei":null,"refs":[],"tier":null},"has_fix":true,"headline":"Client TLS credentials sent raw to server in npm package nats","id":"GHSA-prmc-5v5w-c465","indexable":true,"kev":null,"kind":"advisory","links":{"ecosystem":"npm","product":null,"products":[],"type":"information_disclosure","year":"2021"},"n_packages":2,"n_references":null,"packages":[{"ecosystem":"npm","fixed":["2.0.0-209"],"introduced":["2.0.0-201"],"last_affected":[],"package":"nats","purl":null,"source":"GHSA-prmc-5v5w-c465"},{"ecosystem":"npm","fixed":["2.0.0-209"],"introduced":["2.0.0-201"],"last_affected":[],"package":"nats","purl":"pkg:npm/nats","source":"GHSA-prmc-5v5w-c465"}],"products":null,"published":"2021-04-06","related":[],"sources":[{"class":"attribution","licence":"CC BY 4.0","name":"GitHub Advisory Database","prefix":"GHSA"}],"ssvc":{"automatable":null,"exploitation":null,"technical_impact":null},"state":null,"updated":null,"vendors":null},"summary":"NATS Node.js client leaks TLS private keys to the server during connection, exposing credentials if mutual TLS is used with untrusted servers.","url":"https://insights.sbomify.com/GHSA-prmc-5v5w-c465/"}