Out of Bounds Memory Access in libssh2 - CVE-2020-22218
Summary
CVE-2020-22218: An issue was discovered in function _libssh2_packet_add in libssh2 1.10.0 allows attackers to access out of bounds memory. Affects libssh2 across 2 version ranges.
< 1.9.0-2+deb11u1
< 635caa90787220ac3773c1d5ba11f1236c22eae8
Fixed in 1.9.0-2+deb11u1. 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 allows applications to securely connect to remote servers and supports various features such as SFTP and SCP. The library is essential for applications requiring secure data transmission over networks. However, a vulnerability has been identified in version 1.10.0 that can lead to out of bounds memory access, potentially compromising the integrity of applications using this library.
Vulnerability Detail
An issue was discovered in the function _libssh2_packet_add in libssh2 version 1.10.0, which allows attackers to access out of bounds memory. This vulnerability can lead to unauthorized access to sensitive data, application crashes, or arbitrary code execution, posing significant risks to the security of applications relying on this library. The vulnerability originates from improper handling of packet data, which can be exploited by malicious actors to manipulate memory access.
How To Fix
Minimum fixed version
1.9.0-2+deb11u1
This is the first release that contains the fix.
sudo apt-get install --only-upgrade libssh2
Tip — Not sure which version your app runs? Vulert can match this fix to it. Scan free →
Workaround
If immediate upgrading is not feasible, consider implementing input validation and sanitization to mitigate the risk of exploitation. However, this is not a complete fix and should only be a temporary measure until the library is updated.
Conclusion
CVE-2020-22218 is a significant vulnerability in libssh2 that can lead to severe security risks for applications using this library. It is crucial to upgrade to the latest secure versions to mitigate these risks. Regular monitoring for vulnerabilities using tools like Vulert can help maintain application security.
See every vulnerability recorded for libssh2 →
FAQ
CVE-2020-22218 is a vulnerability in libssh2 that allows attackers to access out of bounds memory, potentially leading to unauthorized access or application crashes.
The vulnerability affects libssh2 version 1.10.0. Versions prior to 1.9.0-2+deb11u1 for Debian 11 and 1.10.0-2 for Debian 12 and 13 are also impacted.
You can use Vulert's playground at Vulert Scanner to check if your application is affected by this vulnerability without requiring any signup.
The CVSS score of CVE-2020-22218 is 7.5, indicating a high severity level.
If you cannot upgrade immediately, implement input validation and sanitization as a temporary workaround until the library can be updated.
Related vulnerabilities
Recent vulnerabilities recorded for libssh2.