Weak private key generation in SSH.NET
Key facts
- Attack vector
- Network
- Privileges required
- None
- User interaction
- Required
- Attack complexity
- Low
- Impact type
- —
- Confidentiality · integrity · availability
- High · None · None
- Fix status
- Fixed
Attack profile from CVSS 3.1 · CNA. Fix status from CNA and GitHub.
Summary
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.
Why it matters now
SSVC decision points
CISA ADP · SSVC 2.0.3
- Exploitation
- Poc
- Automatable
- No
- Technical impact
- Partial
The decision (Track, Attend, Act) also depends on your mission and well-being impact; see CISA's SSVC guide.
Affected products
| Vendor | Product | Affected versions | Fixed in | Status | Source |
|---|---|---|---|---|---|
| sshnet | SSH.NET | 2020.0.0 to before 2020.0.2 | 2020.0.2 | Patch available | CNA |
| — | SSH.NET (NuGet) | before 2020.0.2 | 2020.0.2 | Patch available | GHSA-72p8-v4hg-v45p |
- SSH.NET Vendorsshnet Affected 2020.0.0 to before 2020.0.2 Fixed in 2020.0.2 Patch available CNA
- SSH.NET (NuGet) Vendor— Affected before 2020.0.2 Fixed in 2020.0.2 Patch available GHSA-72p8-v4hg-v45p
CPE configurations NVD · 3
| CPE | Versions | Role | Vendor |
|---|---|---|---|
| cpe:2.3:a:ssh.net_project:ssh.net:2020.0.0:-:*:*:*:.net:*:* | 2020.0.0 | Vulnerable | Ssh.net Project |
| cpe:2.3:a:ssh.net_project:ssh.net:2020.0.0:beta1:*:*:*:.net:*:* | 2020.0.0 beta1 | Vulnerable | Ssh.net Project |
| cpe:2.3:a:ssh.net_project:ssh.net:2020.0.1:*:*:*:*:.net:*:* | 2020.0.1 | Vulnerable | Ssh.net Project |
- cpe:2.3:a:ssh.net_project:ssh.net:2020.0.0:-:*:*:*:.net:*:* Versions 2020.0.0 Vulnerable ·Ssh.net Project
- cpe:2.3:a:ssh.net_project:ssh.net:2020.0.0:beta1:*:*:*:.net:*:* Versions 2020.0.0 beta1 Vulnerable ·Ssh.net Project
- cpe:2.3:a:ssh.net_project:ssh.net:2020.0.1:*:*:*:*:.net:*:* Versions 2020.0.1 Vulnerable ·Ssh.net Project
Remediation
- Fix · CNA SSH.NET (sshnet) Fixed in 2020.0.2
- Fix · GHSA-72p8-v4hg-v45p SSH.NET (NuGet) Fixed in 2020.0.2 Advisory →
Timeline
- 2026-10-02 Threatist record created from CVE-2022-29245
- 2026-10-03 Alias added: GHSA-72p8-v4hg-v45p
References
Exploit 2
Advisory 2
More sshnet vulnerabilities
- TI-2026-58836 SSH.NET: ScpClient allows server-side RCE via default SCP path handling CVSS 3.1HIGH 7.5
- TI-2026-36068 SSH.NET: ScpClient Recursive Download Allows Arbitrary File Write via Server-Controlled SCP Filenames CVSS 3.1HIGH 7.1
Sources
- CVE-2022-29245 · CVE Program
- CVE-2022-29245 · NVD
- FIRST EPSS
- GHSA-72p8-v4hg-v45p · GitHub Advisory Database · CC BY 4.0
This product uses the NVD API but is not endorsed or certified by the NVD. Sources and licences