Out-of-Bounds Read Vulnerability in libgit2: CVE-2018-15501
Summary
ALPINE-CVE-2018-15501: In ng_pkt in transports/smart_pkt.c in libgit2 before 0.26.6 and 0.27.x before 0.27.4, a remote attacker can send a crafted smart-protocol "ng" packet that lacks a '\0' byte to trigger an out-of-bounds read that leads to... Affects libgit2 versions < 0.27.4-r0. Fixed in 0.27.4-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
libgit2 is a portable, pure C implementation of the Git core methods provided as a re-entrant library with a focus on performance and flexibility. It allows developers to integrate Git functionalities into their applications. However, prior versions of libgit2 are susceptible to a critical vulnerability that can be exploited by remote attackers.
Vulnerability Detail
The vulnerability, identified as CVE-2018-15501, arises in the ng_pkt function within the transports/smart_pkt.c file of libgit2 versions before 0.26.6 and 0.27.x before 0.27.4. A remote attacker can exploit this vulnerability by sending a crafted smart-protocol 'ng' packet that lacks a '\0' byte, leading to an out-of-bounds read. This can result in a denial of service (DoS) condition, potentially crashing the application using the library.
How To Fix
Minimum fixed version
0.27.4-r0
This is the first release that contains the fix.
sudo apk add --upgrade libgit2
Tip — Not sure which version your app runs? Vulert can match this fix to it. Scan free →
Workaround
As a temporary measure, you can restrict access to the affected service or implement network-level controls to prevent unauthorized access until the package is updated.
Conclusion
CVE-2018-15501 is a significant vulnerability in libgit2 that can lead to denial of service if exploited. It is crucial for users of affected versions to update to the patched version to mitigate the risk. Regular monitoring for vulnerabilities using tools like Vulert can help maintain application security.
See every vulnerability recorded for libgit2 →
FAQ
CVE-2018-15501 is a vulnerability in libgit2 that allows remote attackers to trigger an out-of-bounds read, leading to a denial of service.
Versions of libgit2 before 0.26.6 and 0.27.x before 0.27.4 are affected by this vulnerability.
You can use the Vulert playground at Vulert Scanner to check if your application is affected by this vulnerability without needing to sign up.
The CVSS score of CVE-2018-15501 is 7.5, indicating a high severity level.
If immediate updates are not possible, consider implementing network-level controls to limit access to the affected service as a temporary workaround.
References
Related vulnerabilities
Recent vulnerabilities recorded for libgit2.