Vulnerability · Published Jun 28, 2026 · Assigned by VulnCheck
CVE-2026-58051libssh2 - Free of Uninitialized Pointer in publickey List Cleanup
Medium 6.5
In plain English
A medium-severity security flaw in libssh2 from libssh2. Proof-of-concept exploit code is public. The chance it is exploited in the next 30 days is estimated at 0.3% (higher than 20% of all known vulnerabilities). Fixed versions are available - upgrade the affected package.
Official description
libssh2 through 1.11.1 grows its publickey list with SSH2_REALLOC but does not zero-initialize new entries before parsing populates them, so a parse failure reaching the cleanup path leaves libssh2_publickey_list_free operating on an uninitialized entry. A malicious SSH server offering the publickey subsystem can use a malformed response to make cleanup free an uninitialized, attacker-influenceable attrs pointer in a connecting libssh2 client.
Affected packages & fixed versions
| Ecosystem | Package | Fixed in | Advisory |
|---|---|---|---|
| Alpine:v3.21 | libssh2 | 1.11.1-r3 | ALPINE-CVE-2026-58051 |
| Alpine:v3.22 | libssh2 | 1.11.1-r3 | ALPINE-CVE-2026-58051 |
| Alpine:v3.23 | libssh2 | 1.11.1-r4 | ALPINE-CVE-2026-58051 |
| Alpine:v3.24 | libssh2 | 1.11.1-r4 | ALPINE-CVE-2026-58051 |
| Debian:12 | libssh2 | 1.10.0-3+deb12u1 | DEBIAN-CVE-2026-58051 |
| Debian:13 | libssh2 | 1.11.1-1+deb13u2 | DEBIAN-CVE-2026-58051 |
| Debian:14 | libssh2 | 1.11.1-6 | DEBIAN-CVE-2026-58051 |
| Ubuntu:22.04:LTS | libssh2 | 1.10.0-3ubuntu0.1 | UBUNTU-CVE-2026-58051 |
| Ubuntu:22.04:LTS | libssh2 | 1.10.0-3ubuntu0.1 | USN-8799-1 |
| Ubuntu:24.04:LTS | libssh2 | 1.11.0-4.1ubuntu0.24.04.3 | UBUNTU-CVE-2026-58051 |
| Ubuntu:24.04:LTS | libssh2 | 1.11.0-4.1ubuntu0.24.04.3 | USN-8532-1 |
| Ubuntu:25.10 | libssh2 | no fix listed | UBUNTU-CVE-2026-58051 |
| Ubuntu:26.04:LTS | libssh2 | 1.11.1-1ubuntu0.26.04.3 | UBUNTU-CVE-2026-58051 |
| Ubuntu:26.04:LTS | libssh2 | 1.11.1-1ubuntu0.26.04.3 | USN-8532-1 |
Affected products (as reported)
Weakness: CWE-908 · Vector: CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:N/I:L/A:H
References
- Proof of Concept exploit, third-party-advisory
- src/publickey.c product
- VulnCheck Advisory: libssh2 - Free of Uninitialized Pointer in publickey List Cleanup third-party-advisory