CVE-2025-5987: Return of Wrong Status Code
CVE-2025-5987 is a high-severity vulnerability in libssh when using the ChaCha20 cipher with OpenSSL. It arises from a heap exhaustion condition that causes libssh to misinterpret OpenSSL error codes as success, leading to use of a partially initialized cipher context. This flaw can cause undefined behavior including data confidentiality and integrity compromise or application crashes. The vulnerability affects Red Hat Enterprise Linux 10 with libssh version 0. 10. 0. Exploitation does not require authentication or user interaction but has a high attack complexity. No known exploits are currently in the wild. European organizations relying on affected Red Hat systems are at risk, especially those with critical SSH-based communications. Immediate patching or mitigation is recommended to prevent potential data breaches or service disruptions.
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
CVE-2025-5987 is a high-severity vulnerability in libssh when using the ChaCha20 cipher with OpenSSL. It arises from a heap exhaustion condition that causes libssh to misinterpret OpenSSL error codes as success, leading to use of a partially initialized cipher context. This flaw can cause undefined behavior including data confidentiality and integrity compromise or application crashes. The vulnerability affects Red Hat Enterprise Linux 10 with libssh version 0. 10. 0. Exploitation does not require authentication or user interaction but has a high attack complexity. No known exploits are currently in the wild. European organizations relying on affected Red Hat systems are at risk, especially those with critical SSH-based communications. Immediate patching or mitigation is recommended to prevent potential data breaches or service disruptions.
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/8/2026, 6:57:11 AM
Views: 87
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-2026-0699: SQL Injection in code-projects Intern Membership Management System
MediumCVE-2026-0698: SQL Injection in code-projects Intern Membership Management System
MediumCVE-2026-0697: SQL Injection in code-projects Intern Membership Management System
MediumCVE-2026-22581
LowCVE-2026-22580
LowActions
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.