CVE-2025-5351
Libssh: double free vulnerability in libssh key export functions
No exploitation reported by the sources we read.
- Published2025-07-04
- Fixed in0.11.2
- WeaknessCWE-415
Am I affected?
Debian, Ubuntu or Red Hat sometimes backport a fix without changing the upstream version number: such a version reads « to verify », never « affected ».With a domain, we read the version its public headers and pages expose. A distribution build can carry the fix under an older number.
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.
Timeline
dates in UTC- 2025-07-0409:15CVE publishedNVD
Observed activity
isMalicious corpus · updated 2026-11-03 21:37 UTCBlock these indicators
- Firewall list (EDL, text): https://api.ismalicious.com/edl/cve/CVE-2025-5351?format=txt
- CSV export: https://api.ismalicious.com/edl/cve/CVE-2025-5351?format=csv
- TAXII collection of exploited CVEs
- The EDL and CSV take an API key on the Pro plan.
Versions per branch
NVD| Branch | Affected | Fixed in | Source |
|---|---|---|---|
| 0.x | ≥ 0.10.0, < 0.11.2 | 0.11.2 | NVD |
| Branch | Affected | Fixed in | Source |
|---|---|---|---|
| 6.0 | = 6.0 | no fix published | NVD |
| 7.0 | = 7.0 | no fix published | NVD |
| 8.0 | = 8.0 | no fix published | NVD |
| 9.0 | = 9.0 | no fix published | NVD |
| 10.0 | = 10.0 | no fix published | NVD |
| Branch | Affected | Fixed in | Source |
|---|---|---|---|
| 4.0 | = 4.0 | no fix published | NVD |
as publishedRanges as NVD and OSV publish them; a distribution’s build can be fixed under an older number.
Products declared by the CNA8 products
As redhat, the CNA that assigned this CVE, declared them in the CVE record; versions as written.
- libsshother versions: not affected
https://git.libssh.org/projects/libssh.git/
Affected- ≥ 0.10.0, < 0.11.2fixed in 0.11.2semver
- Red Hat Enterprise Linux 9other versions: affected
package libsshhttps://access.redhat.com/downloads/content/package-browser/
Not affected ≥ 0:0.10.4-18.el9
- Red Hat Enterprise Linux 10other versions: affected
package libsshhttps://access.redhat.com/downloads/content/package-browser/
- Red Hat Enterprise Linux 6other versions: unknown
package libssh2https://access.redhat.com/downloads/content/package-browser/
- Red Hat Enterprise Linux 7other versions: unknown
package libssh2https://access.redhat.com/downloads/content/package-browser/
- Red Hat Enterprise Linux 8other versions: affected
package libsshhttps://access.redhat.com/downloads/content/package-browser/
2 more products in the CVE record.
Source: the CNA record (CVE Program), © The MITRE Corporation,CVE Terms of UseCVE recordupdated 2026-09-01
Distribution builds and vendor advisories
Packages from OSV.dev and products from the vendors' CSAF advisories.
version not verifiedVersions not verified: read as OSV.dev and the vendors publish them, not checked against each vendor's release list.
Packages
- libsshUbuntu:24.04:LTSall versions · fixed in 0.10.6-2ubuntu0.1
- libsshUbuntu:22.04:LTSall versions · fixed in 0.9.6-2ubuntu0.22.04.4
- libsshTuxCare:AlmaLinux:9.6all versions · fixed in 0.10.4-15.el9_6.tuxcare.els2and 2 other packages
- libsshSUSE:Linux Micro 6.1all versions · fixed in 0.10.6-slfo.1.1_2.1
- libsshSUSE:Linux Micro 6.0all versions · fixed in 0.10.6-2.1
- libsshRocky Linux:9all versions · fixed in 0:0.10.4-18.el9
- libsshRed Hat:enterprise_linux:9::baseosall versions · fixed in 0:0.10.4-18.el9and 3 other packages
- libsshopenSUSE:Tumbleweedall versions · fixed in 0.11.2-1.1
18 more package ranges on OSV.dev
Vendor advisories
libssh: Double Free Vulnerability in libssh Key Export Functions
libssh as a component of Red Hat Enterprise Linux 10 · libssh-config as a component of Red Hat Enterprise Linux 10 · libssh-devel as a component of Red Hat Enterprise Linux 10 · +15 more
Red Hat Security Advisory: libssh security update
Fix
- Update Libssh to 0.11.2
- Vendor fix Red Hat Product Security RHSA-2026:18683 · 32 productsFor details on how to apply this update, which includes the changes described in this advisory, refer to: https://access.redhat.com/articles/11258
- Workaround from the vendor Red Hat Product Security RHSA-2026:18683 · 32 productsMitigation for this issue is either not available or the currently available options don't meet the Red Hat Product Security criteria comprising ease of use and deployment, applicability to widespread installation base, or stability. Administrators should apply vendor-supplied patches as soon as th…
- No fix available, says the vendor Red Hat Product Security CVE-2025-5351 · 10 productsFix deferred
- No fix planned, says the vendor Red Hat Product Security CVE-2025-5351 · 8 productsOut of support scope
Detection
- Nuclei template
- none so far ProjectDiscovery
- Exploit-DB
- no entry Exploit-DB
- Proof-of-concept repositories
- none listed PoC-in-GitHub
- Metasploit modules
- none listed Metasploit Framework
Sources
- CISA-ADPSSVC decisionnone2025-07-08
- OpenCVESSVC decisionnone—
- CNACVSS 3.16.5known since 2026-10-23
- NVDCVSS 3.16.5read 2026-10-23
- CNAweakness (CWE)CWE-415known since 2026-10-23
- FIRST EPSSEPSS score0.6 %2026-11-03
- OSVaffected packages—
- GitHub Advisoriesadvisory—
Identifiers
- AZL-64653same flawAzure Linux · MIT
- AZL-64659same flawAzure Linux · MIT
- EUVD-2025-19935same flawENISA EUVD · LicenseRef-ENISA-legal-notice
- GHSA-pfqf-mv4p-9j4rsame flawGitHub Advisory Database · CC-BY-4.0
- JLSEC-2025-98same flawJulia Security Advisories · CC-BY-4.0
- MINI-qx37-856f-g4jvsame flawMinimOS · LicenseRef-unstated
- ALSA-2026:18683advisory covering several CVEsAlmaLinux · MIT
- MGASA-2026-0189advisory covering several CVEsMageia · LicenseRef-unstated
- OESA-2025-2127advisory covering several CVEsopenEuler · LicenseRef-unstated
- OESA-2025-2132advisory covering several CVEsopenEuler · LicenseRef-unstated
- OESA-2025-2294advisory covering several CVEsopenEuler · LicenseRef-unstated
- openSUSE-SU-2025:15243-1advisory covering several CVEsopenSUSE · LicenseRef-unstated
- RHSA-2026:18683advisory covering several CVEsRed Hat · CC-BY-4.0
- RLSA-2026:18683advisory covering several CVEsRocky Linux · BSD-3-Clause
- SUSE-SU-2025:20557-1advisory covering several CVEsSUSE · LicenseRef-unstated
- SUSE-SU-2025:20596-1advisory covering several CVEsSUSE · LicenseRef-unstated
- USN-7619-1advisory covering several CVEsUbuntu
Technical details
- CVSS v3 Vector
- CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:N/I:N/A:H
- Published
- 2025-07-04
- Last Modified
- 2026-09-01
- NVD status
- Modified
- GitHub Advisory
- GHSA-pfqf-mv4p-9j4r
Frequently asked questions
What is CVE-2025-5351?
Is CVE-2025-5351 actively exploited?
What is the CVSS score for CVE-2025-5351?
Running libssh? Hear about its next vulnerability
Surveillance reads the versions in your stack — a domain, a lockfile or a list — checks each CVE against the ranges its sources publish, and alerts you when one you run is exploited or enters CISA KEV. A version it cannot read stays « version not verified ».
No credit card required · No monthly cap on website lookups · 250 API requests/month
Go further
- Following what attackers exploit right now? The CISA KEV additions of the month, with their patch deadlines.
- Running this software? Vulnerability monitoring alerts you to new vulnerabilities in your products.
Related vulnerabilities
Same product first, then the same vendor advisory and the same publication week.
- CVE-2023-48795same product
- CVE-2021-3634same product
- CVE-2025-5318same productLibssh: out-of-bounds read in sftp_handle()
- CVE-2025-5987same product
- CVE-2023-6918same product
- CVE-2023-1667same product
- CVE-2023-2283same product
- CVE-2025-5449same productLibssh: integer overflow in libssh sftp server packet length validation leading to denial of service
Sources for this record
- CVE Program · CVE Program Terms of Use
- ENISA EU Vulnerability Database · ENISA legal notice §1.2 (reproduction authorised, provided the source is acknowledged)
- FIRST EPSS · EPSS terms of use (free use, attribution requested)
- GitHub Advisory Database · CC-BY-4.0 · GHSA-pfqf-mv4p-9j4r
- NVD · Public domain (17 U.S.C. § 105) for NVD-authored data; third-party content under its own terms
- OpenCVE · OpenCVE terms of service · terms restrict redistribution
- OSV.dev · Per record, as its publisher states it: each row carries the label in sourceLicense when one is served
- Red Hat Product Security (CSAF and VEX) · CC-BY-4.0
- CISA Vulnrichment · CC0-1.0