Memory Corruption, Denial of Service, and Arbitrary Code Execution in libgit2-sys

libgit2-sys Updated 02 Oct 2025

Summary

12/02/2024
HIGH
Yes i
High
8.6

GHSA-22q8-ghmq-63vf: libgit2-sys affected by memory corruption, denial of service, and arbitrary code execution in libgit2. Affects libgit2-sys versions < 0.16.2. Fixed in 0.16.2. 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 Devnack Your last release was probably never penetration tested Manual testing by engineers who build software, not an auditor's checklist. Trusted by teams at Swift and Google Talk to Devnack

Background

libgit2-sys is a crate that bundles libgit2, or optionally links to a system libgit2 library. It provides functionality for interacting with Git repositories. The libgit2 library, versions prior to 1.7.2, is vulnerable to memory corruption, denial of service, and arbitrary code execution.

Vulnerability Detail

The libgit2-sys crate, specifically the functions git_index_add and git_revparse_single, is affected by memory corruption and denial of service vulnerabilities. The git_index_add function can cause heap corruption, potentially leading to arbitrary code execution. The git_revparse_single function can enter an infinite loop on certain inputs, resulting in a denial of service. Additionally, the smart transport negotiation may experience an out-of-bounds read when a remote server does not advertise capabilities. These vulnerabilities can be exploited by an attacker to crash the application, execute arbitrary code, or cause other malicious impacts.

How To Fix

Latest published version: 0.10.0 as of 23 Oct 2026

Upgrading to it may include breaking changes; the version below is the minimum fixed release for this vulnerability.

If you need the minimum change

0.16.2

This is the first release that contains the fix.

Tip — Not sure which version your app runs? Vulert can match this fix to it. Scan free →

Workaround

There are no known workarounds for these vulnerabilities.

Conclusion

The libgit2-sys crate is vulnerable to memory corruption, denial of service, and arbitrary code execution due to issues in the underlying libgit2 library. It is crucial to upgrade to the fixed version (0.16.2) of the crate or ensure the system libgit2 library is at least version 1.7.2 to mitigate these vulnerabilities. For further support on vulnerability remediation, contact DevNack.com.

See every vulnerability recorded for libgit2-sys →

Share this vulnerability

FAQ

libgit2-sys is a crate that provides bindings to the libgit2 library, allowing developers to interact with Git repositories in Rust.

Versions of the libgit2 library prior to 1.7.2 are vulnerable.

An attacker can exploit these vulnerabilities by providing specially crafted inputs to the affected functions, leading to memory corruption, denial of service, or arbitrary code execution.

No, there are no known workarounds for these vulnerabilities.

To fix the vulnerabilities, upgrade to version 0.16.2 of the libgit2-sys crate, which includes the fixed version of the libgit2 library (1.7.2).

Related vulnerabilities

Recent vulnerabilities recorded for libgit2-sys.

How To Fix

Latest published version: 0.10.0 as of 23 Oct 2026

Upgrading to it may include breaking changes; the version below is the minimum fixed release for this vulnerability.

If you need the minimum change

0.16.2

This is the first release that contains the fix.

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