Use-after-free in libssh - CVE-2025-4878
Published: August 12, 2025
Vulnerability identifier: #VU113840
CSH Severity: Low
CVSS v4: 8.5 [CVSS:4.0/AV:L/AC:L/AT:N/PR:L/UI:N/VC:H/VI:H/VA:H/SC:N/SI:N/SA:N]
CVE-ID: CVE-2025-4878
CWE-ID: CWE-416
Exploitation vector: Local access
Exploit availability:
No public exploit available
Vulnerability details
The vulnerability allows a local user to escalate privileges on the system.
The vulnerability exists due to a use-after-free error within the privatekey_from_file() function. A local user can trigger a use-after-free error and execute arbitrary code with elevated privileges.
Affected software
libssh
SUSE Linux Enterprise Server 12 SP5
SUSE Linux Enterprise Server 12 SP5 LTSS Extended
SUSE Linux Enterprise High Performance Computing 12
SUSE Linux Enterprise Server 12
SUSE Linux Enterprise Server for SAP Applications 12
Ubuntu
Anolis OS
openEuler
Fedora
libssh (Ubuntu package)
libssh-devel-doc
libssh-debuginfo
libssh-help
libssh-devel
libssh-debugsource
libssh
libssh-config
libssh-doc
SUSE Linux Enterprise Server 12 SP5
SUSE Linux Enterprise Server 12 SP5 LTSS Extended
SUSE Linux Enterprise High Performance Computing 12
SUSE Linux Enterprise Server 12
SUSE Linux Enterprise Server for SAP Applications 12
Ubuntu
Anolis OS
openEuler
Fedora
libssh (Ubuntu package)
libssh-devel-doc
libssh-debuginfo
libssh-help
libssh-devel
libssh-debugsource
libssh
libssh-config
libssh-doc
How to mitigate CVE-2025-4878
Install updates from vendor's website.
libssh - update to 0.11.2
libssh (Ubuntu package) - addressed in versions 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, 0.10.6-3ubuntu1.1, 0.11.1-1ubuntu0.1
libssh-devel-doc - update to 0.6.3-12.15.1
libssh-debuginfo - update to 0.10.5-5
libssh-help - update to 0.10.5-5
libssh-devel - update to 0.10.5-5
libssh-debugsource - update to 0.10.5-5
libssh - update to 0.10.5-5
libssh - update to 0.10.5-10
libssh-devel - update to 0.10.5-10
libssh-config - update to 0.10.5-10
libssh-doc - update to 0.10.5-10
libssh - update to 0.11.2-1.fc41
libssh (Ubuntu package) - addressed in versions 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, 0.10.6-3ubuntu1.1, 0.11.1-1ubuntu0.1
libssh-devel-doc - update to 0.6.3-12.15.1
libssh-debuginfo - update to 0.10.5-5
libssh-help - update to 0.10.5-5
libssh-devel - update to 0.10.5-5
libssh-debugsource - update to 0.10.5-5
libssh - update to 0.10.5-5
libssh - update to 0.10.5-10
libssh-devel - update to 0.10.5-10
libssh-config - update to 0.10.5-10
libssh-doc - update to 0.10.5-10
libssh - update to 0.11.2-1.fc41