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

- Priority: **Routine**
- Reason: Not severe (CVSS 4.5, local access); no exploitation reported by the 5 checked sources
- Next step: Fix in the normal cadence
- Status: published
- Published: 2025-08-20 · Modified: 2026-11-24
- Aliases: UBUNTU-CVE-2025-4877, DEBIAN-CVE-2025-4877, ALPINE-CVE-2025-4877, openSUSE-SU-2026:12743-1
- Record: https://cvemate.com/vulnerability/CVE-2025-4877 · JSON: https://cvemate.com/vulnerability/CVE-2025-4877/json

## Description

```text
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.
```

## Signals

- CVSS: 4.5 medium (v3.1, CVE.org) CVSS:3.1/AV:L/AC:H/PR:L/UI:N/S:U/C:L/I:L/A:L
- EPSS: 0.257%, percentile 18.481%, as of 2026-12-04
- Known exploited (KEV): CISA not listed, ENISA not listed, CIRCL not listed
- Ransomware use: none recorded
- Public exploits: 0

## Affected

- alpine libssh (Alpine Linux): \< 0.11.2-r0
- debian libssh (Debian): \< 0.10.6-0+deb12u2 \| \< 0.11.2-1
- ubuntu libssh (Ubuntu): \< 0.6.3-4.3ubuntu0.6+esm2 \| \< 0.8.0~20170825.94fa1e38-1ubuntu0.7+esm4 \| \< 0.9.3-2ubuntu2.5+esm1 \| \< 0.9.6-2ubuntu0.22.04.4 \| \< 0.10.6-2ubuntu0.1
- opensuse hydra (openSUSE): \< 9.9-1.1

## References

- <https://access.redhat.com/errata/RHSA-2026:18683>
- <https://access.redhat.com/security/cve/CVE-2025-4877>
- <https://bugzilla.redhat.com/show_bug.cgi?id=2376193>
- <https://git.libssh.org/projects/libssh.git/commit/?h=stable-0.11&id=6fd9cc8ce3958092a1aae11f1f2e911b2747732d>
- <https://www.libssh.org/security/advisories/CVE-2025-4877.txt>
- <https://ubuntu.com/security/CVE-2025-4877>
- <https://www.cve.org/CVERecord?id=CVE-2025-4877>
- <https://ubuntu.com/security/notices/USN-7619-1>
- <https://ubuntu.com/security/notices/USN-7696-1>
- <https://security-tracker.debian.org/tracker/CVE-2025-4877>
- <https://security.alpinelinux.org/vuln/CVE-2025-4877>
- <https://www.suse.com/security/cve/CVE-2025-4877>

---

Data as of 2026-12-05T09:58:17.726Z. The priority label is CveMate's own model from public evidence, not an official rating, and it knows nothing about your assets. How labels are decided: https://cvemate.com/faq#priority
