Libssh2Application

CVE-2026-58051

MEDIUM · 6.5 CVSS v3.1 Published 2026-06-28
Fix available
A fix is available. Upgrade to after 1.11.1 or later.
See remediation →
74/100
Remediation priority · Elevated
Remotely reachable No privileges Zero-click 7 weeks old

Official description Straight from the sourceThe vendor's or NVD's own wording, published unedited. Authoritative, but often terse — it says what broke, rarely what to do.

NVD · unedited
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.

Technical summary Written by usOur analysis, written from the advisory, the CVSS vector and the affected-version data. It adds context the advisory leaves out, and never invents facts that are not in the source.

dbcve analysis · moderate confidence

Memory safety vulnerability in libssh2's publickey list handling where SSH2_REALLOC does not zero-initialize new entries before parsing populates them. If parsing fails, libssh2_publickey_list_free operates on uninitialized entries, causing a use-after-free where cleanup frees an attacker-influenceable attrs pointer.

MitigationUpdate libssh2 to version beyond 1.11.1 when the patch is released. Until then, restrict SSH connections to trusted servers and consider disabling the publickey subsystem if possible.

Verify against the referenced sources before acting — the references below are authoritative for this CVE, this summary is not.

Affected products & versions What the vendor confirmedThe version ranges the vendor confirmed as vulnerable. If your version sits inside a range here, treat yourself as exposed until you have upgraded.

NVD · CPE data
Libssh2Application
Affected:<= 1.11.1

CVSS breakdown How the score is builtThe industry scoring standard. It rates how the flaw is reached, what it takes to exploit, and what an attacker gains — the score is derived from those, not the other way round.

From the vector
Attack vector
Network
Complexity
High
Privileges
None
User interaction
None
Scope
Unchanged
Confidentiality
None
Integrity
Low
Availability
High

CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:N/I:L/A:H

Am I affected? How to checkSteps we derive from the advisory and the affected-version data, so you can decide whether this CVE reaches your setup. They are a guide, not a scan — your own configuration is the authority.

dbcve checks

Work through these to decide whether this CVE applies to you.

  1. Identify installed libssh2 version
    Run `pkg-config --modversion libssh2` on Linux, or check the binary/dylib metadata. On systems with dpkg: `dpkg -l | grep libssh2`. On RPM systems: `rpm -q libssh2`. If built from source, check the version header (typically src/libssh2.h or include/libssh2.h)
    Affected if The installed version is 1.11.1 or any earlier version (1.x series before the patch)
  2. Identify applications using libssh2
    Run `ldconfig -p | grep libssh2` to list binaries linked against libssh2, or use `ldd <binary> | grep libssh2` on specific SSH client binaries that may use the library
    Affected if Any SSH client or application that uses libssh2 for connections is present and actively used
  3. Determine if publickey authentication is in use
    Review SSH client configuration and logs to confirm if publickey-based authentication is enabled or if the remote server uses publickey subsystem. Check application code if using libssh2 directly to see if LIBSSH2_METHOD_KEX or publickey APIs are invoked
    Affected if Connections to untrusted SSH servers occur where publickey authentication or publickey subsystem feature is utilized
  4. Check for active SSH sessions to untrusted servers
    Monitor network connections on port 22, or review SSH connection logs. If using applications that call libssh2_session_init, trace whether publickey-related functions like libssh2_userauth_list or libssh2_publickey_list are being invoked
    Affected if Active or frequent SSH connections to servers that are not fully trusted are being made using libssh2-based software

You are affected if libssh2 version 1.11.1 or earlier is installed AND the software using it makes SSH connections (particularly using publickey authentication or publickey listing features) to servers that could be untrusted or compromised.

Generated from the published advisory. Verify against your own configuration.

Check your environment

Paste your version and any relevant configuration and it will be compared against the affected criteria above. Do not include secrets or credentials.

AI-assisted, checked against the advisory. Informational, not a guarantee.

Remediation Closing itWhat it takes to close this. Where a vendor fix exists we point at it; where none exists we say so plainly, and can build one. Effort estimates are scoped from the advisory, not from your codebase.

dbcve · scoped
Upgrade available Upgrade to a release after 1.11.1
Interim mitigation

Update libssh2 to version beyond 1.11.1 when the patch is released. Until then, restrict SSH connections to trusted servers and consider disabling the publickey subsystem if possible.

Recommended fix Moderate confidence

libssh2 1.11.2 or later (check github.com/libssh2/libssh2/releases for the latest stable release)

  1. 1. Identify the current libssh2 version in use by checking your project's dependencies or running pkg-config --modversion libssh2
  2. 2. Navigate to the official libssh2 GitHub releases page at github.com/libssh2/libssh2/releases
  3. 3. Download the latest stable release (version 1.11.2 or later)
  4. 4. Rebuild your application or library that links against libssh2 with the updated version
  5. 5. Verify the upgrade was successful by confirming the new libssh2 version is loaded
Caveat Review libssh2 changelog between 1.11.1 and the target version for any API changes that may affect your application

Generated from the published advisory — verify against the referenced sources before acting.

Fix this in Libssh2 Scoped from the published advisory
  • Consultation2.0 h
  • Implementation8.0 h
  • Testing6.0 h
  • Review / QA4.0 h
20.0 hours of engineering $3,460
Get the upgrade done

An estimate, not a bill — we confirm scope with you before any work starts. Need it this week? Rush from $5,536.

Scan for this in your stack

Free · runs locally
dbcve dependency scanner

Check whether your project pulls in CVE-2026-58051 — or any other known-vulnerable package — straight from your lock files. Free and open source; it runs locally and uploads nothing.

References Go to the primary sourcePrimary sources — vendor advisories, patches and trackers. Where our summary and a reference disagree, the reference wins.

Primary sources

Practitioner notes

Contributed

Peer-ranked notes from engineers who’ve handled CVE-2026-58051 in production — separate from our analysis above.

No notes yet

Be the first to add a field note for this CVE — a mitigation you’ve verified, a version caveat, or a link to a working fix. Sign in above to contribute.

What this is

A place for practitioners to share what actually worked: a mitigation you’ve tested, a configuration change, a version- or environment-specific caveat, or a link to a verified patch. The most useful notes rise to the top as peers upvote them, so the signal stays high.

What belongs here
  • Verified mitigations, workarounds, and config changes
  • Version or environment caveats, and links to real fixes
  • No weaponised exploit code, or anything meant to cause harm
  • No spam, self-promotion, credentials, or personal data