---
id: CVE-2025-5351
title: A flaw was found in the key export functionality of libssh
summary: >-
  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
  clear…
severity: medium
cvss: 6.5
cvssVector: 'CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:N/I:N/A:H'
cwe:
  - CWE-415
vendor: libssh
product: libssh
affected:
  - 'libssh >= 0.10.0, < 0.11.2'
  - openshift_container_platform = 4.0
  - enterprise_linux = 6.0
  - enterprise_linux = 7.0
  - enterprise_linux = 8.0
  - enterprise_linux = 9.0
  - enterprise_linux = 10.0
patched:
  - libssh 0.11.2
published: '2025-07-04'
updated: '2026-06-25'
source: NVD
sourceUrl: 'https://nvd.nist.gov/vuln/detail/CVE-2025-5351'
references:
  - url: 'https://access.redhat.com/errata/RHSA-2026:18683'
    label: secalert@redhat.com
  - url: 'https://access.redhat.com/security/cve/CVE-2025-5351'
    label: secalert@redhat.com
  - url: 'https://bugzilla.redhat.com/show_bug.cgi?id=2369367'
    label: secalert@redhat.com
tags:
  - nvd
epss: 0.00573
epssPercentile: 0.44928
ingestedAt: '2026-06-29T13:24:34.384Z'
---

## Overview

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.

## Affected

- `libssh >= 0.10.0, < 0.11.2`
- `openshift_container_platform = 4.0`
- `enterprise_linux = 6.0`
- `enterprise_linux = 7.0`
- `enterprise_linux = 8.0`
- `enterprise_linux = 9.0`
- `enterprise_linux = 10.0`

## Remediation

Upgrade past the affected range:

- `libssh 0.11.2`
