# CVE-2026-58050: libssh2 heap buffer overflow in publickey-subsystem attribute allocation

Source: https://junglewise.ai/threats/cve-2026-58050-libssh2-heap-buffer-overflow-in-publickey-subsystem-attribute  
Publisher: Junglewise Threat Intelligence, https://junglewise.ai/threats  
Published: 2026-06-28. Updated: 2026-06-28  
License: CC BY 4.0 with a link back

CVE-2026-58050 · Severity: high · CVSS 7 · Published 2026-06-28

libssh2 is a widely used software library that allows applications to communicate securely using the SSH protocol. A security flaw in certain versions allows a malicious server to crash or potentially take control of a client application when it attempts to connect. This could lead to service disruptions or unauthorized access to data on the system using the library.

Technologies: [Libssh2](https://junglewise.ai/threats/technologies/libssh2). Vendors: [Libssh2](https://junglewise.ai/threats/vendors/libssh2).

## Quick answers

**Is CVE-2026-58050 exploited in the wild?** No. Junglewise Threat Intelligence has no report of CVE-2026-58050 being exploited in the wild.

**How severe is CVE-2026-58050?** High severity, with a CVSS score of 7, published 28 June 2026.

**Which products and versions are affected?** Libssh2 through 1.11.1.

**Is there a fix for CVE-2026-58050?** No fixed version is recorded yet. Check the vendor's advisory in the references below. If you run it, Junglewise drafts a mitigation that fits your setup and applies it once you approve, with senior security engineers behind it.

**How is CVE-2026-58050 attacked?** It is attacked over the network, in a software library.

**Am I affected by CVE-2026-58050?** Check whether you run Libssh2 at an affected version. Junglewise does that check for you around the clock: connect your code, cloud and domains, and it matches new vulnerabilities like this one against what you actually run and tells you when one reaches you.

## Technical details

A vulnerability exists in libssh2 through version 1.11.1 where the publickey-subsystem response processing fails to perform bounds checking on an attacker-controlled 32-bit attribute count. On 32-bit platforms, the calculation 'num_attrs * sizeof(libssh2_publickey_attribute)' can result in an integer overflow, leading to an undersized heap buffer allocation. A malicious SSH server can then provide more attributes than the buffer can hold, resulting in a heap buffer overflow. This attack requires a client to connect to a compromised or malicious SSH server. While the CVSS score is 7.0, some assessments suggest a higher severity of 8.3 (CVSS 4.0).

## Affected products

- libssh2 libssh2 through 1.11.1

## Timeline

- 2026-06-27: disclosed: Initial disclosure by VulnCheck
- 2026-06-28: advisory: NVD publication date

## References

- [https://github.com/bikini/exploitarium/tree/main/libssh2-publickey-list-calc-poc](https://github.com/bikini/exploitarium/tree/main/libssh2-publickey-list-calc-poc)
- [https://github.com/libssh2/libssh2/blob/master/src/publickey.c](https://github.com/libssh2/libssh2/blob/master/src/publickey.c)
- [https://www.vulncheck.com/advisories/libssh2-integer-overflow-in-publickey-subsystem-attribute-allocation](https://www.vulncheck.com/advisories/libssh2-integer-overflow-in-publickey-subsystem-attribute-allocation)

## Related threats

- [libssh2 heap buffer overflow in transport layer during EtM negotiation](https://junglewise.ai/threats/cve-2026-66035-libssh2-heap-buffer-overflow-in-transport-layer-during-etm)
- [libssh2 heap out-of-bounds read in publickey_list_fetch](https://junglewise.ai/threats/cve-2026-66034-libssh2-heap-out-of-bounds-read-in-publickey-list-fetch)
- [libssh2 integer underflow in ssh2_cipher_crypt](https://junglewise.ai/threats/cve-2026-66033-libssh2-integer-underflow-in-ssh2-cipher-crypt)
- [libssh2 double free in sftp_open](https://junglewise.ai/threats/cve-2026-66032-libssh2-double-free-in-sftp-open)
- [libssh2 uninitialized pointer free in publickey list cleanup](https://junglewise.ai/threats/cve-2026-58051-libssh2-uninitialized-pointer-free-in-publickey-list-cleanup)
