CVE-2022-31124 Possible leak of key's raw field if declared length is incorrect in openssh_key_parser
An attacker can expose sensitive key data by manipulating declared field lengths, causing the parser to leak raw values in error messages.
- Exploited in the wild
- Not known
- Login needed
- Any signed-in user
- Attackable
- Over the internet
- Victim action needed
- Not needed
- Fix
- Available
What is CVE-2022-31124?
CVE-2022-31124 is a high-severity vulnerability in scottcwang openssh_key_parser, published on 6 Jul 2022. Any signed-in user can exploit it over the network, with no action from the victim.
Official description
openssh_key_parser is an open source Python package providing utilities to parse and pack OpenSSH private and public key files. In versions prior to 0.0.6 if a field of a key is shorter than it is declared to be, the parser raises an error with a message containing the raw field value. An attacker able to modify the declared length of a key's sensitive field can thus expose the raw value of that field. Users are advised to upgrade to version 0.0.6, which no longer includes the raw field value in the error message. There are no known workarounds for this issue.
Weakness: CWE-209
Which versions are affected by CVE-2022-31124?
3 open source packages ship an affected version, including openssh-key-parser. It affects 1 product.
| Package | Affected | Fixed in |
|---|---|---|
openssh-key-parser PyPI | All versions | 0.0.6 |
openssh-key-parser PyPI | All versions | 0.0.6 |
openssh-key-parser PyPI | All versions | 0.0.6 |
Products include Openssh Key Parser Project Openssh Key Parser.
How do I fix CVE-2022-31124?
Upgrade openssh-key-parser to 0.0.6 or later.
Is CVE-2022-31124 being exploited?
It is not confirmed as exploited in the wild, but public exploit code for CVE-2022-31124 exists.
Sources
Also known as GHSA-hm37-9xh2-q499, PYSEC-2022-233.