CVE-2022-29245: Weak private key generation in SSH.NET
6.5
CVSS Score
3.1
Basic Information
CVE ID
GHSA ID
EPSS Score
0.61429%
CWE
Published
6/1/2022
Updated
1/27/2023
KEV Status
No
Technology
C#
Technical Details
CVSS Vector
CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:N/A:N
Package Name | Ecosystem | Vulnerable Versions | First Patched Version |
---|---|---|---|
SSH.NET | nuget | < 2020.0.2 | 2020.0.2 |
Vulnerability Intelligence
Miggo AI
Root Cause Analysis
The vulnerability stems from the use of System.Random
in the key generation process. The code snippet explicitly shows _privateKey
being populated via rnd.NextBytes()
, where rnd
is a System.Random
instance. Cryptographic protocols require cryptographically secure PRNGs (like RNGCryptoServiceProvider
) to prevent predictability. The fix in commit 03c6d60
replaces this with CryptoAbstraction.GenerateRandom
, confirming the original implementation was insecure. The Start
method is directly responsible for initializing the key exchange, making it the clear vulnerable entry point.