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 configured to use the ChaCha20 cipher in conjunction with the OpenSSL library. The root cause is an error handling flaw: when heap space is exhausted, OpenSSL returns an error code that aliases with SSH_OK, the code indicating success. Libssh fails to detect this error condition properly and proceeds to use a partially initialized cipher context. This improper initialization can lead to undefined behavior including potential compromise of data confidentiality and integrity, or cause application crashes. The vulnerability requires an attacker to induce heap exhaustion, which is a non-trivial but feasible attack vector, and only low privileges are needed to exploit it. No user interaction is required, and the attack can be performed remotely over the network (AV:N). The CVSS v3.1 score is 5.0 (medium severity), reflecting the moderate impact on confidentiality, integrity, and availability, combined with the complexity of exploitation. The affected product is Red Hat Enterprise Linux 10, a widely used enterprise-grade Linux distribution, particularly in server environments. No patches were linked at the time of disclosure, and no known exploits have been reported in the wild. The vulnerability highlights the importance of robust error handling in cryptographic libraries, especially when integrating third-party components like OpenSSL.
Potential Impact
For European organizations, this vulnerability could undermine the security of SSH communications, a critical protocol for remote management and secure data transfer. Compromise of confidentiality and integrity could lead to unauthorized data disclosure or manipulation, potentially affecting sensitive business operations and regulatory compliance (e.g., GDPR). The possibility of application crashes could disrupt services, impacting availability. Organizations relying on Red Hat Enterprise Linux 10 servers for critical infrastructure, cloud services, or internal operations may face increased risk. Although exploitation requires inducing heap exhaustion, which may limit attack feasibility, targeted attacks by skilled adversaries remain a concern. The lack of known exploits currently reduces immediate risk but does not eliminate the threat. Given the widespread use of SSH in European IT environments, the vulnerability could have broad implications if exploited at scale.
Mitigation Recommendations
Organizations should monitor Red Hat and libssh security advisories closely and apply patches promptly once available. In the interim, consider disabling the ChaCha20 cipher in libssh configurations if feasible, to avoid triggering the vulnerable code path. Implement resource limits and monitoring to detect and prevent heap exhaustion conditions. Employ network-level protections such as firewalls and intrusion detection systems to limit exposure of SSH services to untrusted networks. Conduct regular audits of SSH configurations and usage to ensure adherence to best practices. Additionally, consider deploying application-layer monitoring to detect unusual SSH behavior or crashes indicative of exploitation attempts. Engage with vendors for timely updates and validate that OpenSSL and libssh libraries are updated to versions that address this flaw.
Affected Countries
Germany, France, United Kingdom, Netherlands, Italy, Spain, Poland, Sweden
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 configured to use the ChaCha20 cipher in conjunction with the OpenSSL library. The root cause is an error handling flaw: when heap space is exhausted, OpenSSL returns an error code that aliases with SSH_OK, the code indicating success. Libssh fails to detect this error condition properly and proceeds to use a partially initialized cipher context. This improper initialization can lead to undefined behavior including potential compromise of data confidentiality and integrity, or cause application crashes. The vulnerability requires an attacker to induce heap exhaustion, which is a non-trivial but feasible attack vector, and only low privileges are needed to exploit it. No user interaction is required, and the attack can be performed remotely over the network (AV:N). The CVSS v3.1 score is 5.0 (medium severity), reflecting the moderate impact on confidentiality, integrity, and availability, combined with the complexity of exploitation. The affected product is Red Hat Enterprise Linux 10, a widely used enterprise-grade Linux distribution, particularly in server environments. No patches were linked at the time of disclosure, and no known exploits have been reported in the wild. The vulnerability highlights the importance of robust error handling in cryptographic libraries, especially when integrating third-party components like OpenSSL.
Potential Impact
For European organizations, this vulnerability could undermine the security of SSH communications, a critical protocol for remote management and secure data transfer. Compromise of confidentiality and integrity could lead to unauthorized data disclosure or manipulation, potentially affecting sensitive business operations and regulatory compliance (e.g., GDPR). The possibility of application crashes could disrupt services, impacting availability. Organizations relying on Red Hat Enterprise Linux 10 servers for critical infrastructure, cloud services, or internal operations may face increased risk. Although exploitation requires inducing heap exhaustion, which may limit attack feasibility, targeted attacks by skilled adversaries remain a concern. The lack of known exploits currently reduces immediate risk but does not eliminate the threat. Given the widespread use of SSH in European IT environments, the vulnerability could have broad implications if exploited at scale.
Mitigation Recommendations
Organizations should monitor Red Hat and libssh security advisories closely and apply patches promptly once available. In the interim, consider disabling the ChaCha20 cipher in libssh configurations if feasible, to avoid triggering the vulnerable code path. Implement resource limits and monitoring to detect and prevent heap exhaustion conditions. Employ network-level protections such as firewalls and intrusion detection systems to limit exposure of SSH services to untrusted networks. Conduct regular audits of SSH configurations and usage to ensure adherence to best practices. Additionally, consider deploying application-layer monitoring to detect unusual SSH behavior or crashes indicative of exploitation attempts. Engage with vendors for timely updates and validate that OpenSSL and libssh libraries are updated to versions that address this flaw.
Affected Countries
For access to advanced analysis and higher rate limits, contact root@offseq.com
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: 11/20/2025, 9:39:37 PM
Last updated: 11/22/2025, 12:49:08 PM
Views: 62
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-2024-0401: CWE-78 Improper Neutralization of Special Elements used in an OS Command ('OS Command Injection') in ASUS ExpertWiFi
HighCVE-2024-23690: CWE-78 Improper Neutralization of Special Elements used in an OS Command ('OS Command Injection') in Netgear FVS336Gv3
HighCVE-2024-13976: CWE-427 Uncontrolled Search Path Element in Commvault Commvault for Windows
HighCVE-2024-12856: CWE-78 Improper Neutralization of Special Elements used in an OS Command ('OS Command Injection') in Four-Faith F3x24
HighCVE-2025-13526: CWE-200 Exposure of Sensitive Information to an Unauthorized Actor in walterpinem OneClick Chat to Order
HighActions
Updates to AI analysis require Pro Console access. Upgrade inside Console → Billing.
Need enhanced features?
Contact root@offseq.com for Pro access with improved analysis and higher rate limits.