CVE-2025-5987
Linux Debian vulnerability analysis and mitigation

Overview

CVE-2025-5987 is a security vulnerability affecting libssh versions 0.10.0 and later when built with OpenSSL. The vulnerability was discovered in June 2025 and involves an invalid return code handling in the OpenSSL-based implementation of the chacha20poly1305set_key() function. This vulnerability affects multiple Linux distributions including Debian, Ubuntu, and their derivatives (LibSSH Advisory).

Technical details

The vulnerability stems from a mismatch between OpenSSL and libssh return value meanings, where OpenSSL's error code (rv=0) aliases with SSHOK (0) and is returned directly from the chacha20poly1305setkey() function. When an error occurs during ChaCha20 cipher initialization with OpenSSL, particularly during heap exhaustion, an invalid error code is returned. This error is not properly detected, potentially allowing libssh to operate with a partially initialized cipher context. The vulnerability has been assigned a CVSS v3.1 score of 4.5 (CVSS:3.1/AV:N/AC:H/PR:L/UI:N/S:U/C:L/I:L/A:L/E:P/RL:O/RC:C) (LibSSH Advisory, Rapid7).

Impact

The vulnerability can lead to the use of partially initialized cipher contexts, potentially compromising the security of encrypted communications. The impact is characterized by low confidentiality, integrity, and availability risks, but requires network access and high attack complexity to exploit (LibSSH Advisory).

Mitigation and workarounds

A fix has been released in libssh version 0.11.2. As a temporary workaround, administrators can disable the chacha20-poly1305@openssh.com cipher when libssh is compiled with the OpenSSL backend. SSH administrators are strongly advised to upgrade to the latest release or apply the available security patches (LibSSH Advisory).

Additional resources


SourceThis report was generated using AI

Free Vulnerability Assessment

Benchmark your Cloud Security Posture

Evaluate your cloud security practices across 9 security domains to benchmark your risk level and identify gaps in your defenses.

Request assessment

Get a personalized demo

Ready to see Wiz in action?

"Best User Experience I have ever seen, provides full visibility to cloud workloads."
David EstlickCISO
"Wiz provides a single pane of glass to see what is going on in our cloud environments."
Adam FletcherChief Security Officer
"We know that if Wiz identifies something as critical, it actually is."
Greg PoniatowskiHead of Threat and Vulnerability Management