Out-of-Bounds Read Vulnerability in libgit2: CVE-2018-15501

libgit2 Updated 02 Oct 2025

Summary

18/08/2018
N/A
Yes i
High
7.5

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 ↓

Free scan

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.

Check my app free

No signup required · Results in about 60 seconds

Upload your dependency manifest or SBOM

Drag & drop your file here or

Java Javascript PHP Python Go Rust Ruby Dart C/C++ Elixir CycloneDX SPDX

Upload a supported dependency manifest or SBOM. No installation or source-code access required.

See supported files and SBOM formats
SBOM sbom.json · bom.json · bom.xml · *.spdx.json · *.cdx.json · *.cdx.xml
Java pom.xml · gradle.lockfile · buildscript-gradle.lockfile
Javascript package-lock.json · yarn.lock · pnpm-lock.yaml
PHP composer.lock
Python poetry.lock · requirements.txt · Pipfile.lock
Go go.mod
Rust Cargo.lock
Ruby Gemfile.lock
Dart pubspec.lock
C/C++ conan.lock
Elixir mix.lock
Enter your work email to receive your report link.

Verify your email to view the full report and start 30 days of continuous monitoring. No credit card required.

Sponsored MarkAI Find prospects already talking about the problem you solve AI watches the communities your customers use to find qualified prospects, then alerts you when a conversation is worth joining. See MarkAI

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 →

Share this vulnerability

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.

Related vulnerabilities

Recent vulnerabilities recorded for libgit2.

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 →

Subscribe to Vulert on Telegram
Daily digest of new CVEs, critical and high severity, affected packages and fixes — plus a weekly roundup.
Join the channel →
Help improve this record
Report an issue or send feedback