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

CVE-2025-4877: libssh Buffer Overflow Vulnerability

CVE-2025-4877 is a buffer overflow flaw in libssh that causes integer overflow and heap corruption in 32-bit builds. This article covers the technical details, affected versions, impact, and mitigation strategies.

Updated: January 22, 2026

CVE-2025-4877 Overview

A vulnerability exists in the libssh package where an integer overflow can occur when a libssh consumer passes an unexpectedly large input buffer to the ssh_get_fingerprint_hash() function. When this happens, the bin_to_base64() function experiences an integer overflow that leads to memory under-allocation. The subsequent out-of-bounds write operation can result in heap corruption, potentially allowing attackers to manipulate program memory.

Critical Impact

This integer overflow vulnerability can lead to heap corruption through out-of-bounds writes, affecting the integrity and stability of applications using 32-bit builds of libssh.

Affected Products

  • libssh (32-bit builds only)
  • Applications and services utilizing libssh for SSH connectivity on 32-bit architectures
  • Linux distributions shipping 32-bit libssh packages

Discovery Timeline

  • 2025-08-20 - CVE-2025-4877 published to NVD
  • 2025-08-20 - Last updated in NVD database

Technical Details for CVE-2025-4877

Vulnerability Analysis

This vulnerability (CWE-787: Out-of-bounds Write) stems from improper handling of large input buffers in the ssh_get_fingerprint_hash() function. When a consumer application passes an oversized input buffer, the internal bin_to_base64() function performs size calculations that can overflow on 32-bit systems due to the limited integer range. The overflow causes the function to allocate significantly less memory than required for the output buffer, while the subsequent write operations proceed with the original (larger) calculated size, writing beyond the allocated heap memory boundaries.

The vulnerability is particularly relevant for embedded systems, IoT devices, and legacy applications that still rely on 32-bit builds. While 64-bit systems have a much larger integer range making this overflow impractical to trigger, 32-bit builds remain vulnerable when processing maliciously crafted or unexpectedly large fingerprint data.

Root Cause

The root cause is an integer overflow in the size calculation within the bin_to_base64() function. When converting binary data to base64 encoding, the function calculates the required output buffer size. On 32-bit systems, passing an input buffer large enough causes this calculation to wrap around due to integer overflow, resulting in a much smaller allocation than actually needed. The CWE-787 classification indicates this is an out-of-bounds write vulnerability where data is written past the end of the intended buffer.

Attack Vector

The attack requires local access with low privileges to exploit. An attacker must be able to influence the input to the ssh_get_fingerprint_hash() function, either through a malicious application using libssh or by manipulating data processed by an existing application. The attack complexity is high due to several factors: the attacker must trigger the precise conditions for integer overflow, the target system must be running a 32-bit build of libssh, and heap layout must be favorable for successful exploitation.

The vulnerability mechanism works as follows: the ssh_get_fingerprint_hash() function receives an input buffer for fingerprint processing. Internally, the bin_to_base64() function calculates the output size needed for base64 encoding. On 32-bit systems with large input, this calculation overflows, causing under-allocation. When the conversion proceeds, data is written beyond the allocated buffer into adjacent heap memory.

For detailed technical information, refer to the Libssh CVE-2025-4877 Advisory.

Detection Methods for CVE-2025-4877

Indicators of Compromise

  • Unexpected crashes or segmentation faults in applications using libssh on 32-bit systems
  • Heap corruption errors or memory-related exceptions in SSH connection handling code
  • Abnormal behavior in fingerprint verification or key exchange processes
  • Core dumps showing memory corruption patterns near base64 encoding routines

Detection Strategies

  • Monitor for application crashes in libssh-dependent services with heap corruption signatures
  • Implement runtime memory sanitizers (AddressSanitizer) in development environments to detect out-of-bounds writes
  • Review application logs for SSH fingerprint processing errors or unexpected buffer handling exceptions
  • Deploy SentinelOne's behavioral analysis to detect exploitation attempts through anomalous memory access patterns

Monitoring Recommendations

  • Enable detailed logging for SSH authentication and key fingerprint operations
  • Configure heap memory corruption detection in system monitoring tools
  • Monitor 32-bit applications using libssh for stability issues and unusual resource consumption
  • Track version information of libssh installations across the infrastructure to identify vulnerable deployments

How to Mitigate CVE-2025-4877

Immediate Actions Required

  • Identify all 32-bit builds of libssh in your environment and prioritize them for updates
  • Review applications consuming libssh to assess potential exposure to malicious input buffers
  • Consider migrating vulnerable 32-bit deployments to 64-bit builds where feasible
  • Apply the vendor patch from the stable-0.11 branch as soon as available for your distribution

Patch Information

The libssh project has addressed this vulnerability in their stable branch. The fix is available in the libssh commit 6fd9cc8ce3958092a1aae11f1f2e911b2747732d. Red Hat has also published tracking information for this vulnerability through their security advisory and Bugzilla ID 2376193. Check with your Linux distribution vendor for updated packages containing the fix.

Workarounds

  • Migrate affected services to 64-bit builds of libssh where the integer overflow is not practically exploitable
  • Implement input validation in applications using libssh to reject unexpectedly large buffers before passing to fingerprint functions
  • Isolate 32-bit libssh applications in sandboxed environments to limit potential exploitation impact
  • Consider temporary service restrictions on affected systems until patches can be applied
bash
# Check libssh architecture on Linux systems
file /usr/lib/libssh.so* 2>/dev/null || file /usr/lib64/libssh.so*

# Verify installed libssh version (package manager specific)
rpm -q libssh 2>/dev/null || dpkg -l libssh* 2>/dev/null

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

  • Vulnerability Details
  • TypeBuffer Overflow

  • Vendor/TechLibssh

  • SeverityMEDIUM

  • CVSS Score4.5

  • EPSS Probability0.01%

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

  • Red Hat Bugzilla ID 2376193

  • Libssh Commit Update

  • Libssh CVE-2025-4877 Advisory
  • Related CVEs
  • CVE-2026-3731: Libssh Buffer Overflow Vulnerability

  • CVE-2025-4878: libssh Buffer Overflow Vulnerability

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

  • CVE-2026-0967: 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