CVE-2025-4878: Libssh: use of uninitialized variable in privatekey_from_file()

Published Jul 3, 2025
·
Updated

A vulnerability was found in libssh, where an uninitialized variable exists under certain conditions in the privatekeyfromfile() function. This flaw can be triggered if the file specified by the filename doesn't exist and may lead to possible signing failures or heap corruption.

Other sources

The privatekeyfromfile() uses an uninitialized variable under certain conditions, such as if the file specified by the filename argument doesn't exist. This causes the code to return an invalid private key. This defect, in turn, might cause signing failure. The bug might also cause a Use-After-Free or corrupt the heap. Note that privatekeyfromfile() is a deprecated function and shouldn't be used anymore!

Red Hat

Affected Software

1 affected component
libssh libssh

Event History

Jul 3, 2025
Data Sourced
via Red Hat·05:47 PM
DescriptionSeverityAffected Software
Jul 22, 2025
CVE Published
via MITRE·02:17 PM
Data Sourced
via MITRE·02:17 PM
DescriptionSeverityWeakness
Data Sourced
via NVD·03:15 PM
DescriptionSeverityWeakness

Frequently Asked Questions

1

What is the severity of CVE-2025-4878?

CVE-2025-4878 has been classified with a medium severity rating due to potential impacts on system integrity.

2

How do I fix CVE-2025-4878?

To fix CVE-2025-4878, ensure that the libssh library is updated to the latest patched version provided by the vendor.

3

What are the potential impacts of CVE-2025-4878?

CVE-2025-4878 can result in signing failures or heap corruption, which may compromise application stability.

4

Which versions of libssh are affected by CVE-2025-4878?

CVE-2025-4878 affects various versions of libssh where the vulnerable code is present.

5

How can I mitigate risks associated with CVE-2025-4878?

Mitigation steps for CVE-2025-4878 include implementing proper file checks before invoking the privatekey_from_file() function.

Contact

SecAlerts Pty Ltd.
132 Wickham Terrace
Fortitude Valley,
QLD 4006, Australia
info@secalerts.co
By using SecAlerts services, you agree to our services end-user license agreement. This website is safeguarded by reCAPTCHA and governed by the Google Privacy Policy and Terms of Service. All names, logos, and brands of products are owned by their respective owners, and any usage of these names, logos, and brands for identification purposes only does not imply endorsement. If you possess any content that requires removal, please get in touch with us.
© 2026 SecAlerts Pty Ltd.
ABN: 70 645 966 203, ACN: 645 966 203