Vulnerability · Published Jul 4, 2025 · Assigned by redhat
CVE-2025-5351Libssh: double free vulnerability in libssh key export functions
Medium 6.5
In plain English
A medium-severity double free in libssh from libssh. There are no confirmed reports of exploitation so far. The chance it is exploited in the next 30 days is estimated at 0.6% (higher than 50% of all known vulnerabilities). Fixed versions are available - upgrade the affected package.
Official description
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 packages & fixed versions
| Ecosystem | Package | Fixed in | Advisory |
|---|---|---|---|
| AlmaLinux:9 | libssh | 0.10.4-18.el9 | ALSA-2026:18683 |
| AlmaLinux:9 | libssh-config | 0.10.4-18.el9 | ALSA-2026:18683 |
| AlmaLinux:9 | libssh-devel | 0.10.4-18.el9 | ALSA-2026:18683 |
| Alpine:v3.22 | libssh | 0.11.2-r0 | ALPINE-CVE-2025-5351 |
| Alpine:v3.23 | libssh | 0.11.2-r0 | ALPINE-CVE-2025-5351 |
| Alpine:v3.24 | libssh | 0.11.2-r0 | ALPINE-CVE-2025-5351 |
| Debian:12 | libssh | 0.10.6-0+deb12u2 | DEBIAN-CVE-2025-5351 |
| Debian:13 | libssh | 0.11.2-1 | DEBIAN-CVE-2025-5351 |
| Debian:14 | libssh | 0.11.2-1 | DEBIAN-CVE-2025-5351 |
| Rocky Linux:9 | libssh | 0:0.10.4-18.el9 | RLSA-2026:18683 |
| Ubuntu:22.04:LTS | libssh | 0.9.6-2ubuntu0.22.04.4 | USN-7619-1 |
| Ubuntu:24.04:LTS | libssh | 0.10.6-2ubuntu0.1 | USN-7619-1 |
| Ubuntu:24.04:LTS | libssh | 0.10.6-2ubuntu0.1 | UBUNTU-CVE-2025-5351 |
Affected products (as reported)
| Vendor | Product | Versions |
|---|---|---|
| libssh | libssh | 0.10.0 – before 0.11.2 |
| Red Hat | Red Hat Enterprise Linux 9 | see references |
| Red Hat | Red Hat Enterprise Linux 9 | see references |
| Red Hat | Red Hat Enterprise Linux 10 | see references |
| Red Hat | Red Hat Enterprise Linux 6 | see references |
| Red Hat | Red Hat Enterprise Linux 7 | see references |
| Red Hat | Red Hat Enterprise Linux 8 | see references |
| Red Hat | Red Hat OpenShift Container Platform 4 | see references |
| Red Hat | Red Hat OpenShift Container Platform 4 | see references |
Weakness: CWE-415 · Vector: CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:N/I:N/A:H
References
- RHSA-2026:18683 vendor-advisory, x_refsource_REDHAT
- https://access.redhat.com/security/cve/CVE-2025-5351 vdb-entry, x_refsource_REDHAT
- RHBZ#2369367 issue-tracking, x_refsource_REDHAT