CVE-2022-29245
published medium CVSS 3.1 · 6.5Weak private key generation in SSH.NET
Package status and fixes
| Distro / vendor | Release | Package / product | Publisher status | Fixed build | Source |
|---|---|---|---|---|---|
| sshnet | — | SSH.NET>= 2020.0.0, < 2020.0.2 | Affected | Not stated | GitHub_M |
Description
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 `[email protected]` key exchange algorithms.
Related advisories
Vendor advisories explicitly linked to this CVE.
No linked advisories were found for this CVE.
Assessment
CVSS risk assessment and additional context for this vulnerability.
- CVSS version
- 3.1
- Base score
- 6.5 / 10
- Severity
- medium
- Provider
- GitHub_M · cna
- Vector string
- CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:N/A:N
Publisher product statements
Version ranges and default statuses as reported by each provider.
| Vendor | Product | Version status | Source |
|---|---|---|---|
| sshnet | SSH.NET | >= 2020.0.0, < 2020.0.2 (affected) | GitHub_M · cna |
Weaknesses
1- CWE-338 CWE-338: Use of Cryptographically Weak Pseudo-Random Number Generator (PRNG)
References
4- https://github.com/sshnet/SSH.NET/blob/bc99ada7da3f05f50d9379f2644941d91d5bf05a/src/Renci.SshNet/Security/KeyExchangeECCurve25519.cs#L51
- https://github.com/sshnet/SSH.NET/commit/03c6d60736b8f7b42e44d6989a53f9b644a091fb
- https://github.com/sshnet/SSH.NET/releases/tag/2020.0.2
- https://github.com/sshnet/SSH.NET/security/advisories/GHSA-72p8-v4hg-v45p
Provider assertions
3GitHub_M · cna
Weak private key generation in SSH.NET
CISA-ADP · adp
CISA ADP Vulnrichment
CVE · adp
CVE Program Container
Provenance
- Schema
- 5.1
- Searchable
- yes
- Content hash
- fed718abd087b4a3a6d53508fae3b92622bab4a7bce82762317507c714aa7345
- Ingested
- 23 Sep 2026, 07:59:45 UTC
- Source record
- Official CVE record