Vulnerability · Published Aug 20, 2025 · Assigned by redhat

CVE-2025-4877Libssh: write beyond bounds in binary to base64 conversion functions

Medium 4.5

In plain English

A medium-severity out-of-bounds write in libssh. There are no confirmed reports of exploitation so far. The chance it is exploited in the next 30 days is estimated at 0.2% (higher than 10% of all known vulnerabilities). Fixed versions are available - upgrade the affected package.

Severity (CVSS 3.1)4.5Medium
Exploit odds (30 days)0.2%top 89.7% of all CVEs
Exploited in the wildNo reportsCISA SSVC: none
Attack toolingNoneno public tooling known

Official 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.

Affected packages & fixed versions

EcosystemPackageFixed inAdvisory
AlmaLinux:9libssh0.10.4-18.el9ALSA-2026:18683
AlmaLinux:9libssh-config0.10.4-18.el9ALSA-2026:18683
AlmaLinux:9libssh-devel0.10.4-18.el9ALSA-2026:18683
Alpine:v3.22libssh0.11.2-r0ALPINE-CVE-2025-4877
Alpine:v3.23libssh0.11.2-r0ALPINE-CVE-2025-4877
Alpine:v3.24libssh0.11.2-r0ALPINE-CVE-2025-4877
Debian:12libssh0.10.6-0+deb12u2DEBIAN-CVE-2025-4877
Debian:13libssh0.11.2-1DEBIAN-CVE-2025-4877
Debian:14libssh0.11.2-1DEBIAN-CVE-2025-4877
Rocky Linux:9libssh0:0.10.4-18.el9RLSA-2026:18683
Ubuntu:22.04:LTSlibssh0.9.6-2ubuntu0.22.04.4USN-7619-1
Ubuntu:22.04:LTSlibssh0.9.6-2ubuntu0.22.04.4UBUNTU-CVE-2025-4877
Ubuntu:24.04:LTSlibssh0.10.6-2ubuntu0.1UBUNTU-CVE-2025-4877
Ubuntu:24.04:LTSlibssh0.10.6-2ubuntu0.1USN-7619-1

Affected products (as reported)

Weakness: CWE-787 · Vector: CVSS:3.1/AV:L/AC:H/PR:L/UI:N/S:U/C:L/I:L/A:L

References