CVE-2025-5987
Libssh: invalid return code for chacha20 poly1305 with openssl backend
8.1CVSSHIGH
Description
A flaw was found in libssh when using the ChaCha20 cipher with the OpenSSL library. If an attacker manages to exhaust the heap space, this error is not detected and may lead to libssh using a partially initialized cipher context. This occurs because the OpenSSL error code returned aliases with the SSH_OK code, resulting in libssh not properly detecting the error returned by the OpenSSL library. This issue can lead to undefined behavior, including compromised data confidentiality and integrity or crashes.
CVSS Vector Breakdown
Exploitability
AV:NAttack VectorNetwork
AC:HAttack ComplexityHigh
PR:NPrivileges RequiredNone
UI:NUser InteractionNone
Scope
S:UScopeUnchanged
Impact
C:HConfidentialityHigh
I:HIntegrityHigh
A:HAvailabilityHigh
Weaknesses
Affected Products
and 27 more affected products View all →
Exploitability
Official Patch Available
References
https://access.redhat.com/errata/RHSA-2025:23483
access.redhat.com
https://access.redhat.com/errata/RHSA-2025:23484
access.redhat.com
https://access.redhat.com/errata/RHSA-2026:0427
access.redhat.com
and 26 more references View all →
Timeline
Published
Jul 7, 2025
Last Updated
Mar 5, 2026
Unlock Complete Vulnerability Intelligence
Get the full picture for CVE-2025-5987 and every CVE in our database. Create a free account — no credit card required.
Create Free AccountPlain-language analysis
Impact assessment and exploitation scenario in plain English
Attack graph visualization
Interactive attack path and kill chain mapping
Exploit details & PoC links
ExploitDB, Metasploit, GitHub PoCs with direct links
Nuclei scanner templates
Ready-to-use vulnerability scanner templates
Full remediation guide
Patch instructions, workarounds, and compliance impact
Interactive AI chat
Ask questions about this vulnerability in natural language
Related vulnerabilities
Semantically similar CVEs and attack patterns
REST API & MCP access
Integrate vulnerability data into your workflows