{"id":"CVE-2022-31124","aliases":["CVE-2022-31124","GHSA-hm37-9xh2-q499","PYSEC-2022-233"],"related":[],"kind":"vulnerability","state":"published","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.","summarySource":"cvelist","descriptions":[{"lang":"en","text":"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.","source":"cvelist"},{"lang":"en","text":"### 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)","format":"markdown","source":"ghsa"},{"lang":"es","text":"openssh_key_parser es un paquete de código abierto de Python que proporciona utilidades para analizar y empaquetar archivos de clave pública y privada de OpenSSH. En versiones anteriores a 0.0.6, si un campo de una clave es más corto de lo que se declara, el analizador genera un error con un mensaje que contiene el valor del campo en bruto. Un atacante capaz de modificar la longitud declarada del campo confidencial de una clave puede así exponer el valor bruto de ese campo. Es recomendado a usuarios actualizar a versión 0.0.6, que ya no incluye el valor bruto del campo en el mensaje de error. No se presentan mitigaciones conocidas para este problema","source":"nvd"}],"published":"2022-07-06T17:30:27.000Z","modified":"2026-06-17T04:44:51.220Z","severity":{"scorer":"GitHub_M","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:C/C:H/I:N/A:N","score":7.7,"rating":"HIGH"},"severities":[{"scorer":"GitHub_M","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:C/C:H/I:N/A:N","score":7.7,"rating":"HIGH"},{"scorer":"GitHub","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:C/C:H/I:N/A:N","score":7.7,"rating":"MEDIUM"},{"scorer":"GitHub","scheme":"CVSS:4.0","vector":"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","rating":"MEDIUM"},{"scorer":"NVD","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:N/A:N","score":6.5,"rating":"MEDIUM"},{"scorer":"NVD","scheme":"CVSS:2.0","vector":"AV:N/AC:L/Au:S/C:P/I:N/A:N","score":4,"rating":"MEDIUM"}],"cwes":["CWE-209"],"affected":[{"ranges":[{"version":"< 0.0.6","status":"affected"}],"vendor":"scottcwang","product":"openssh_key_parser","source":"cvelist"},{"ranges":[{"type":"ecosystem","introduced":"0","status":"affected","fixed":"0.0.6"}],"ecosystem":"PyPI","package":"openssh-key-parser","purl":"pkg:pypi/openssh-key-parser","source":"ghsa"},{"ranges":[{"status":"affected","fixed":"0.0.6"}],"vendor":"openssh_key_parser_project","product":"openssh_key_parser","cpe":"cpe:2.3:a:openssh_key_parser_project:openssh_key_parser:*:*:*:*:*:python:*:*","source":"nvd"},{"ranges":[{"type":"git","introduced":"0","status":"affected","fixed":"d5b53b4b7e76c5b666fc657019dbf864fb04076c"},{"type":"git","status":"affected","fixed":"26e0a471e9fdb23e635bc3014cf4cbd2323a08d3"},{"type":"git","status":"affected","fixed":"274447f91b4037b7050ae634879b657554523b39"},{"type":"ecosystem","introduced":"0","status":"affected","fixed":"0.0.6"}],"ecosystem":"PyPI","package":"openssh-key-parser","purl":"pkg:pypi/openssh-key-parser","repo":"https://github.com/scottcwang/openssh_key_parser","source":"pysec"}],"references":[{"url":"https://github.com/scottcwang/openssh_key_parser/security/advisories/GHSA-hm37-9xh2-q499","tags":["advisory","third-party-advisory","web","x-refsource-confirm","x-transferred"],"sources":["cvelist","ghsa","nvd","pysec"]},{"url":"https://github.com/scottcwang/openssh_key_parser/pull/5","tags":["exploit","issue-tracking","third-party-advisory","web","x-refsource-misc","x-transferred"],"sources":["cvelist","ghsa","nvd","pysec"]},{"url":"https://github.com/scottcwang/openssh_key_parser/commit/26e0a471e9fdb23e635bc3014cf4cbd2323a08d3","tags":["fix","patch","third-party-advisory","web","x-refsource-misc","x-transferred"],"sources":["cvelist","ghsa","nvd","pysec"]},{"url":"https://github.com/scottcwang/openssh_key_parser/commit/274447f91b4037b7050ae634879b657554523b39","tags":["fix","patch","third-party-advisory","web","x-refsource-misc","x-transferred"],"sources":["cvelist","ghsa","nvd","pysec"]},{"url":"https://github.com/scottcwang/openssh_key_parser/commit/d5b53b4b7e76c5b666fc657019dbf864fb04076c","tags":["fix","patch","third-party-advisory","web","x-refsource-misc","x-transferred"],"sources":["cvelist","ghsa","nvd","pysec"]},{"url":"https://nvd.nist.gov/vuln/detail/CVE-2022-31124","tags":["advisory"],"sources":["ghsa"]},{"url":"https://github.com/pypa/advisory-database/tree/main/vulns/openssh-key-parser/PYSEC-2022-233.yaml","tags":["web"],"sources":["ghsa"]},{"url":"https://github.com/scottcwang/openssh_key_parser","tags":["web"],"sources":["ghsa"]}],"credits":[],"assigner":"GitHub_M","ssvc":{"scorer":"CISA-ADP","exploitation":"poc","automatable":"no","technicalImpact":"partial","date":"2025-04-22T15:45:44.952Z"},"sources":[{"source":"cvelist","name":"CVE List","id":"CVE-2022-31124","url":"https://www.cve.org/CVERecord?id=CVE-2022-31124","licence":"CVE Terms of Use","modified":"2025-04-22T17:51:53.172Z"},{"source":"ghsa","name":"GitHub Advisory Database","id":"GHSA-hm37-9xh2-q499","url":"https://github.com/advisories/GHSA-hm37-9xh2-q499","licence":"CC-BY-4.0","modified":"2024-10-07T21:25:25.797Z"},{"source":"nvd","name":"NVD","id":"CVE-2022-31124","url":"https://nvd.nist.gov/vuln/detail/CVE-2022-31124","licence":"Public domain","modified":"2026-06-17T04:44:51.220Z"},{"source":"pysec","name":"PyPA Advisory Database","id":"PYSEC-2022-233","url":"https://osv.dev/vulnerability/PYSEC-2022-233","licence":"CC-BY-4.0","modified":"2023-11-08T04:09:26.994Z"}],"updatedAt":"2026-11-25T22:58:12.739Z","epss":{"score":0.01355,"percentile":0.7243,"date":"2026-12-01T12:00:22.000Z"}}