CVE-2022-31124: Openssh key parser Possible Leak Of Key's Raw Vulnerability
MODERATECVE-2022-31124 is a MODERATE (CVSS 7.7) possible leak of key's raw vulnerability (CWE-209: Generation of Error Message Containing Sensitive Information) affecting Openssh key parser libraries in the PyPI ecosystem. The issue involves possible leak of key's raw field if declared length is incorrect. Remediation is available by upgrading affected packages to version 0.0.6.
CVE-2022-31124 at a Glance
Security Impact
CVSS: 7.7
The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:C/C:H/I:N/A:N).
How to Fix CVE-2022-31124
To remediate this vulnerability, upgrade all affected Openssh key parser dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.
pip install openssh-key-parser>=0.0.6
Run the following command in your project directory to verify that all resolved dependencies use the patched release:
pip show openssh-key-parser
How to Check if You Are Affected
To determine whether your Python environment is affected by CVE-2022-31124, inspect your installed packages using pip:
pip show openssh-key-parser
Analyze the terminal output to locate any version of Openssh key parser in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 0.0.6), your application is affected.
Note: The pip show openssh-key-parser command checks currently installed packages in your active Python environment.
Technical Details
Vulnerability Mechanism & Technical Analysis
This vulnerability is classified under CWE-209: Generation of Error Message Containing Sensitive Information, where the product generates an error message that includes sensitive information about its environment, users, or associated data. In Openssh key parser, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.
Source Advisory Statement
CVE-2022-31124 Affected Openssh key parser Versions
1 component(s)| Product / Package | Ecosystem | Affected Versions | Fixed Version |
|---|---|---|---|
|
openssh-key-parser
|
PyPI |
< 0.0.6
|
0.0.6
|
References
Frequently Asked Questions
What is CVE-2022-31124?
Which Openssh key parser versions are affected?
What version fixes CVE-2022-31124?
Is openssh-key-parser affected?
What is the CVSS score of CVE-2022-31124?
What CWE is associated with CVE-2022-31124?
How can I check PyPI dependencies for CVE-2022-31124?
Machine-readable OSV JSON
OSV v1.5 Schema
{
"schema_version" : "1.4.0",
"id" : "GHSA-hm37-9xh2-q499",
"modified" : "2024-10-07T21:17:17Z",
"published" : "2022-07-06T19:24:12Z",
"aliases" : [ "CVE-2022-31124" ],
"summary" : "Possible leak of key's raw field if declared length is incorrect",
"details" : "### Impact\nIf 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.\n\n### Patches\nUpgrade to version 0.0.6, which no longer includes the raw field value in the error message.\n\n### Workarounds\nN/A\n\n### References\nN/A\n\n### For more information\nIf you have any questions or comments about this advisory:\n* Open an issue in [openssh_key_parser](https://github.com/scottcwang/openssh_key_parser)\n",
"severity" : [ {
"type" : "CVSS_V3",
"score" : "CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:C/C:H/I:N/A:N"
}, {
"type" : "CVSS_V4",
"score" : "CVSS:4.0/AV:N/AC:L/AT:N/PR:L/UI:N/VC:N/VI:N/VA:N/SC:H/SI:N/SA:N"
} ],
"affected" : [ {
"package" : {
"ecosystem" : "PyPI",
"name" : "openssh-key-parser"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "0"
}, {
"fixed" : "0.0.6"
} ]
} ]
} ],
"references" : [ {
"type" : "WEB",
"url" : "https://github.com/scottcwang/openssh_key_parser/security/advisories/GHSA-hm37-9xh2-q499"
}, {
"type" : "ADVISORY",
"url" : "https://nvd.nist.gov/vuln/detail/CVE-2022-31124"
}, {
"type" : "WEB",
"url" : "https://github.com/scottcwang/openssh_key_parser/pull/5"
}, {
"type" : "WEB",
"url" : "https://github.com/scottcwang/openssh_key_parser/commit/26e0a471e9fdb23e635bc3014cf4cbd2323a08d3"
}, {
"type" : "WEB",
"url" : "https://github.com/scottcwang/openssh_key_parser/commit/274447f91b4037b7050ae634879b657554523b39"
}, {
"type" : "WEB",
"url" : "https://github.com/scottcwang/openssh_key_parser/commit/d5b53b4b7e76c5b666fc657019dbf864fb04076c"
}, {
"type" : "WEB",
"url" : "https://github.com/pypa/advisory-database/tree/main/vulns/openssh-key-parser/PYSEC-2022-233.yaml"
}, {
"type" : "WEB",
"url" : "https://github.com/scottcwang/openssh_key_parser"
} ],
"database_specific" : {
"cwe_ids" : [ "CWE-209" ],
"severity" : "MODERATE",
"github_reviewed" : true,
"github_reviewed_at" : "2022-07-06T19:24:12Z",
"nvd_published_at" : "2022-07-06T18:15:00Z"
}
}