CVE-2022-31124

7.7 HIGH

📋 TL;DR

This vulnerability in openssh_key_parser allows attackers to expose sensitive key field values through error messages. Attackers can manipulate declared field lengths to trigger error messages containing raw cryptographic material. Users of openssh_key_parser versions before 0.0.6 are affected.

💻 Affected Systems

Products:
  • openssh_key_parser
Versions: All versions prior to 0.0.6
Operating Systems: All operating systems using Python
Default Config Vulnerable: ⚠️ Yes
Notes: Any application using openssh_key_parser to parse SSH keys is vulnerable regardless of configuration.

📦 What is this software?

⚠️ Risk & Real-World Impact

🔴

Worst Case

Exposure of private SSH keys or other sensitive cryptographic material leading to unauthorized system access and data breaches.

🟠

Likely Case

Information disclosure of cryptographic key components that could aid in further attacks or compromise of SSH authentication.

🟢

If Mitigated

Limited impact with proper error handling and logging controls preventing exposure of sensitive data.

🌐 Internet-Facing: MEDIUM - Requires attacker to manipulate key parsing, but internet-facing systems using this library could be targeted.
🏢 Internal Only: LOW - Requires specific conditions and access to manipulate key files being parsed.

🎯 Exploit Status

Public PoC: ✅ No
Weaponized: UNKNOWN
Unauthenticated Exploit: ✅ No
Complexity: MEDIUM

Exploitation requires ability to modify key files or influence key parsing input. No public exploits known.

🛠️ Fix & Mitigation

✅ Official Fix

Patch Version: 0.0.6

Vendor Advisory: https://github.com/scottcwang/openssh_key_parser/security/advisories/GHSA-hm37-9xh2-q499

Restart Required: No

Instructions:

1. Update openssh_key_parser: pip install --upgrade openssh_key_parser==0.0.6
2. Verify installation: pip show openssh_key_parser
3. Restart any services using the library

🔧 Temporary Workarounds

No known workarounds

all

The vulnerability is in the library's error handling logic and cannot be mitigated without patching.

🧯 If You Can't Patch

  • Monitor for error messages containing sensitive data in application logs
  • Restrict access to systems using vulnerable versions and implement strict input validation

🔍 How to Verify

Check if Vulnerable:

Check openssh_key_parser version: pip show openssh_key_parser | grep Version

Check Version:

pip show openssh_key_parser | grep Version

Verify Fix Applied:

Confirm version is 0.0.6 or higher: pip show openssh_key_parser | grep Version

📡 Detection & Monitoring

Log Indicators:

  • Error messages containing raw cryptographic data from openssh_key_parser parsing failures

Network Indicators:

  • Unusual SSH key parsing attempts or manipulation of key files

SIEM Query:

source="application_logs" AND "openssh_key_parser" AND "error" AND ("raw" OR "field" OR "value")

🔗 References

📤 Share & Export