CVE-2025-5987: Return of Wrong Status Code
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.
AI Analysis
Technical Summary
CVE-2025-5987 is a vulnerability discovered in libssh version 0.10.0, specifically when the ChaCha20 cipher is used in conjunction with the OpenSSL cryptographic library. The root cause is a heap exhaustion scenario that leads to libssh failing to detect an error returned by OpenSSL. This happens because the OpenSSL error code returned in this condition aliases with the SSH_OK code, which libssh interprets as a successful operation. Consequently, libssh proceeds to use a cipher context that is only partially initialized. This improper initialization can cause undefined behavior, including potential compromise of data confidentiality and integrity during SSH sessions, or cause the application to crash, impacting availability. The vulnerability has a CVSS 3.1 base score of 8.1, indicating high severity, with an attack vector of network, requiring no privileges or user interaction, but with high attack complexity. The affected product is Red Hat Enterprise Linux 10, which bundles libssh 0.10.0. No public exploits have been reported yet, but the flaw's nature suggests that a remote attacker could exploit it to intercept or manipulate SSH traffic or cause denial of service. The issue stems from a subtle error handling flaw between libssh and OpenSSL, highlighting the importance of robust error code management in cryptographic operations.
Potential Impact
For European organizations, the impact of CVE-2025-5987 can be significant, especially for those relying on Red Hat Enterprise Linux 10 servers for secure remote access and automated SSH-based operations. Confidentiality risks arise from the possibility of attackers exploiting the partially initialized cipher context to decrypt or tamper with SSH session data, potentially exposing sensitive information or credentials. Integrity risks include unauthorized modification of data in transit, which could lead to further compromise or lateral movement within networks. Availability may also be affected if the vulnerability causes crashes or denial of service in critical SSH services, disrupting business operations. Sectors such as finance, government, healthcare, and critical infrastructure in Europe that depend heavily on secure SSH communications are particularly vulnerable. The high attack complexity somewhat limits exploitation but does not eliminate risk, especially from sophisticated threat actors. The absence of known exploits currently provides a window for mitigation before active attacks emerge.
Mitigation Recommendations
European organizations should prioritize updating libssh to a patched version that addresses this vulnerability as soon as it becomes available from Red Hat or upstream sources. Until patches are applied, organizations can mitigate risk by disabling the ChaCha20 cipher in SSH configurations to prevent triggering the vulnerable code path. Network-level controls such as restricting SSH access to trusted IP ranges and implementing multi-factor authentication can reduce exposure. Monitoring SSH logs for unusual connection patterns or errors related to cipher initialization may help detect attempted exploitation. Additionally, organizations should audit their Red Hat Enterprise Linux 10 deployments to identify all systems running the affected libssh version and ensure they are included in patch management workflows. Engaging with Red Hat support for guidance and applying any vendor-provided workarounds is recommended. Finally, maintaining robust incident response plans for potential SSH compromise scenarios will help minimize impact if exploitation occurs.
Affected Countries
Germany, France, United Kingdom, Netherlands, Italy, Spain, Poland, Sweden, Belgium, Austria
CVE-2025-5987: Return of Wrong Status Code
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.
AI-Powered Analysis
Technical Analysis
CVE-2025-5987 is a vulnerability discovered in libssh version 0.10.0, specifically when the ChaCha20 cipher is used in conjunction with the OpenSSL cryptographic library. The root cause is a heap exhaustion scenario that leads to libssh failing to detect an error returned by OpenSSL. This happens because the OpenSSL error code returned in this condition aliases with the SSH_OK code, which libssh interprets as a successful operation. Consequently, libssh proceeds to use a cipher context that is only partially initialized. This improper initialization can cause undefined behavior, including potential compromise of data confidentiality and integrity during SSH sessions, or cause the application to crash, impacting availability. The vulnerability has a CVSS 3.1 base score of 8.1, indicating high severity, with an attack vector of network, requiring no privileges or user interaction, but with high attack complexity. The affected product is Red Hat Enterprise Linux 10, which bundles libssh 0.10.0. No public exploits have been reported yet, but the flaw's nature suggests that a remote attacker could exploit it to intercept or manipulate SSH traffic or cause denial of service. The issue stems from a subtle error handling flaw between libssh and OpenSSL, highlighting the importance of robust error code management in cryptographic operations.
Potential Impact
For European organizations, the impact of CVE-2025-5987 can be significant, especially for those relying on Red Hat Enterprise Linux 10 servers for secure remote access and automated SSH-based operations. Confidentiality risks arise from the possibility of attackers exploiting the partially initialized cipher context to decrypt or tamper with SSH session data, potentially exposing sensitive information or credentials. Integrity risks include unauthorized modification of data in transit, which could lead to further compromise or lateral movement within networks. Availability may also be affected if the vulnerability causes crashes or denial of service in critical SSH services, disrupting business operations. Sectors such as finance, government, healthcare, and critical infrastructure in Europe that depend heavily on secure SSH communications are particularly vulnerable. The high attack complexity somewhat limits exploitation but does not eliminate risk, especially from sophisticated threat actors. The absence of known exploits currently provides a window for mitigation before active attacks emerge.
Mitigation Recommendations
European organizations should prioritize updating libssh to a patched version that addresses this vulnerability as soon as it becomes available from Red Hat or upstream sources. Until patches are applied, organizations can mitigate risk by disabling the ChaCha20 cipher in SSH configurations to prevent triggering the vulnerable code path. Network-level controls such as restricting SSH access to trusted IP ranges and implementing multi-factor authentication can reduce exposure. Monitoring SSH logs for unusual connection patterns or errors related to cipher initialization may help detect attempted exploitation. Additionally, organizations should audit their Red Hat Enterprise Linux 10 deployments to identify all systems running the affected libssh version and ensure they are included in patch management workflows. Engaging with Red Hat support for guidance and applying any vendor-provided workarounds is recommended. Finally, maintaining robust incident response plans for potential SSH compromise scenarios will help minimize impact if exploitation occurs.
Technical Details
- Data Version
- 5.1
- Assigner Short Name
- redhat
- Date Reserved
- 2025-06-10T21:55:45.552Z
- Cvss Version
- 3.1
- State
- PUBLISHED
Threat ID: 686bdc1a6f40f0eb72e9f8ac
Added to database: 7/7/2025, 2:39:22 PM
Last enriched: 1/8/2026, 4:34:09 AM
Last updated: 1/9/2026, 4:03:55 AM
Views: 88
Community Reviews
0 reviewsCrowdsource mitigation strategies, share intel context, and vote on the most helpful responses. Sign in to add your voice and help keep defenders ahead.
Want to contribute mitigation steps or threat intel context? Sign in or create an account to join the community discussion.
Related Threats
CVE-2025-66315: CWE-269 Improper Privilege Management in ZTE MF258K
MediumCVE-2026-22714: CWE-79 Improper Neutralization of Input During Web Page Generation (XSS or 'Cross-site Scripting') in The Wikimedia Foundation Mediawiki - Monaco Skin
LowCVE-2026-22710: CWE-79 Improper Neutralization of Input During Web Page Generation (XSS or 'Cross-site Scripting') in The Wikimedia Foundation Mediawiki - Wikibase Extension
LowCVE-2026-0733: SQL Injection in PHPGurukul Online Course Registration System
MediumCVE-2026-0732: Command Injection in D-Link DI-8200G
MediumActions
Updates to AI analysis require Pro Console access. Upgrade inside Console → Billing.
Need more coverage?
Upgrade to Pro Console in Console -> Billing for AI refresh and higher limits.
For incident response and remediation, OffSeq services can help resolve threats faster.