Skip to main content
EPSS 1.5%top 27%

CVE-2025-5987: Return of Wrong Status Code

0
High
VulnerabilityCVE-2025-5987cvecve-2025-5987
Published: 07/07/2025 (07/07/2025, 14:24:12 UTC)
Source: CVE Database V5

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.

CVSS v3.1

Score 8.1high

Attack Vector
Network
Attack Complexity
High
Privileges Required
None
User Interaction
None
Scope
Unchanged
Confidentiality
High
Integrity
High
Availability
High
CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:H/A:H

Affected software

Affected versions
0.10.0

AI-Powered Analysis

Machine-generated threat intelligence

AILast updated: 07/02/2026, 21:58:32 UTC

Technical Analysis

The vulnerability CVE-2025-5987 in libssh arises from improper handling of OpenSSL error codes when using the ChaCha20 cipher. Specifically, an OpenSSL error code aliases with SSH_OK, causing libssh to fail to detect errors during heap exhaustion scenarios. This leads to libssh using a partially initialized cipher context, which can cause undefined behavior such as data confidentiality and integrity compromise or crashes. Red Hat has issued security advisories RHSA-2025:23483 and RHSA-2025:23484 providing updated libssh packages that fix this issue for Red Hat Enterprise Linux 9 and 10 respectively.

Potential Impact

If exploited, this vulnerability can lead to compromised data confidentiality and integrity or cause crashes in applications using libssh with the ChaCha20 cipher and OpenSSL backend. The flaw stems from libssh not detecting certain OpenSSL errors, resulting in use of a partially initialized cipher context. This undermines the security guarantees of the SSH protocol implementation.

Mitigation Recommendations

Red Hat has released official security updates that fix this vulnerability in libssh for Red Hat Enterprise Linux 9 and 10. Users should apply the updated libssh packages as described in Red Hat advisories RHSA-2025:23483 and RHSA-2025:23484. The advisories provide detailed instructions and updated package versions (e.g., libssh-0.10.4-17.el9_7 for RHEL 9 and libssh-0.11.1-5.el10_1 for RHEL 10). Applying these updates mitigates the vulnerability. Patch status is confirmed by the vendor advisories.

Pro Console: star threats, build custom feeds, automate alerts via Slack, email & webhooks.Upgrade to 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
Vendor Advisory Urls
[{"url":"https://access.redhat.com/errata/RHSA-2025:23483","vendor":"Red Hat"},{"url":"https://access.redhat.com/errata/RHSA-2025:23484","vendor":"Red Hat"},{"url":"https://access.redhat.com/errata/RHSA-2026:0427","vendor":"Red Hat"},{"url":"https://access.redhat.com/errata/RHSA-2026:0428","vendor":"Red Hat"},{"url":"https://access.redhat.com/errata/RHSA-2026:0430","vendor":"Red Hat"},{"url":"https://access.redhat.com/errata/RHSA-2026:0431","vendor":"Red Hat"},{"url":"https://access.redhat.com/errata/RHSA-2026:0702","vendor":"Red Hat"},{"url":"https://access.redhat.com/errata/RHSA-2026:0978","vendor":"Red Hat"},{"url":"https://access.redhat.com/errata/RHSA-2026:0980","vendor":"Red Hat"},{"url":"https://access.redhat.com/errata/RHSA-2026:0985","vendor":"Red Hat"},{"url":"https://access.redhat.com/errata/RHSA-2026:0996","vendor":"Red Hat"},{"url":"https://access.redhat.com/errata/RHSA-2026:1539","vendor":"Red Hat"},{"url":"https://access.redhat.com/errata/RHSA-2026:1541","vendor":"Red Hat"},{"url":"https://access.redhat.com/errata/RHSA-2026:3415","vendor":"Red Hat"},{"url":"https://access.redhat.com/security/cve/CVE-2025-5987","vendor":"Red Hat"}]

Threat ID: 686bdc1a6f40f0eb72e9f8ac

Added to database: 07/07/2025, 14:39:22 UTC

Last enriched: 07/02/2026, 21:58:32 UTC

Last updated: 09/10/2026, 19:36:51 UTC

Views: 211

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 require Pro Console access. Upgrade inside Console → Billing.

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

Need more coverage?

Upgrade to Pro Console for AI refresh and higher limits.

For incident response and remediation, OffSeq services can help resolve threats faster.

Latest Threats

Breach by OffSeqOFFSEQFRIENDS — 25% OFF

Check if your credentials are on the dark web

Instant breach scanning across billions of leaked records. Free tier available.

Scan now
OffSeq TrainingCredly Certified

Lead Pen Test Professional

Technical5-day eLearningPECB Accredited
View courses