# CVE-2026-59842: libssh out-of-bounds read in GSSAPI Curve25519 key exchange

Source: https://junglewise.ai/threats/cve-2026-59842-libssh-out-of-bounds-read-in-gssapi-curve25519-key-exchange  
Publisher: Junglewise Threat Intelligence, https://junglewise.ai/threats  
Published: 2026-07-21. Updated: 2026-07-21  
License: CC BY 4.0 with a link back

CVE-2026-59842 · Severity: low · CVSS 3.7 · Published 2026-07-21

A security flaw exists in libssh, a library used by applications to provide secure communication over the SSH protocol. During the initial connection process, a remote attacker could send a specially crafted security key that is shorter than expected, causing the server to read more data than intended from its own memory. While this does not allow for full system takeover, it could result in the exposure of small amounts of sensitive information from the server's memory to an unauthorized user.

Technologies: [Libssh](https://junglewise.ai/threats/technologies/libssh). Vendors: [Libssh](https://junglewise.ai/threats/vendors/libssh).

## Quick answers

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

**How severe is CVE-2026-59842?** Low severity, with a CVSS score of 3.7, published 21 July 2026.

**Which products and versions are affected?** Libssh unspecified.

**Is there a fix for CVE-2026-59842?** 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-59842 attacked?** It is attacked over the network, in a software library.

**Am I affected by CVE-2026-59842?** Check whether you run Libssh 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 flaw was found in libssh within the server-side GSSAPI Curve25519 key exchange path in src/kex-gss.c. Specifically, in the ssh_server_gss_kex_process_init() function, a client-supplied SSH string is unpacked into client_pubkey and subsequently copied using memcpy() with a fixed CURVE25519_PUBKEY_SIZE without validating the actual length of the input string. A remote, unauthenticated attacker can exploit this by sending a short public key in an SSH_MSG_KEXGSS_INIT message, triggering an out-of-bounds heap read. This vulnerability allows for the disclosure of small amounts of adjacent server memory during the handshake process.

## Affected products

- libssh libssh unspecified
- Red Hat Red Hat Enterprise Linux 10 affected
- Red Hat Red Hat Hardened Images affected

## Timeline

- 2026-07-08: disclosed: Initial report in Red Hat Bugzilla
- 2026-07-21: advisory: NVD publication date

## References

- [https://access.redhat.com/downloads/content/package-browser/](https://access.redhat.com/downloads/content/package-browser/)
- [https://access.redhat.com/security/cve/CVE-2026-59842](https://access.redhat.com/security/cve/CVE-2026-59842)
- [https://bugzilla.redhat.com/show_bug.cgi?id=2498168](https://bugzilla.redhat.com/show_bug.cgi?id=2498168)

## Related threats

- [libssh authentication bypass in GSSAPIKeyExchange](https://junglewise.ai/threats/cve-2026-59851-libssh-authentication-bypass-in-gssapikeyexchange)
- [libssh use-after-free in channel data callbacks](https://junglewise.ai/threats/cve-2026-59850-libssh-use-after-free-in-channel-data-callbacks)
- [libssh infinite loop in certificate-based authentication](https://junglewise.ai/threats/cve-2026-59849-libssh-infinite-loop-in-certificate-based-authentication)
- [libssh denial of service via memory exhaustion in SFTP client](https://junglewise.ai/threats/cve-2026-59848-libssh-denial-of-service-via-memory-exhaustion-in-sftp-client)
- [libssh integrity protection bypass in OpenSSL AES-GCM backend](https://junglewise.ai/threats/cve-2026-59847-libssh-integrity-protection-bypass-in-openssl-aes-gcm-backend)
