CVE-2025-5351: Libssh: double free vulnerability in libssh key export functions
A flaw was found in the key export functionality of libssh. The issue occurs in the internal function responsible for converting cryptographic keys into serialized formats. During error handling, a memory structure is freed but not cleared, leading to a potential double free issue if an additional failure occurs later in the function. This condition may result in heap corruption or application instability in low-memory scenarios, posing a risk to system reliability where key export operations are performed.
Security readout for executives and security teams
Plain-English summary
Libssh can free the same memory twice when key export encounters multiple failures, particularly under low-memory conditions. This can corrupt memory or crash applications using the affected library. The documented impact is service availability; the sources do not claim data theft or modification.
Executive priority
Schedule prompt remediation for affected systems, prioritizing externally reachable or availability-critical services that perform key export. Emergency treatment is not supported by current exploitation evidence, but unexplained crashes should raise urgency.
Technical view
During cryptographic-key serialization, an error path frees a memory structure without clearing its reference. A subsequent failure can free it again, causing CWE-415 double free, heap corruption, or process termination. The supplied CVSS 3.1 score is 6.5, with high availability impact and no stated confidentiality or integrity impact.
Likely exposure
The bundle marks libssh packages in RHEL 8, 9, 10 and OpenShift 4 as affected. Practical exposure requires software using the vulnerable key-export path. RHEL 6 and 7 entries concern libssh2 and remain unknown; the listed upstream libssh 0.10.0 entry is marked unaffected.
Exploitation context
The bundle reports no KEV listing, and no cited source establishes active exploitation. Triggering appears dependent on key export plus multiple error conditions, potentially including memory pressure. The CVSS assessment nevertheless models network reachability, low required privileges, low complexity, and no user interaction.
Researcher notes
The core condition is CWE-415 in an internal key-conversion error path. The affected matrix contains a duplicate RHEL 9 entry and unknown libssh2 status for RHEL 6 and 7. Fixed-version boundaries are absent, so package conclusions should follow vendor advisory metadata rather than upstream version assumptions.
Mitigation direction
Apply Red Hat security updates identified in RHSA-2026:18683 to affected supported systems.
Inventory bundled libssh copies and consult corresponding vendor guidance for non-Red Hat builds.
Reduce unnecessary exposure of applications invoking libssh key export until updates are verified.
Monitor crashes and allocator errors around key serialization, especially during memory pressure.
Validation and detection
Match installed packages and container images against vendor advisories for RHEL 8, 9, 10, and OpenShift 4.
Confirm which workloads invoke libssh key-export or serialization functions.
Verify corrected package versions using vendor metadata; the supplied bundle does not identify fixed versions.
Review application and system logs for crashes or allocator errors during key export.
Generated from the cited source records. This long-tail analysis has not been individually reviewed by a named human.
Potential ATT&CK relevance
Conservative CVE-to-ATT&CK context
These mappings and lookup hints may be relevant to the vulnerability behavior, CWE, affected product, or exposure path. Glexia-inferred context is not an official MITRE, ATT&CK, CWE, or CVE Program mapping.
ATT&CK lookup starting points
Use these exact CWE pages and searches to review the Glexia ATT&CK library from this CVE's weakness and description context.
cwe · low confidence lookup
CWE-415: Exact CWE lookup
Use the exact CWE identifier as the starting point before reviewing related ATT&CK behavior. Open the exact CWE lookup page first, then review the ATT&CK searches from that MITRE weakness context. This is a Glexia lookup hint, not an official ATT&CK mapping.
The affected technology mentions containers, so container-specific ATT&CK technique review may help. This is a Glexia inferred lookup path, not an official MITRE, ATT&CK, or CVE Program mapping.
These fields come from the CVE record and ADP containers, not from Glexia's Take. They preserve time-varying source decisions such as CISA SSVC, KEV status, CVSS metrics, and provider references.
We collect every scored CVSS vector available in the official CNA and ADP containers. When more than one version is present, the table keeps the source vectors side by side instead of collapsing them into the highest score.