Skip to main content
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-4877: Out-of-bounds Write

0
Medium
VulnerabilityCVE-2025-4877cvecve-2025-4877
Published: Wed Aug 20 2025 (08/20/2025, 12:19:18 UTC)
Source: CVE Database V5

Description

There's a vulnerability in the libssh package where when a libssh consumer passes in an unexpectedly large input buffer to ssh_get_fingerprint_hash() function. In such cases the bin_to_base64() function can experience an integer overflow leading to a memory under allocation, when that happens it's possible that the program perform out of bounds write leading to a heap corruption. This issue affects only 32-bits builds of libssh.

AI-Powered Analysis

AILast updated: 11/20/2025, 21:36:53 UTC

Technical Analysis

CVE-2025-4877 is a vulnerability identified in the libssh package, specifically affecting 32-bit builds. The issue occurs when the ssh_get_fingerprint_hash() function is passed an unexpectedly large input buffer. This triggers an integer overflow in the bin_to_base64() function, which is responsible for converting binary data to base64 encoding. The integer overflow leads to memory under allocation, meaning the allocated buffer is smaller than required. Consequently, when the function writes data, it performs out-of-bounds writes beyond the allocated heap buffer, causing heap corruption. Heap corruption can lead to unpredictable behavior including crashes, data corruption, or potentially arbitrary code execution if exploited effectively. However, exploitation complexity is high, requiring local access with low privileges, and no user interaction is needed. The vulnerability does not affect 64-bit builds, limiting the scope of impact. No patches or known exploits are currently reported, but the flaw is publicly disclosed and assigned a CVSS v3.1 score of 4.5 (medium severity), reflecting limited confidentiality, integrity, and availability impacts with a high attack complexity and local attack vector. The vulnerability is particularly relevant for environments still running 32-bit libssh, which may include embedded systems, legacy applications, or specialized hardware.

Potential Impact

For European organizations, the impact of CVE-2025-4877 is moderate but context-dependent. Organizations relying on 32-bit libssh builds, often found in embedded devices, legacy systems, or specialized network appliances, could experience heap corruption leading to application crashes or data integrity issues. While the vulnerability does not currently have known exploits in the wild, successful exploitation could disrupt services or potentially allow privilege escalation if combined with other vulnerabilities. Confidentiality impact is limited but possible if heap corruption leads to information leakage. The medium CVSS score reflects the need for caution but not immediate critical alarm. Organizations with extensive use of 32-bit systems in sectors such as industrial control, telecommunications, or government infrastructure should prioritize assessment. The threat is less relevant for environments predominantly running 64-bit architectures, which are common in modern enterprise IT but less so in embedded contexts.

Mitigation Recommendations

1. Monitor libssh project and vendor advisories for official patches addressing CVE-2025-4877 and apply them promptly once available. 2. Audit your environment to identify any 32-bit libssh deployments, particularly in embedded devices, legacy systems, or network appliances. 3. Where feasible, upgrade affected systems to 64-bit architectures or newer libssh versions that are not vulnerable. 4. Employ memory protection mechanisms such as Address Space Layout Randomization (ASLR) and heap protection features to reduce exploitation risk. 5. Restrict local access to systems running vulnerable libssh versions to trusted users only, minimizing the attack surface. 6. Implement runtime application self-protection (RASP) or intrusion detection systems that can detect anomalous memory corruption behaviors. 7. Conduct regular security assessments and code audits for custom applications integrating libssh to ensure no unsafe usage patterns exist. 8. Prepare incident response plans to quickly address potential exploitation attempts involving heap corruption.

Need more detailed analysis?Get Pro

Technical Details

Data Version
5.1
Assigner Short Name
redhat
Date Reserved
2025-05-16T22:23:41.045Z
Cvss Version
3.1
State
PUBLISHED

Threat ID: 68a5c06fad5a09ad0004bff1

Added to database: 8/20/2025, 12:32:47 PM

Last enriched: 11/20/2025, 9:36:53 PM

Last updated: 11/22/2025, 9:01:44 AM

Views: 67

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 enhanced features?

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

Latest Threats