Critical Out of Bounds Read Vulnerability in libssh2: CVE-2019-3861
Summary
ALPINE-CVE-2019-3861: An out of bounds read flaw was discovered in libssh2 before 1.8.1 in the way SSH packets with a padding length value greater than the packet length are parsed. Affects libssh2 versions < 1.8.1-r0. Fixed in 1.8.1-r0. 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 a widely-used C library that provides an API for implementing SSH2 client and server functionality. It is utilized in various applications to facilitate secure communication over networks. The library supports features like secure file transfer and remote command execution. However, prior to version 1.8.1, libssh2 contained a vulnerability that could lead to severe security risks.
Vulnerability Detail
An out of bounds read flaw was discovered in libssh2 before version 1.8.1. This vulnerability arises from improper handling of SSH packets with a padding length value greater than the actual packet length. A remote attacker who compromises an SSH server may exploit this flaw to cause a Denial of Service (DoS) or potentially read sensitive data from the client’s memory. The CVSS score for this vulnerability is 9.1, indicating a critical severity level.
How To Fix
Minimum fixed version
1.8.1-r0
This is the first release that contains the fix.
sudo apk add --upgrade libssh2
Tip — Not sure which version your app runs? Vulert can match this fix to it. Scan free →
Workaround
If immediate patching is not feasible, consider restricting access to the SSH server or implementing firewall rules to limit exposure until the update can be applied.
Conclusion
The out of bounds read vulnerability in libssh2 (CVE-2019-3861) poses a critical risk to applications using this library. It is essential to update to the patched version to protect against potential exploits. Users can also utilize Vulert to monitor and receive alerts for such vulnerabilities in their software.
See every vulnerability recorded for libssh2 →
FAQ
CVE-2019-3861 is a critical vulnerability in the libssh2 library that allows for out of bounds read, potentially leading to Denial of Service or data exposure.
You can use Vulert's playground at Vulert Scanner to check if your application is affected by this vulnerability without needing to sign up.
The vulnerability can lead to Denial of Service attacks or unauthorized access to sensitive data in the client memory, posing significant security risks.
Yes, the patch is available in libssh2 version 1.8.1-r0 and later. Updating to this version will mitigate the vulnerability.
If you cannot update right away, consider implementing temporary security measures such as restricting SSH access or using firewall rules.
References
Related vulnerabilities
Recent vulnerabilities recorded for libssh2.