The SentinelOne Annual Threat Report - A Defenders Guide from the FrontlinesThe SentinelOne Annual Threat ReportGet the Report
Experiencing a Breach?Blog
Get StartedContact Us
SentinelOne
  • Platform
    Platform Overview
    • Singularity Platform
      Welcome to Integrated Enterprise Security
    • AI for Security
      Leading the Way in AI-Powered Security Solutions
    • Securing AI
      Accelerate AI Adoption with Secure AI Tools, Apps, and Agents.
    • How It Works
      The Singularity XDR Difference
    • Singularity Marketplace
      One-Click Integrations to Unlock the Power of XDR
    • Pricing & Packaging
      Comparisons and Guidance at a Glance
    Data & AI
    • Purple AI
      Accelerate SecOps with Generative AI
    • Singularity Hyperautomation
      Easily Automate Security Processes
    • AI-SIEM
      The AI SIEM for the Autonomous SOC
    • Singularity Data Lake
      AI-Powered, Unified Data Lake
    • Singularity Data Lake for Log Analytics
      Seamlessly Ingest Data from On-Prem, Cloud or Hybrid Environments
    Endpoint Security
    • Singularity Endpoint
      Autonomous Prevention, Detection, and Response
    • Singularity XDR
      Native & Open Protection, Detection, and Response
    • Singularity RemoteOps Forensics
      Orchestrate Forensics at Scale
    • Singularity Threat Intelligence
      Comprehensive Adversary Intelligence
    • Singularity Vulnerability Management
      Application & OS Vulnerability Management
    • Singularity Identity
      Identity Threat Detection and Response
    Cloud Security
    • Singularity Cloud Security
      Block Attacks with an AI-Powered CNAPP
    • Singularity Cloud Native Security
      Secure Cloud and Development Resources
    • Singularity Cloud Workload Security
      Real-Time Cloud Workload Protection Platform
    • Singularity Cloud Data Security
      AI-Powered Threat Detection for Cloud Storage
    • Singularity Cloud Security Posture Management
      Detect and Remediate Cloud Misconfigurations
    Securing AI
    • Prompt Security
      Secure AI Tools Across Your Enterprise
  • Why SentinelOne?
    Why SentinelOne?
    • Why SentinelOne?
      Cybersecurity Built for What’s Next
    • Our Customers
      Trusted by the World’s Leading Enterprises
    • Industry Recognition
      Tested and Proven by the Experts
    • About Us
      The Industry Leader in Autonomous Cybersecurity
    Compare SentinelOne
    • Arctic Wolf
    • Broadcom
    • CrowdStrike
    • Cybereason
    • Microsoft
    • Palo Alto Networks
    • Sophos
    • Splunk
    • Trellix
    • Trend Micro
    • Wiz
    Verticals
    • Energy
    • Federal Government
    • Finance
    • Healthcare
    • Higher Education
    • K-12 Education
    • Manufacturing
    • Retail
    • State and Local Government
  • Services
    Managed Services
    • Managed Services Overview
      Wayfinder Threat Detection & Response
    • Threat Hunting
      World-Class Expertise and Threat Intelligence
    • Managed Detection & Response
      24/7/365 Expert MDR Across Your Entire Environment
    • Incident Readiness & Response
      DFIR, Breach Readiness, & Compromise Assessments
    Support, Deployment, & Health
    • Technical Account Management
      Customer Success with Personalized Service
    • SentinelOne GO
      Guided Onboarding & Deployment Advisory
    • SentinelOne University
      Live and On-Demand Training
    • Services Overview
      Comprehensive Solutions for Seamless Security Operations
    • SentinelOne Community
      Community Login
  • Partners
    Our Network
    • MSSP Partners
      Succeed Faster with SentinelOne
    • Singularity Marketplace
      Extend the Power of S1 Technology
    • Cyber Risk Partners
      Enlist Pro Response and Advisory Teams
    • Technology Alliances
      Integrated, Enterprise-Scale Solutions
    • SentinelOne for AWS
      Hosted in AWS Regions Around the World
    • Channel Partners
      Deliver the Right Solutions, Together
    • SentinelOne for Google Cloud
      Unified, Autonomous Security Giving Defenders the Advantage at Global Scale
    • Partner Locator
      Your Go-to Source for Our Top Partners in Your Region
    Partner Portal→
  • Resources
    Resource Center
    • Case Studies
    • Data Sheets
    • eBooks
    • Reports
    • Videos
    • Webinars
    • Whitepapers
    • Events
    View All Resources→
    Blog
    • Feature Spotlight
    • For CISO/CIO
    • From the Front Lines
    • Identity
    • Cloud
    • macOS
    • SentinelOne Blog
    Blog→
    Tech Resources
    • SentinelLABS
    • Ransomware Anthology
    • Cybersecurity 101
  • About
    About SentinelOne
    • About SentinelOne
      The Industry Leader in Cybersecurity
    • Investor Relations
      Financial Information & Events
    • SentinelLABS
      Threat Research for the Modern Threat Hunter
    • Careers
      The Latest Job Opportunities
    • Press & News
      Company Announcements
    • Cybersecurity Blog
      The Latest Cybersecurity Threats, News, & More
    • FAQ
      Get Answers to Our Most Frequently Asked Questions
    • DataSet
      The Live Data Platform
    • S Foundation
      Securing a Safer Future for All
    • S Ventures
      Investing in the Next Generation of Security, Data and AI
  • Pricing
Get StartedContact Us
CVE Vulnerability Database
Vulnerability Database/CVE-2025-5987

CVE-2025-5987: Libssh ChaCha20 Cipher DOS Vulnerability

CVE-2025-5987 is a denial of service flaw in Libssh's ChaCha20 cipher implementation with OpenSSL that can lead to crashes and compromised data integrity. This article covers technical details, affected versions, impact, and mitigation strategies.

Updated: January 22, 2026

CVE-2025-5987 Overview

A critical flaw was discovered 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.

Critical Impact

This vulnerability can compromise the confidentiality and integrity of SSH communications by causing libssh to operate with a partially initialized cipher context, potentially exposing encrypted data or leading to application crashes.

Affected Products

  • libssh (all versions using ChaCha20 cipher with OpenSSL)
  • Applications and services built on libssh
  • Systems running Red Hat Enterprise Linux with affected libssh packages

Discovery Timeline

  • July 7, 2025 - CVE-2025-5987 published to NVD
  • January 13, 2026 - Last updated in NVD database

Technical Details for CVE-2025-5987

Vulnerability Analysis

This vulnerability stems from an improper error handling mechanism within libssh's cryptographic initialization routines when using the ChaCha20 cipher in conjunction with OpenSSL. The core issue is a return value aliasing problem (CWE-393: Return of Wrong Status Code) where OpenSSL's error codes are incorrectly interpreted by libssh.

When heap memory allocation fails during cipher context initialization, OpenSSL returns an error code that inadvertently matches libssh's SSH_OK success indicator. This aliasing causes libssh to proceed with cryptographic operations using a cipher context that was not properly initialized, creating a dangerous condition where the encryption state is undefined.

The network-accessible nature of this vulnerability means remote attackers could potentially trigger it by causing heap exhaustion conditions on target systems. While exploitation requires creating specific memory pressure conditions (indicated by high attack complexity), successful exploitation could allow attackers to compromise the confidentiality and integrity of SSH-secured communications without requiring any authentication or user interaction.

Root Cause

The root cause is a return value aliasing issue (CWE-393) where OpenSSL error codes collide with libssh's internal status codes. Specifically, when the EVP_CIPHER_CTX_new() or related OpenSSL functions fail due to heap exhaustion, the returned error value is misinterpreted as SSH_OK by libssh's error checking logic. This allows the library to continue execution with an uninitialized or partially initialized EVP_CIPHER_CTX structure, leading to undefined cryptographic behavior.

Attack Vector

The attack vector is network-based, requiring an attacker to first create heap exhaustion conditions on the target system. This could be achieved through:

  1. Memory pressure attacks: Sending specially crafted requests or payloads that cause excessive memory allocation on the target
  2. Resource exhaustion: Combining this vulnerability with other flaws to gradually deplete available heap memory
  3. Timing attacks: Exploiting race conditions during high-load scenarios when memory is already constrained

Once heap exhaustion is achieved during an SSH session establishment using ChaCha20 cipher, the uninitialized cipher context could result in:

  • Predictable or weak encryption output
  • Disclosure of sensitive data in transit
  • Application crashes causing denial of service
  • Potential memory corruption leading to further exploitation

The vulnerability affects the ChaCha20 cipher specifically when used with OpenSSL as the underlying cryptographic provider, meaning systems configured to use this cipher combination are at risk.

Detection Methods for CVE-2025-5987

Indicators of Compromise

  • Unexpected SSH connection failures or crashes during session establishment
  • Memory exhaustion events coinciding with SSH connection attempts
  • Abnormal cipher negotiation patterns in SSH handshake logs
  • Application crashes in libssh-dependent services with memory-related error messages

Detection Strategies

  • Monitor system memory utilization and correlate spikes with SSH connection activity
  • Implement logging for OpenSSL initialization failures in applications using libssh
  • Deploy intrusion detection rules to identify potential heap spray or memory exhaustion attacks targeting SSH services
  • Audit SSH cipher suite configurations to identify systems using ChaCha20 with OpenSSL-backed libssh

Monitoring Recommendations

  • Enable verbose logging for libssh-based applications to capture initialization errors
  • Configure SIEM alerts for memory exhaustion events on systems running SSH services
  • Monitor for unusual patterns in SSH connection rates that could indicate exploitation attempts
  • Track system stability metrics for services dependent on libssh

How to Mitigate CVE-2025-5987

Immediate Actions Required

  • Update libssh to the latest patched version available from your distribution
  • Apply Red Hat security updates if running affected RHEL systems (see RHSA advisories below)
  • Consider temporarily disabling ChaCha20 cipher in SSH configurations as a short-term mitigation
  • Monitor affected systems for signs of memory exhaustion attacks

Patch Information

Multiple security advisories have been released to address this vulnerability:

  • Red Hat Security Advisory RHSA-2025:23483
  • Red Hat Security Advisory RHSA-2025:23484
  • Red Hat Security Advisory RHSA-2026:0427
  • Red Hat Security Advisory RHSA-2026:0428
  • Red Hat Security Advisory RHSA-2026:0430
  • Red Hat Security Advisory RHSA-2026:0431

Additional details are available in the Red Hat CVE Analysis for CVE-2025-5987 and Red Hat Bug Report #2376219.

Workarounds

  • Configure SSH to use alternative ciphers (e.g., AES-GCM) instead of ChaCha20 until patches are applied
  • Implement memory limits and resource controls for SSH-related processes to reduce heap exhaustion risk
  • Deploy network-level protections to rate-limit SSH connection attempts from untrusted sources
bash
# Configuration example - Disable ChaCha20 cipher in SSH config
# Edit /etc/ssh/sshd_config or libssh configuration
# Remove chacha20-poly1305@openssh.com from cipher list

# For OpenSSH sshd_config:
Ciphers aes256-gcm@openssh.com,aes128-gcm@openssh.com,aes256-ctr,aes192-ctr,aes128-ctr

# Restart SSH service after configuration change
sudo systemctl restart sshd

Disclaimer: This content was generated using AI. While we strive for accuracy, please verify critical information with official sources.

  • Vulnerability Details
  • TypeDOS

  • Vendor/TechLibssh

  • SeverityHIGH

  • CVSS Score8.1

  • EPSS Probability0.07%

  • Known ExploitedNo
  • CVSS Vector
  • CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:H/A:H
  • Impact Assessment
  • ConfidentialityHigh
  • IntegrityNone
  • AvailabilityHigh
  • CWE References
  • CWE-393
  • Technical References
  • Red Hat Security Advisory RHSA-2025:23483

  • Red Hat Security Advisory RHSA-2025:23484

  • Red Hat Security Advisory RHSA-2026:0427

  • Red Hat Security Advisory RHSA-2026:0428

  • Red Hat Security Advisory RHSA-2026:0430

  • Red Hat Security Advisory RHSA-2026:0431

  • Red Hat CVE Analysis CVE-2025-5987

  • Red Hat Bug Report #2376219
  • Related CVEs
  • CVE-2026-0968: libssh SFTP DoS Vulnerability Explained

  • CVE-2026-0967: libssh Denial of Service Vulnerability

  • CVE-2026-0965: libssh Configuration Parsing DoS Vulnerability

  • CVE-2023-1667: Libssh Denial of Service Vulnerability
Experience the World’s Most Advanced Cybersecurity Platform

Experience the World’s Most Advanced Cybersecurity Platform

See how our intelligent, autonomous cybersecurity platform can protect your organization now and into the future.

Try SentinelOne
  • Get Started
  • Get a Demo
  • Product Tour
  • Why SentinelOne
  • Pricing & Packaging
  • FAQ
  • Contact
  • Contact Us
  • Customer Support
  • SentinelOne Status
  • Language
  • Platform
  • Singularity Platform
  • Singularity Endpoint
  • Singularity Cloud
  • Singularity AI-SIEM
  • Singularity Identity
  • Singularity Marketplace
  • Purple AI
  • Services
  • Wayfinder TDR
  • SentinelOne GO
  • Technical Account Management
  • Support Services
  • Verticals
  • Energy
  • Federal Government
  • Finance
  • Healthcare
  • Higher Education
  • K-12 Education
  • Manufacturing
  • Retail
  • State and Local Government
  • Cybersecurity for SMB
  • Resources
  • Blog
  • Labs
  • Case Studies
  • Videos
  • Product Tours
  • Events
  • Cybersecurity 101
  • eBooks
  • Webinars
  • Whitepapers
  • Press
  • News
  • Ransomware Anthology
  • Company
  • About Us
  • Our Customers
  • Careers
  • Partners
  • Legal & Compliance
  • Security & Compliance
  • Investor Relations
  • S Foundation
  • S Ventures

©2026 SentinelOne, All Rights Reserved.

Privacy Notice Terms of Use

English