{"id":"CVE-2022-29245","published":"2022-05-31T16:35:11Z","modified":"2025-04-22T17:55:45Z","title":"Weak private key generation in SSH.NET","vendor":"sshnet","product":"SSH.NET","tier":"tail","description":{"text":"SSH.NET is a Secure Shell (SSH) library for .NET. In versions 2020.0.0 and 2020.0.1, during an `X25519` key exchange, the client’s private key is generated with `System.Random`. `System.Random` is not a cryptographically secure random number generator, it must therefore not be used for cryptographic purposes. When establishing an SSH connection to a remote host, during the X25519 key exchange, the private key is generated with a weak random number generator whose seed can be brute forced. This allows an attacker who is able to eavesdrop on the communications to decrypt them. Version 2020.0.2 contains a patch for this issue. As a workaround, one may disable support for `curve25519-sha256` and `curve25519-sha256@libssh.org` key exchange algorithms.","provenance":"source","from":"CVE.org"},"cvss":{"score":6.5,"severity":"MEDIUM","version":"3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:N/A:N","provenance":"source","from":"CVE.org CNA"},"epss":{"score":0.01478,"percentile":0.74524,"provenance":"source"},"cwes":[{"id":"CWE-338","name":"Use of Cryptographically Weak Pseudo-Random Number Generator (PRNG)"}],"references":[{"url":"https://github.com/sshnet/SSH.NET/security/advisories/GHSA-72p8-v4hg-v45p","tags":["x_refsource_CONFIRM"]},{"url":"https://github.com/sshnet/SSH.NET/commit/03c6d60736b8f7b42e44d6989a53f9b644a091fb","tags":["x_refsource_MISC"]},{"url":"https://github.com/sshnet/SSH.NET/blob/bc99ada7da3f05f50d9379f2644941d91d5bf05a/src/Renci.SshNet/Security/KeyExchangeECCurve25519.cs#L51","tags":["x_refsource_MISC"]},{"url":"https://github.com/sshnet/SSH.NET/releases/tag/2020.0.2","tags":["x_refsource_MISC"]}],"priority":{"score":19.5,"factors":[{"name":"EPSS percentile","points":14.9},{"name":"CVSS severity","points":4.55}]},"vendorSlug":"sshnet","affectedVersions":[{"vendor":"sshnet","product":"SSH.NET","versions":[">= 2020.0.0, < 2020.0.2"]}],"ssvc":{"exploitation":"poc","automatable":"no","technicalImpact":"partial","timestamp":"2025-04-22T15:46:15.388234Z","from":"CISA ADP","provenance":"source"},"affected":[{"ecosystem":"NuGet","package":"SSH.NET","vulnerableRanges":["<2020.0.2"],"patched":["2020.0.2"],"from":["GHSA-72p8-v4hg-v45p"],"provenance":"source"}],"summary":{"text":"The flaw is in SSH.NET, a .NET Secure Shell library, where the client's private key during the X25519 key exchange is generated with System.Random, a non-cryptographic generator whose seed can be brute-forced. An attacker who can eavesdrop on the connection can exploit this to decrypt the session's communications, and the attack requires user interaction, with no authentication needed and the client connecting to a remote host.","provenance":"ai","model":"claude-haiku-5-5","generatedAt":"2026-11-20T07:17:44Z"},"euvd":{"id":"EUVD-2022-5968","exploited":false,"provenance":"source"}}