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

- Severity: High 7.7 (CVSS:3.1, scored by GitHub_M) `CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:C/C:H/I:N/A:N`
- Known to be exploited: not in CISA's catalogue, which lists only what CISA has confirmed
- Likelihood of exploitation in the next 30 days (EPSS): 1.35%, higher than 72% of CVEs (2026-12-01)
- Public exploit code or proof of concept: one link below, marked "exploit"
- Published: 2022-07-06T17:30:27.000Z
- Modified: 2026-06-17T04:44:51.220Z
- Also known as: GHSA-hm37-9xh2-q499, PYSEC-2022-233
- Weaknesses: CWE-209
- SSVC (CISA-ADP): exploitation poc, automatable no, technical impact partial
- Assigned by: GitHub_M

## 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.

(As written by CVE List.)

## Affected

- scottcwang openssh_key_parser: < 0.0.6
- openssh-key-parser (PyPI): before 0.0.6; before d5b53b4b7e76c5b666fc657019dbf864fb04076c; before 26e0a471e9fdb23e635bc3014cf4cbd2323a08d3; before 274447f91b4037b7050ae634879b657554523b39
- openssh_key_parser_project openssh_key_parser: before 0.0.6

## Every score

- GitHub_M: CVSS:3.1 7.7 High `CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:C/C:H/I:N/A:N`
- GitHub: CVSS:3.1 7.7 Medium `CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:C/C:H/I:N/A:N`
- GitHub: CVSS:4.0 Medium `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`
- NVD: CVSS:3.1 6.5 Medium `CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:N/A:N`
- NVD: CVSS:2.0 4.0 Medium `AV:N/AC:L/Au:S/C:P/I:N/A:N`

## References

- <https://github.com/scottcwang/openssh_key_parser/pull/5> (exploit, issue-tracking, third-party-advisory, web)
- <https://github.com/scottcwang/openssh_key_parser/security/advisories/GHSA-hm37-9xh2-q499> (advisory, third-party-advisory, web)
- <https://github.com/scottcwang/openssh_key_parser/commit/26e0a471e9fdb23e635bc3014cf4cbd2323a08d3> (fix, patch, third-party-advisory, web)
- <https://github.com/scottcwang/openssh_key_parser/commit/274447f91b4037b7050ae634879b657554523b39> (fix, patch, third-party-advisory, web)
- <https://github.com/scottcwang/openssh_key_parser/commit/d5b53b4b7e76c5b666fc657019dbf864fb04076c> (fix, patch, third-party-advisory, web)
- <https://nvd.nist.gov/vuln/detail/CVE-2022-31124> (advisory)
- <https://github.com/pypa/advisory-database/tree/main/vulns/openssh-key-parser/PYSEC-2022-233.yaml> (web)
- <https://github.com/scottcwang/openssh_key_parser> (web)

## Sources

- CVE List: [CVE-2022-31124](https://www.cve.org/CVERecord?id=CVE-2022-31124), CVE Terms of Use, modified 2025-04-22
- GitHub Advisory Database: [GHSA-hm37-9xh2-q499](https://github.com/advisories/GHSA-hm37-9xh2-q499), CC-BY-4.0, modified 2024-10-07
- NVD: [CVE-2022-31124](https://nvd.nist.gov/vuln/detail/CVE-2022-31124), Public domain, modified 2026-06-17
- PyPA Advisory Database: [PYSEC-2022-233](https://osv.dev/vulnerability/PYSEC-2022-233), CC-BY-4.0, modified 2023-11-08

---

Page: https://cve.day/CVE-2022-31124 · Whole record: https://cve.day/CVE-2022-31124.json · Rebuilt by cve.day 2026-11-25T22:58:12.739Z
