Skip to content
Heist/ feed
Back to feed
High

Possible leak of key's raw field if declared length is incorrect in openssh_key_parser

Type: advisorySources: OSV

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.

Products
Not specified
Affected versions
Not specified
Fixed versions
Not specified
CVEs
CVE-2022-31124
Confirmed fixed CVEs
Not specified
Updated in this feed
5 Nov 2026, 03:32 UTC · Revision 1

Source evidence

Possible leak of key's raw field if declared length is incorrect in openssh_key_parser

core-osv · Original source

Published 6 Jul 2022, 17:30 UTC

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.

osv:CVE-2022-31124
Complete source record
{
  "id": "36e8cdccc0e64927c70d67877a24707b9c6b3cd1ec5f1c89ab789e14a07284e0",
  "url": "https://osv.dev/vulnerability/CVE-2022-31124",
  "method": "structured",
  "payload": {
    "kind": "advisory",
    "title": "Possible leak of key's raw field if declared length is incorrect in openssh_key_parser",
    "summary": "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.",
    "evidence": "osv:CVE-2022-31124",
    "products": [],
    "severity": "high",
    "structured": {
      "id": "CVE-2022-31124",
      "aliases": [
        "CVE-2022-31124",
        "GHSA-hm37-9xh2-q499",
        "PYSEC-2022-233"
      ],
      "metrics": [
        {
          "type": "CVSS_V3",
          "score": "CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:C/C:H/I:N/A:N"
        }
      ],
      "affected": [
        {
          "ranges": [
            {
              "repo": "https://github.com/scottcwang/openssh_key_parser",
              "type": "GIT",
              "events": [
                {
                  "introduced": "0"
                },
                {
                  "fixed": "26e0a471e9fdb23e635bc3014cf4cbd2323a08d3"
                },
                {
                  "fixed": "274447f91b4037b7050ae634879b657554523b39"
                },
                {
                  "fixed": "d5b53b4b7e76c5b666fc657019dbf864fb04076c"
                }
              ],
              "database_specific": {
                "extracted_events": [
                  {
                    "range": [
                      {
                        "fixed": "26e0a471e9fdb23e635bc3014cf4cbd2323a08d3"
                      }
                    ],
                    "source": "REFERENCES_COMMIT"
                  },
                  {
                    "range": [
                      {
                        "fixed": "274447f91b4037b7050ae634879b657554523b39"
                      }
                    ],
                    "source": "REFERENCES_COMMIT"
                  },
                  {
                    "range": [
                      {
                        "fixed": "d5b53b4b7e76c5b666fc657019dbf864fb04076c"
                      }
                    ],
                    "source": "REFERENCES_COMMIT"
                  }
                ]
              }
            }
          ],
          "database_specific": {
            "source": "https://storage.googleapis.com/cve-osv-conversion/osv-output/CVE-2022-31124.json"
          }
        }
      ],
      "modified": "2026-10-28T02:30:42.374755288Z",
      "provider": "osv",
      "references": [
        "https://github.com/CVEProject/cvelistV5/tree/main/cves/2022/31xxx/CVE-2022-31124.json",
        "https://github.com/scottcwang/openssh_key_parser/security/advisories/GHSA-hm37-9xh2-q499",
        "https://nvd.nist.gov/vuln/detail/CVE-2022-31124",
        "https://github.com/scottcwang/openssh_key_parser/commit/26e0a471e9fdb23e635bc3014cf4cbd2323a08d3",
        "https://github.com/scottcwang/openssh_key_parser/commit/274447f91b4037b7050ae634879b657554523b39",
        "https://github.com/scottcwang/openssh_key_parser/commit/d5b53b4b7e76c5b666fc657019dbf864fb04076c",
        "https://github.com/scottcwang/openssh_key_parser/pull/5"
      ],
      "provider_metadata": {
        "cwe_ids": [
          "CWE-209"
        ],
        "cna_assigner": "GitHub_M",
        "unresolved_ranges": [
          {
            "extracted_events": [
              {
                "range": [
                  {
                    "fixed": "0.0.6"
                  }
                ],
                "source": "AFFECTED_FIELD",
                "strategy": "StringRangeExpression"
              }
            ]
          },
          {
            "extracted_events": [
              {
                "range": [
                  {
                    "fixed": "0.0.6"
                  }
                ],
                "source": "DESCRIPTION"
              }
            ]
          }
        ],
        "osv_generated_from": "https://github.com/CVEProject/cvelistV5/tree/main/cves/2022/31xxx/CVE-2022-31124.json"
      }
    },
    "related_cves": [
      {
        "value": "CVE-2022-31124",
        "evidence": "/id"
      }
    ],
    "security_relevant": true,
    "severity_evidence": "/severity/0/score"
  },
  "source_id": "core-osv",
  "document_id": 509878,
  "published_at": "2022-07-06T17:30:27+00:00"
}