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-5351

CVE-2025-5351: Libssh Use-After-Free Vulnerability

CVE-2025-5351 is a use-after-free flaw in Libssh's key export functionality that can cause heap corruption and application crashes. This article covers the technical details, affected versions, security impact, and mitigation.

Updated: January 22, 2026

CVE-2025-5351 Overview

A double free vulnerability has been identified in the key export functionality of libssh, a widely-used library implementing the SSH protocol. The flaw exists in the internal function responsible for converting cryptographic keys into serialized formats. During error handling, a memory structure is freed but not properly cleared, creating conditions for a potential double free if subsequent failures occur within the same function. This memory corruption issue can result in heap corruption or application instability, particularly in low-memory scenarios where key export operations are performed.

Critical Impact

This double free vulnerability can lead to heap corruption and application crashes, potentially causing denial of service conditions in systems relying on libssh for secure communications and key management operations.

Affected Products

  • libssh libssh (all versions)
  • Red Hat OpenShift Container Platform 4.0
  • Red Hat Enterprise Linux 6.0, 7.0, 8.0, 9.0, and 10.0

Discovery Timeline

  • 2025-07-04 - CVE-2025-5351 published to NVD
  • 2026-01-08 - Last updated in NVD database

Technical Details for CVE-2025-5351

Vulnerability Analysis

This vulnerability is classified as CWE-415 (Double Free), a memory corruption vulnerability that occurs when a program attempts to free the same memory location more than once. In the context of libssh, the issue manifests during key export operations when error handling paths do not properly manage memory state.

When the key export function encounters an error condition, it initiates cleanup procedures that free allocated memory structures. However, the freed pointer is not set to NULL after deallocation. If a secondary error occurs later in the same function execution path, the cleanup routine may attempt to free the same memory region again, triggering the double free condition.

The network-accessible nature of this vulnerability means that attackers who can trigger key export operations through SSH connections may be able to exploit this flaw remotely. While the vulnerability requires low-privilege authentication, successful exploitation could destabilize critical infrastructure services that depend on libssh.

Root Cause

The root cause of this vulnerability lies in improper memory management within the key serialization error handling code. Specifically, after calling free() on a memory structure during error recovery, the pointer reference is not nullified. This leaves a dangling pointer that can be inadvertently accessed and freed again if additional error conditions trigger secondary cleanup attempts within the same function scope.

Attack Vector

The vulnerability can be exploited over the network by authenticated users with low privileges. An attacker would need to initiate SSH sessions that trigger key export operations and deliberately induce error conditions, such as by creating low-memory scenarios or triggering specific error paths during key serialization. While exploitation is constrained by the need for authentication and specific timing conditions, successful attacks can cause denial of service by crashing applications that rely on libssh.

The attack flow involves:

  1. Establishing an authenticated SSH connection to a vulnerable system
  2. Initiating operations that trigger the key export functionality
  3. Creating conditions (such as memory pressure) that cause the initial error in key serialization
  4. Inducing secondary failures that trigger the double free condition
  5. Resulting in heap corruption and potential application crash

Detection Methods for CVE-2025-5351

Indicators of Compromise

  • Unexpected crashes or segmentation faults in applications using libssh during key management operations
  • Core dumps indicating heap corruption with double free signatures in libssh library code
  • Abnormal memory allocation patterns or heap inconsistencies in SSH-related processes
  • Application logs showing repeated key export failures followed by process termination

Detection Strategies

  • Deploy memory debugging tools such as AddressSanitizer (ASan) or Valgrind to detect double free conditions in development and testing environments
  • Monitor system logs for segmentation faults or heap corruption errors in services using libssh
  • Implement runtime memory checking for production systems handling critical SSH operations
  • Use SentinelOne's behavioral detection capabilities to identify abnormal process crashes indicative of memory corruption exploits

Monitoring Recommendations

  • Configure crash reporting to capture and analyze core dumps from libssh-dependent applications
  • Monitor for unusual patterns of SSH session failures combined with service restarts
  • Track memory utilization on systems running SSH services to identify potential low-memory exploitation attempts
  • Set up alerts for repeated process crashes in services using libssh for key management

How to Mitigate CVE-2025-5351

Immediate Actions Required

  • Review all systems for libssh installations and identify versions in use
  • Monitor the Red Hat CVE-2025-5351 Advisory for patch availability and updates
  • Implement additional monitoring on systems performing frequent key export operations
  • Consider restricting access to SSH key management functionality to minimize exposure
  • Review the Red Hat Bug Report #2369367 for technical details and remediation guidance

Patch Information

Organizations should monitor vendor channels for official patches addressing this vulnerability. Red Hat has acknowledged this issue and tracking information is available through their security advisory system. Apply vendor-supplied patches as they become available through your distribution's package management system.

For Red Hat Enterprise Linux and OpenShift Container Platform users, subscribe to Red Hat security announcements and apply updates using yum update or dnf update when patches are released.

Workarounds

  • Limit network access to SSH services to trusted networks and hosts only
  • Implement strict authentication requirements to reduce the attack surface for low-privilege exploitation
  • Deploy application sandboxing or containerization to limit the impact of potential crashes
  • Consider enabling memory protection features like ASLR and heap hardening on affected systems
bash
# Configuration example
# Check installed libssh version on RHEL/CentOS systems
rpm -qa | grep libssh

# Monitor for libssh-related crashes in system logs
journalctl -u sshd --since "1 hour ago" | grep -i "segfault\|double free\|heap"

# Enable core dumps for debugging purposes
ulimit -c unlimited
echo "/var/crash/core.%e.%p" > /proc/sys/kernel/core_pattern

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

  • Vulnerability Details
  • TypeUse After Free

  • Vendor/TechLibssh

  • SeverityMEDIUM

  • CVSS Score6.5

  • EPSS Probability0.06%

  • Known ExploitedNo
  • CVSS Vector
  • CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:N/I:N/A:H
  • Impact Assessment
  • ConfidentialityLow
  • IntegrityNone
  • AvailabilityHigh
  • CWE References
  • CWE-415
  • Technical References
  • Red Hat CVE-2025-5351 Advisory

  • Red Hat Bug Report #2369367
  • Related CVEs
  • CVE-2025-14821: libssh Information Disclosure Vulnerability

  • CVE-2026-0968: libssh SFTP DoS Vulnerability Explained

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

  • CVE-2026-0965: libssh Configuration Parsing DoS Vulnerability
Default Legacy - Prefooter | 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