CVE-2022-31124 Possible leak of key's raw field if declared length is incorrect in openssh_key_parser

High 7.7 Published Updated

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.

PackageAffectedFixed in
openssh-key-parser PyPIAll versions0.0.6
openssh-key-parser PyPIAll versions0.0.6
openssh-key-parser PyPIAll versions0.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.

Is CVE-2022-31124 in your software?

Upload an SBOM and sbomify checks it against every vulnerability here, every day.

Check your SBOMs for free