# CVE-2026-0967: libssh ReDoS in match_pattern function

Source: https://junglewise.ai/threats/cve-2026-0967-libssh-redos-in-match-pattern-function  
Publisher: Junglewise Threat Intelligence, https://junglewise.ai/threats  
Published: 2026-03-26. Updated: 2026-05-19  
License: CC BY 4.0 with a link back

CVE-2026-0967 · Severity: medium · CVSS 5.5 · Published 2026-03-26

libssh is a widely used library that allows applications to communicate securely using the SSH protocol. A vulnerability was found where an attacker who can control a user's configuration or 'known_hosts' files can cause the application to freeze or crash. This results in a denial of service, preventing the user from establishing secure connections.

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

## Quick answers

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

**How severe is CVE-2026-0967?** Medium severity, with a CVSS score of 5.5, published 26 March 2026.

**Which products and versions are affected?** Libssh up to 0.11.3, up to 0.12.0-rc1.

**Is there a fix for CVE-2026-0967?** A patch was published on 2026-02-10: libssh versions 0.11.4 and 0.12.0 released Junglewise finds every place you run it, drafts the upgrade and applies it once you approve.

**How is CVE-2026-0967 attacked?** It is attacked with local access, in a software library.

**Am I affected by CVE-2026-0967?** 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 exists in the `match_pattern()` function of libssh, which is used to process conditionals in client configuration files or known_hosts files. The vulnerability is a result of inefficient regular expression backtracking (CWE-1333). An attacker who can influence these configuration files can craft specific hostnames that trigger catastrophic backtracking during pattern matching. This leads to CPU exhaustion and timeouts, resulting in a Denial of Service (DoS) for the client application. The issue is fixed in libssh versions 0.11.4 and 0.12.0.

## Affected products

- libssh libssh up to 0.11.3, up to 0.12.0-rc1
- Red Hat Enterprise Linux 9.0
- Red Hat Enterprise Linux 10.0

## Timeline

- 2026-02-04: disclosed: Reported to Red Hat Bugzilla
- 2026-02-10: patched: libssh versions 0.11.4 and 0.12.0 released
- 2026-03-26: advisory: NVD publication date
- 2026-05-19: patched: Red Hat Enterprise Linux 10 security update (RHSA-2026:18160) released

## References

- [https://access.redhat.com/errata/RHSA-2026:18160](https://access.redhat.com/errata/RHSA-2026:18160)
- [https://access.redhat.com/security/cve/CVE-2026-0967](https://access.redhat.com/security/cve/CVE-2026-0967)
- [https://bugzilla.redhat.com/show_bug.cgi?id=2436981](https://bugzilla.redhat.com/show_bug.cgi?id=2436981)
- [https://www.libssh.org/2026/02/10/libssh-0-12-0-and-0-11-4-security-releases/](https://www.libssh.org/2026/02/10/libssh-0-12-0-and-0-11-4-security-releases/)

## 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)
