libssh — security advisory
A flaw was found in the libssh library in versions less than 0.11.2. An out-of-bounds read can be triggered in the sftp_handle function due to an incorrect comparison check that permits the function to access memory beyond the valid handle list and to return an invalid pointer, which is used in further processing. This vulnerability allows an authenticated remote attacker to potentially read unintended memory regions, exposing sensitive information or affect service behavior.
- Products
- libssh
- Affected versions
- 0.10.5-3ubuntu1, 0.10.5-3ubuntu2, 0.10.6-2, 0.10.6-2build1, 0.10.6-2build2, 0.6.3-3ubuntu3, 0.6.3-4.1, 0.6.3-4.2, 0.6.3-4.2ubuntu1, 0.6.3-4.3, 0.6.3-4.3ubuntu0.1, 0.6.3-4.3ubuntu0.2, 0.6.3-4.3ubuntu0.5, 0.6.3-4.3ubuntu0.6, 0.6.3-4.3ubuntu0.6+esm1, 0.7.5-1, 0.8.0~20170825.94fa1e38-1, 0.8.0~20170825.94fa1e38-1build1, 0.8.0~20170825.94fa1e38-1ubuntu0.1, 0.8.0~20170825.94fa1e38-1ubuntu0.2, 0.8.0~20170825.94fa1e38-1ubuntu0.5, 0.8.0~20170825.94fa1e38-1ubuntu0.6, 0.8.0~20170825.94fa1e38-1ubuntu0.7, 0.8.0~20170825.94fa1e38-1ubuntu0.7+esm3, 0.9.0-1ubuntu1, 0.9.0-1ubuntu4, 0.9.0-1ubuntu5, 0.9.3-2ubuntu1, 0.9.3-2ubuntu2, 0.9.3-2ubuntu2.1, 0.9.3-2ubuntu2.2, 0.9.3-2ubuntu2.3, 0.9.3-2ubuntu2.4, 0.9.3-2ubuntu2.5, 0.9.6-1, 0.9.6-1build1, 0.9.6-2, 0.9.6-2build1, 0.9.6-2ubuntu0.22.04.1, 0.9.6-2ubuntu0.22.04.2, 0.9.6-2ubuntu0.22.04.3
- Fixed versions
- 0.10.6-2ubuntu0.1, 0.6.3-4.3ubuntu0.6+esm2, 0.8.0~20170825.94fa1e38-1ubuntu0.7+esm4, 0.9.3-2ubuntu2.5+esm1, 0.9.6-2ubuntu0.22.04.4
- CVEs
- CVE-2025-5318
- Confirmed fixed CVEs
- Not specified
- Updated in this feed
- 1 Nov 2026, 17:14 UTC · Revision 1
Source evidence
A flaw was found in the libssh library in versions less than 0.11.2. An out-of-bounds read can be triggered in the sftp_handle function due to an incorrect comparison check that permits the function to access memory beyond the valid handle list and to return an invalid pointer, which is used in further processing. This vulnerability allows an authenticated remote attacker to potentially read unintended memory regions, exposing sensitive information or affect service behavior.
osv:UBUNTU-CVE-2025-5318
libssh
Fixed versions: 0.6.3-4.3ubuntu0.6+esm2
libssh
Fixed versions: 0.8.0~20170825.94fa1e38-1ubuntu0.7+esm4
libssh
Fixed versions: 0.9.3-2ubuntu2.5+esm1
libssh
Fixed versions: 0.9.6-2ubuntu0.22.04.4
libssh
Fixed versions: 0.10.6-2ubuntu0.1
Complete source record
{
"id": "fdfac3f33fedf7fae389b722dc58f0c563a7a5e86298b4a4aa798ab46d937b98",
"url": "https://osv.dev/vulnerability/UBUNTU-CVE-2025-5318",
"method": "structured",
"payload": {
"kind": "advisory",
"title": "UBUNTU-CVE-2025-5318",
"summary": "A flaw was found in the libssh library in versions less than 0.11.2. An out-of-bounds read can be triggered in the sftp_handle function due to an incorrect comparison check that permits the function to access memory beyond the valid handle list and to return an invalid pointer, which is used in further processing. This vulnerability allows an authenticated remote attacker to potentially read unintended memory regions, exposing sensitive information or affect service behavior.",
"evidence": "osv:UBUNTU-CVE-2025-5318",
"products": [
{
"name": {
"value": "libssh",
"evidence": "/affected/0/package/name"
},
"prerequisites": [],
"fixed_versions": [
{
"value": "0.6.3-4.3ubuntu0.6+esm2",
"evidence": "/affected/0/ranges"
}
],
"affected_versions": [
{
"value": "0.6.3-3ubuntu3",
"evidence": "/affected/0/versions"
},
{
"value": "0.6.3-4.1",
"evidence": "/affected/0/versions"
},
{
"value": "0.6.3-4.2",
"evidence": "/affected/0/versions"
},
{
"value": "0.6.3-4.2ubuntu1",
"evidence": "/affected/0/versions"
},
{
"value": "0.6.3-4.3",
"evidence": "/affected/0/versions"
},
{
"value": "0.6.3-4.3ubuntu0.1",
"evidence": "/affected/0/versions"
},
{
"value": "0.6.3-4.3ubuntu0.2",
"evidence": "/affected/0/versions"
},
{
"value": "0.6.3-4.3ubuntu0.5",
"evidence": "/affected/0/versions"
},
{
"value": "0.6.3-4.3ubuntu0.6",
"evidence": "/affected/0/versions"
},
{
"value": "0.6.3-4.3ubuntu0.6+esm1",
"evidence": "/affected/0/versions"
}
]
},
{
"name": {
"value": "libssh",
"evidence": "/affected/1/package/name"
},
"prerequisites": [],
"fixed_versions": [
{
"value": "0.8.0~20170825.94fa1e38-1ubuntu0.7+esm4",
"evidence": "/affected/1/ranges"
}
],
"affected_versions": [
{
"value": "0.7.5-1",
"evidence": "/affected/1/versions"
},
{
"value": "0.8.0~20170825.94fa1e38-1",
"evidence": "/affected/1/versions"
},
{
"value": "0.8.0~20170825.94fa1e38-1build1",
"evidence": "/affected/1/versions"
},
{
"value": "0.8.0~20170825.94fa1e38-1ubuntu0.1",
"evidence": "/affected/1/versions"
},
{
"value": "0.8.0~20170825.94fa1e38-1ubuntu0.2",
"evidence": "/affected/1/versions"
},
{
"value": "0.8.0~20170825.94fa1e38-1ubuntu0.5",
"evidence": "/affected/1/versions"
},
{
"value": "0.8.0~20170825.94fa1e38-1ubuntu0.6",
"evidence": "/affected/1/versions"
},
{
"value": "0.8.0~20170825.94fa1e38-1ubuntu0.7",
"evidence": "/affected/1/versions"
},
{
"value": "0.8.0~20170825.94fa1e38-1ubuntu0.7+esm3",
"evidence": "/affected/1/versions"
}
]
},
{
"name": {
"value": "libssh",
"evidence": "/affected/2/package/name"
},
"prerequisites": [],
"fixed_versions": [
{
"value": "0.9.3-2ubuntu2.5+esm1",
"evidence": "/affected/2/ranges"
}
],
"affected_versions": [
{
"value": "0.9.0-1ubuntu1",
"evidence": "/affected/2/versions"
},
{
"value": "0.9.0-1ubuntu4",
"evidence": "/affected/2/versions"
},
{
"value": "0.9.0-1ubuntu5",
"evidence": "/affected/2/versions"
},
{
"value": "0.9.3-2ubuntu1",
"evidence": "/affected/2/versions"
},
{
"value": "0.9.3-2ubuntu2",
"evidence": "/affected/2/versions"
},
{
"value": "0.9.3-2ubuntu2.1",
"evidence": "/affected/2/versions"
},
{
"value": "0.9.3-2ubuntu2.2",
"evidence": "/affected/2/versions"
},
{
"value": "0.9.3-2ubuntu2.3",
"evidence": "/affected/2/versions"
},
{
"value": "0.9.3-2ubuntu2.4",
"evidence": "/affected/2/versions"
},
{
"value": "0.9.3-2ubuntu2.5",
"evidence": "/affected/2/versions"
}
]
},
{
"name": {
"value": "libssh",
"evidence": "/affected/3/package/name"
},
"prerequisites": [],
"fixed_versions": [
{
"value": "0.9.6-2ubuntu0.22.04.4",
"evidence": "/affected/3/ranges"
}
],
"affected_versions": [
{
"value": "0.9.6-1",
"evidence": "/affected/3/versions"
},
{
"value": "0.9.6-1build1",
"evidence": "/affected/3/versions"
},
{
"value": "0.9.6-2",
"evidence": "/affected/3/versions"
},
{
"value": "0.9.6-2build1",
"evidence": "/affected/3/versions"
},
{
"value": "0.9.6-2ubuntu0.22.04.1",
"evidence": "/affected/3/versions"
},
{
"value": "0.9.6-2ubuntu0.22.04.2",
"evidence": "/affected/3/versions"
},
{
"value": "0.9.6-2ubuntu0.22.04.3",
"evidence": "/affected/3/versions"
}
]
},
{
"name": {
"value": "libssh",
"evidence": "/affected/4/package/name"
},
"prerequisites": [],
"fixed_versions": [
{
"value": "0.10.6-2ubuntu0.1",
"evidence": "/affected/4/ranges"
}
],
"affected_versions": [
{
"value": "0.10.5-3ubuntu1",
"evidence": "/affected/4/versions"
},
{
"value": "0.10.5-3ubuntu2",
"evidence": "/affected/4/versions"
},
{
"value": "0.10.6-2",
"evidence": "/affected/4/versions"
},
{
"value": "0.10.6-2build1",
"evidence": "/affected/4/versions"
},
{
"value": "0.10.6-2build2",
"evidence": "/affected/4/versions"
}
]
}
],
"severity": "high",
"structured": {
"id": "UBUNTU-CVE-2025-5318",
"aliases": [
"UBUNTU-CVE-2025-5318"
],
"metrics": [
{
"type": "CVSS_V3",
"score": "CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:L/I:L/A:N"
},
{
"type": "CVSS_V3",
"score": "CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:N/A:H"
},
{
"type": "Ubuntu",
"score": "medium"
}
],
"affected": [
{
"ranges": [
{
"type": "ECOSYSTEM",
"events": [
{
"introduced": "0"
},
{
"fixed": "0.6.3-4.3ubuntu0.6+esm2"
}
]
}
],
"package": {
"name": "libssh",
"purl": "pkg:deb/ubuntu/libssh?arch=source&distro=esm-infra%2Fxenial",
"ecosystem": "Ubuntu:Pro:16.04:LTS"
},
"versions": [
"0.6.3-3ubuntu3",
"0.6.3-4.1",
"0.6.3-4.2",
"0.6.3-4.2ubuntu1",
"0.6.3-4.3",
"0.6.3-4.3ubuntu0.1",
"0.6.3-4.3ubuntu0.2",
"0.6.3-4.3ubuntu0.5",
"0.6.3-4.3ubuntu0.6",
"0.6.3-4.3ubuntu0.6+esm1"
],
"database_specific": {
"source": "https://github.com/canonical/ubuntu-security-notices/blob/main/osv/cve/2025/UBUNTU-CVE-2025-5318.json"
},
"ecosystem_specific": {
"binaries": [
{
"binary_name": "libssh-4",
"binary_version": "0.6.3-4.3ubuntu0.6+esm2"
},
{
"binary_name": "libssh-gcrypt-4",
"binary_version": "0.6.3-4.3ubuntu0.6+esm2"
}
],
"availability": "Available with Ubuntu Pro (Infra-only): https://ubuntu.com/pro"
}
},
{
"ranges": [
{
"type": "ECOSYSTEM",
"events": [
{
"introduced": "0"
},
{
"fixed": "0.8.0~20170825.94fa1e38-1ubuntu0.7+esm4"
}
]
}
],
"package": {
"name": "libssh",
"purl": "pkg:deb/ubuntu/libssh?arch=source&distro=esm-infra%2Fbionic",
"ecosystem": "Ubuntu:Pro:18.04:LTS"
},
"versions": [
"0.7.5-1",
"0.8.0~20170825.94fa1e38-1",
"0.8.0~20170825.94fa1e38-1build1",
"0.8.0~20170825.94fa1e38-1ubuntu0.1",
"0.8.0~20170825.94fa1e38-1ubuntu0.2",
"0.8.0~20170825.94fa1e38-1ubuntu0.5",
"0.8.0~20170825.94fa1e38-1ubuntu0.6",
"0.8.0~20170825.94fa1e38-1ubuntu0.7",
"0.8.0~20170825.94fa1e38-1ubuntu0.7+esm3"
],
"database_specific": {
"source": "https://github.com/canonical/ubuntu-security-notices/blob/main/osv/cve/2025/UBUNTU-CVE-2025-5318.json"
},
"ecosystem_specific": {
"binaries": [
{
"binary_name": "libssh-4",
"binary_version": "0.8.0~20170825.94fa1e38-1ubuntu0.7+esm4"
},
{
"binary_name": "libssh-gcrypt-4",
"binary_version": "0.8.0~20170825.94fa1e38-1ubuntu0.7+esm4"
}
],
"availability": "Available with Ubuntu Pro (Infra-only): https://ubuntu.com/pro"
}
},
{
"ranges": [
{
"type": "ECOSYSTEM",
"events": [
{
"introduced": "0"
},
{
"fixed": "0.9.3-2ubuntu2.5+esm1"
}
]
}
],
"package": {
"name": "libssh",
"purl": "pkg:deb/ubuntu/libssh?arch=source&distro=esm-infra%2Ffocal",
"ecosystem": "Ubuntu:Pro:20.04:LTS"
},
"versions": [
"0.9.0-1ubuntu1",
"0.9.0-1ubuntu4",
"0.9.0-1ubuntu5",
"0.9.3-2ubuntu1",
"0.9.3-2ubuntu2",
"0.9.3-2ubuntu2.1",
"0.9.3-2ubuntu2.2",
"0.9.3-2ubuntu2.3",
"0.9.3-2ubuntu2.4",
"0.9.3-2ubuntu2.5"
],
"database_specific": {
"source": "https://github.com/canonical/ubuntu-security-notices/blob/main/osv/cve/2025/UBUNTU-CVE-2025-5318.json"
},
"ecosystem_specific": {
"binaries": [
{
"binary_name": "libssh-4",
"binary_version": "0.9.3-2ubuntu2.5+esm1"
},
{
"binary_name": "libssh-gcrypt-4",
"binary_version": "0.9.3-2ubuntu2.5+esm1"
}
],
"availability": "Available with Ubuntu Pro (Infra-only): https://ubuntu.com/pro"
}
},
{
"ranges": [
{
"type": "ECOSYSTEM",
"events": [
{
"introduced": "0"
},
{
"fixed": "0.9.6-2ubuntu0.22.04.4"
}
]
}
],
"package": {
"name": "libssh",
"purl": "pkg:deb/ubuntu/libssh?arch=source&distro=jammy",
"ecosystem": "Ubuntu:22.04:LTS"
},
"versions": [
"0.9.6-1",
"0.9.6-1build1",
"0.9.6-2",
"0.9.6-2build1",
"0.9.6-2ubuntu0.22.04.1",
"0.9.6-2ubuntu0.22.04.2",
"0.9.6-2ubuntu0.22.04.3"
],
"database_specific": {
"source": "https://github.com/canonical/ubuntu-security-notices/blob/main/osv/cve/2025/UBUNTU-CVE-2025-5318.json"
},
"ecosystem_specific": {
"binaries": [
{
"binary_name": "libssh-4",
"binary_version": "0.9.6-2ubuntu0.22.04.4"
},
{
"binary_name": "libssh-gcrypt-4",
"binary_version": "0.9.6-2ubuntu0.22.04.4"
}
],
"availability": "No subscription required"
}
},
{
"ranges": [
{
"type": "ECOSYSTEM",
"events": [
{
"introduced": "0"
},
{
"fixed": "0.10.6-2ubuntu0.1"
}
]
}
],
"package": {
"name": "libssh",
"purl": "pkg:deb/ubuntu/libssh?arch=source&distro=noble",
"ecosystem": "Ubuntu:24.04:LTS"
},
"versions": [
"0.10.5-3ubuntu1",
"0.10.5-3ubuntu2",
"0.10.6-2",
"0.10.6-2build1",
"0.10.6-2build2"
],
"database_specific": {
"source": "https://github.com/canonical/ubuntu-security-notices/blob/main/osv/cve/2025/UBUNTU-CVE-2025-5318.json"
},
"ecosystem_specific": {
"binaries": [
{
"binary_name": "libssh-4",
"binary_version": "0.10.6-2ubuntu0.1"
},
{
"binary_name": "libssh-gcrypt-4",
"binary_version": "0.10.6-2ubuntu0.1"
}
],
"availability": "No subscription required"
}
}
],
"modified": "2026-10-27T04:15:26.047111605Z",
"provider": "osv",
"upstream": [
"CVE-2025-5318"
],
"references": [
"https://ubuntu.com/security/CVE-2025-5318",
"https://www.cve.org/CVERecord?id=CVE-2025-5318",
"https://access.redhat.com/security/cve/CVE-2025-5318",
"https://www.libssh.org/security/advisories/CVE-2025-5318.txt",
"https://ubuntu.com/security/notices/USN-7619-1",
"https://ubuntu.com/security/notices/USN-7696-1"
]
},
"related_cves": [
{
"value": "CVE-2025-5318",
"evidence": "/upstream"
}
],
"security_relevant": true,
"severity_evidence": "/severity/1/score"
},
"source_id": "core-osv",
"document_id": 460169,
"published_at": "2025-06-24T14:15:00+00:00"
}