# CVE-2026-59849: libssh infinite loop in certificate-based authentication

Source: https://junglewise.ai/threats/cve-2026-59849-libssh-infinite-loop-in-certificate-based-authentication  
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-59849 · Severity: low · CVSS 3.1 · Published 2026-07-21

A flaw in the libssh library, which is used to provide secure communication between computers, can cause applications to stop responding. When a client attempts to connect using certain certificate settings, a logic error can cause the software to enter an infinite loop if the certificates are missing or rejected. This results in a denial of service, preventing the user from establishing a connection.

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

## Quick answers

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

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

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

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

**Am I affected by CVE-2026-59849?** 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 vulnerability exists in the ssh_userauth_publickey_auto() function within src/auth.c of libssh. The issue stems from a logic error where the iterator over certificate candidates is not correctly advanced when certificates are missing or repeatedly rejected by the server. Under specific non-default certificate configurations, this causes the client to restart the same authentication attempts indefinitely (CWE-835). An attacker or a misconfigured server could trigger this infinite loop, resulting in a denial of service for the libssh client. The vulnerability requires a network-reachable client and specific authentication preconditions.

## Affected products

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

## Timeline

- 2026-07-08: other: Reported to Red Hat Bugzilla
- 2026-07-21: disclosed: CVE published to NVD

## 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-59849](https://access.redhat.com/security/cve/CVE-2026-59849)
- [https://bugzilla.redhat.com/show_bug.cgi?id=2498182](https://bugzilla.redhat.com/show_bug.cgi?id=2498182)

## 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 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)
- [libssh shell metacharacter injection in ProxyCommand username expansion](https://junglewise.ai/threats/cve-2026-59846-libssh-shell-metacharacter-injection-in-proxycommand-username)
