Skip to main content
DashboardThreatsMapFeedsAPI
reconnecting
Press slash or control plus K to focus the search. Use the arrow keys to navigate results and press enter to open a threat.
Reconnecting to live updates…

CVE-2025-5987: Return of Wrong Status Code

0
Medium
VulnerabilityCVE-2025-5987cvecve-2025-5987
Published: Mon Jul 07 2025 (07/07/2025, 14:24:12 UTC)
Source: CVE Database V5
Vendor/Project: Red Hat
Product: Red Hat Enterprise Linux 10

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

AILast updated: 09/26/2025, 00:40:19 UTC

Technical Analysis

CVE-2025-5987 is a medium-severity vulnerability identified in libssh version 0.10.0, specifically when using the ChaCha20 cipher in conjunction with the OpenSSL library. The flaw arises from improper error handling during heap exhaustion scenarios. When an attacker exhausts heap space, libssh fails to detect this condition properly because the OpenSSL error codes returned alias with the SSH_OK code. This causes libssh to mistakenly treat an error as a successful operation and proceed with a partially initialized cipher context. The consequence of this flawed error detection is undefined behavior, which can manifest as compromised data confidentiality and integrity or application crashes. The vulnerability is network exploitable (AV:N), requires high attack complexity (AC:H), low privileges (PR:L), and no user interaction (UI:N). The scope is unchanged (S:U), and the impact affects confidentiality, integrity, and availability to a low degree (C:L/I:L/A:L). This vulnerability affects Red Hat Enterprise Linux 10, which bundles libssh 0.10.0. No known exploits are currently in the wild, and no patches are explicitly linked in the provided data, indicating that mitigation may require vendor updates or configuration changes. The root cause is a subtle error code aliasing issue between OpenSSL and libssh, leading to improper error detection and subsequent use of insecure cipher contexts.

Potential Impact

For European organizations, this vulnerability poses a moderate risk primarily to systems running Red Hat Enterprise Linux 10 with libssh 0.10.0, especially those using SSH services with the ChaCha20 cipher enabled. The compromised cipher context could lead to partial exposure or corruption of sensitive data transmitted over SSH, undermining confidentiality and integrity. Additionally, the potential for crashes could disrupt availability of critical services relying on SSH for remote management or automated processes. While exploitation complexity is high and privileges required are low, the lack of user interaction needed means that automated or scripted attacks could be feasible once the heap exhaustion condition is met. Organizations in sectors such as finance, government, and critical infrastructure that rely heavily on secure SSH communications could face operational disruptions or data breaches if this vulnerability is exploited. However, the medium CVSS score and absence of known exploits suggest the threat is not immediate but warrants proactive mitigation.

Mitigation Recommendations

To mitigate CVE-2025-5987, European organizations should prioritize updating libssh to a patched version once available from Red Hat or the upstream project. In the interim, administrators should consider disabling the ChaCha20 cipher in SSH configurations to avoid triggering the vulnerable code path. Monitoring system logs for unusual heap exhaustion or SSH errors can help detect attempted exploitation. Employing resource limits to prevent heap exhaustion attacks and using intrusion detection systems tuned for anomalous SSH behavior can provide additional layers of defense. Furthermore, organizations should audit their SSH usage to ensure minimal exposure of vulnerable services, restrict SSH access via network segmentation and firewall rules, and enforce strict privilege controls to limit the impact of potential exploitation. Regular vulnerability scanning and penetration testing focused on SSH implementations can help identify residual risks.

Need more detailed analysis?Get Pro

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: 9/26/2025, 12:40:19 AM

Last updated: 10/6/2025, 4:24:51 PM

Views: 42

Community Reviews

0 reviews

Crowdsource mitigation strategies, share intel context, and vote on the most helpful responses. Sign in to add your voice and help keep defenders ahead.

Sort by
Loading community insights…

Want to contribute mitigation steps or threat intel context? Sign in or create an account to join the community discussion.

Actions

PRO

Updates to AI analysis are available only with a Pro account. Contact root@offseq.com for access.

Please log in to the Console to use AI analysis features.

Need enhanced features?

Contact root@offseq.com for Pro access with improved analysis and higher rate limits.

Latest Threats