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 library. The root cause is a flaw in error handling: when an attacker manages to exhaust heap memory, libssh fails to detect this error correctly because OpenSSL returns an error code that aliases with SSH_OK. Consequently, libssh proceeds with a partially initialized cipher context. This improper initialization can lead to undefined behavior, including potential compromise of data confidentiality and integrity or application crashes. The vulnerability is exploitable remotely over the network without user interaction but requires low privileges and has a high attack complexity, meaning exploitation is non-trivial but possible. The affected product is Red Hat Enterprise Linux 10, which bundles libssh 0.10.0. The CVSS v3.1 base score is 5.0 (medium severity), reflecting limited confidentiality, integrity, and availability impacts, combined with the complexity of exploitation. No known public exploits exist yet, but the flaw could be leveraged in targeted attacks to disrupt SSH communications or leak sensitive data. The issue stems from a subtle error code aliasing problem between OpenSSL and libssh, highlighting the importance of rigorous error handling in cryptographic libraries.
Potential Impact
For European organizations, this vulnerability poses a risk primarily to systems running Red Hat Enterprise Linux 10 with libssh 0.10.0 using the ChaCha20 cipher. Potential impacts include unauthorized disclosure of sensitive data due to compromised confidentiality, data tampering from integrity violations, and service disruptions caused by crashes. This could affect critical infrastructure, financial institutions, government agencies, and enterprises relying on secure SSH communications for remote management and automation. Although exploitation complexity is high and privileges required are low, the lack of user interaction needed makes it feasible for remote attackers to attempt exploitation. The medium severity rating suggests moderate risk, but the potential for undefined behavior in cryptographic operations warrants prompt attention. Organizations with automated SSH-based workflows or those exposed to untrusted networks are particularly vulnerable. Failure to address this flaw could lead to breaches or operational outages impacting business continuity and regulatory compliance under GDPR and other frameworks.
Mitigation Recommendations
Organizations should immediately verify if their systems run libssh version 0.10.0 with ChaCha20 cipher enabled and update to a patched version once available from Red Hat or the libssh project. In the interim, consider disabling the ChaCha20 cipher in SSH configurations to prevent triggering the vulnerable code path. Implement strict resource limits and monitoring to detect and prevent heap exhaustion attempts. Employ network-level protections such as firewalls and intrusion detection systems to restrict access to SSH services from untrusted sources. Conduct thorough code audits and testing of cryptographic error handling in custom or third-party software relying on libssh. Maintain up-to-date system and security patches, and monitor vendor advisories for updates. Additionally, review SSH usage policies and enforce multi-factor authentication to reduce risk from compromised credentials. Logging and anomaly detection should be enhanced to identify unusual SSH session behaviors indicative of exploitation attempts.
Affected Countries
Germany, France, United Kingdom, Netherlands, Italy, Spain, Poland, Sweden, Belgium, Finland
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 library. The root cause is a flaw in error handling: when an attacker manages to exhaust heap memory, libssh fails to detect this error correctly because OpenSSL returns an error code that aliases with SSH_OK. Consequently, libssh proceeds with a partially initialized cipher context. This improper initialization can lead to undefined behavior, including potential compromise of data confidentiality and integrity or application crashes. The vulnerability is exploitable remotely over the network without user interaction but requires low privileges and has a high attack complexity, meaning exploitation is non-trivial but possible. The affected product is Red Hat Enterprise Linux 10, which bundles libssh 0.10.0. The CVSS v3.1 base score is 5.0 (medium severity), reflecting limited confidentiality, integrity, and availability impacts, combined with the complexity of exploitation. No known public exploits exist yet, but the flaw could be leveraged in targeted attacks to disrupt SSH communications or leak sensitive data. The issue stems from a subtle error code aliasing problem between OpenSSL and libssh, highlighting the importance of rigorous error handling in cryptographic libraries.
Potential Impact
For European organizations, this vulnerability poses a risk primarily to systems running Red Hat Enterprise Linux 10 with libssh 0.10.0 using the ChaCha20 cipher. Potential impacts include unauthorized disclosure of sensitive data due to compromised confidentiality, data tampering from integrity violations, and service disruptions caused by crashes. This could affect critical infrastructure, financial institutions, government agencies, and enterprises relying on secure SSH communications for remote management and automation. Although exploitation complexity is high and privileges required are low, the lack of user interaction needed makes it feasible for remote attackers to attempt exploitation. The medium severity rating suggests moderate risk, but the potential for undefined behavior in cryptographic operations warrants prompt attention. Organizations with automated SSH-based workflows or those exposed to untrusted networks are particularly vulnerable. Failure to address this flaw could lead to breaches or operational outages impacting business continuity and regulatory compliance under GDPR and other frameworks.
Mitigation Recommendations
Organizations should immediately verify if their systems run libssh version 0.10.0 with ChaCha20 cipher enabled and update to a patched version once available from Red Hat or the libssh project. In the interim, consider disabling the ChaCha20 cipher in SSH configurations to prevent triggering the vulnerable code path. Implement strict resource limits and monitoring to detect and prevent heap exhaustion attempts. Employ network-level protections such as firewalls and intrusion detection systems to restrict access to SSH services from untrusted sources. Conduct thorough code audits and testing of cryptographic error handling in custom or third-party software relying on libssh. Maintain up-to-date system and security patches, and monitor vendor advisories for updates. Additionally, review SSH usage policies and enforce multi-factor authentication to reduce risk from compromised credentials. Logging and anomaly detection should be enhanced to identify unusual SSH session behaviors indicative of exploitation attempts.
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: 12/23/2025, 4:31:59 AM
Last updated: 1/7/2026, 8:46:14 AM
Views: 86
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-15158: CWE-434 Unrestricted Upload of File with Dangerous Type in eastsidecode WP Enable WebP
HighCVE-2025-15018: CWE-639 Authorization Bypass Through User-Controlled Key in djanym Optional Email
CriticalCVE-2025-15000: CWE-79 Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting') in tfrommen Page Keys
MediumCVE-2025-14999: CWE-352 Cross-Site Request Forgery (CSRF) in kentothemes Latest Tabs
MediumCVE-2025-13531: CWE-79 Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting') in hayyatapps Stylish Order Form Builder
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.