CVE-2025-4877 Libssh: write beyond bounds in binary to base64 conversion functions
MediumCVSS 4.5
EPSS 0.22%
- Published
- Updated
- Exploit status
- No public exploit known
- Technology
- UbuntuDebianRed Hat
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 products
| Product | Affected versions | Fixed in |
|---|---|---|
| cbl-mariner libssh(CBL-Mariner:2.0) | All versions | No fix listed |
| azure linux libssh(Azure Linux:3.0) | All versions | No fix listed |
| debian/libssh(Debian:12) | < 0.10.6-0+deb12u2 | 0.10.6-0+deb12u2 |
| debian/libssh(Debian:12) | = 0.10.5-2 | No fix listed |
| debian/libssh(Debian:12) | = 0.10.5-3 | No fix listed |
| debian/libssh(Debian:12) | = 0.10.5-3+hurd.1 | No fix listed |
| debian/libssh(Debian:12) | = 0.10.6-0+deb12u1 | No fix listed |
| debian/libssh(Debian:13) | < 0.11.2-1 | 0.11.2-1 |
| debian/libssh(Debian:14) | < 0.11.2-1 | 0.11.2-1 |
| libssh | < 0.11.2 | 0.11.2 |
| redhat enterprise linux | < 0:0.10.4-18.el9 | 0:0.10.4-18.el9 |
| redhat enterprise linux | = 10 | No fix listed |
| redhat rhel els | = 6 | No fix listed |
| redhat rhel els | = 7 | No fix listed |
| redhat enterprise linux | = 8 | No fix listed |
| redhat openshift | = 4 | No fix listed |
| ubuntu/libssh(Ubuntu:22.04) | < 0.9.6-2ubuntu0.22.04.4 | 0.9.6-2ubuntu0.22.04.4 |
| alpine/libssh(Alpine:v3.22) | < 0.11.2-r0 | 0.11.2-r0 |
| alpine/libssh(Alpine:v3.23) | < 0.11.2-r0 | 0.11.2-r0 |
| alpine/libssh(Alpine:v3.24) | < 0.11.2-r0 | 0.11.2-r0 |
| ubuntu/libssh(Ubuntu:24.04) | < 0.10.6-2ubuntu0.1 | 0.10.6-2ubuntu0.1 |
References
- MSRC Security Update Guide vendor-advisory
- Debian Security Tracker CVE-2025-4877 vendor-advisory
- RHSA-2026:18683 vendor-advisory
- access.redhat.com vdb-entry
- RHBZ#2376193 issue-tracking
- git.libssh.org
- www.libssh.org
- Ubuntu CVE tracker vendor-advisory
- USN-7619-1 vendor-advisory
- USN-7696-1 vendor-advisory
- www.cve.org
- security.alpinelinux.org vendor-advisory
- bugs.debian.org issue-tracking