Null-Dereference READ Vulnerability in libssh2 Package
Summary
OSV-2025-433: Null-dereference READ in _libssh2_packet_add. Affects libssh2 versions >= d34d9258b8420b19ec3f97b4cc5bf7aa7d98e35a. No fix is published. How to fix ↓
Check if this vulnerability affects your application
Upload a manifest or SBOM and we'll show whether you're affected, plus every other risky package in the same scan.
No signup required · Results in about 60 seconds
Background
libssh2 is an open-source library that provides a way to implement SSH2 protocol in applications. It is widely used for secure file transfers and remote command execution. The library is designed to be lightweight and efficient, making it a popular choice for developers needing SSH capabilities. However, like many software libraries, it can be susceptible to vulnerabilities that may compromise the security and stability of applications that depend on it.
Vulnerability Detail
The vulnerability identified as OSV-2025-433 is a null-dereference READ issue occurring in the _libssh2_packet_add function. This vulnerability can lead to application crashes, potentially allowing attackers to exploit the situation for denial of service attacks. The issue arises from improper handling of null pointers, which can result in unexpected behavior when the library processes packets. The vulnerability was reported through OSS-Fuzz, highlighting its critical nature and the need for immediate attention.
How To Fix
No fixed version is published for this vulnerability.
Tip — Not sure whether your app is affected? Vulert can check the versions your app actually runs. Scan free →
Workaround
As a temporary workaround, developers can implement additional checks in their code to ensure that pointers are not null before invoking functions that rely on them. This can prevent crashes while a permanent fix is being applied. Example code snippet: if (packet != NULL) {
_libssh2_packet_add(packet);
}
Conclusion
The null-dereference READ vulnerability in the libssh2 package poses a significant risk to applications relying on this library. It is crucial for developers to update to the latest version to mitigate the risk of exploitation. Additionally, implementing temporary workarounds can help maintain stability until a full update is applied.
See every vulnerability recorded for libssh2 →
FAQ
The vulnerability is a null-dereference READ issue that can cause application crashes.
You can use the Vulert playground at Vulert Scanner to check if your application is affected by this vulnerability without any signup.
Exploitation of this vulnerability can lead to denial of service attacks, affecting the availability of the application.
Yes, a patched version of the libssh2 package is available. It is recommended to update to the latest version.
Implement additional null checks in your code as a temporary workaround to prevent crashes.
References
Related vulnerabilities
Recent vulnerabilities recorded for libssh2.