Shell Command Injection Vulnerability in libgit2: CVE-2026-5917

libgit2 Updated 15 Aug 2026

Summary

11/08/2026
N/A
No i
Unrated
Not published

DEBIAN-CVE-2026-5917: libgit2 versions v0.27.0 through v1.9.0 built with the libssh2 SSH backend (USE_SSH=libssh2) contain a shell command injection vulnerability that allows remote attackers to execute arbitrary commands on an SSH server by... Affects libgit2 versions 1.1.0+dfsg.1-4 – 1.9.6+ds-1. No fix is published. 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 solid API. It is widely used in various applications for version control and repository management. This library supports multiple backends for SSH connections, including libssh2. The vulnerability in question affects versions v0.27.0 through v1.9.0 built with the libssh2 SSH backend, exposing users to potential command injection attacks.

Vulnerability Detail

libgit2 versions v0.27.0 through v1.9.0 built with the libssh2 SSH backend contain a shell command injection vulnerability. This flaw allows remote attackers to execute arbitrary commands on an SSH server by supplying a repository path with unescaped shell metacharacters such as single quotes, semicolons, or pipes. The vulnerability originates from the gen_proto() function in ssh_libssh2.c, which inserts the repository path directly into a shell command string without proper escaping. This can lead to malicious submodule URLs in .gitmodules files, which, when processed during a recursive clone, can cause the remote server's shell to interpret injected commands under the victim's SSH user account.

How To Fix

No fixed version is published for this vulnerability.

Tip — Not sure whether your app is affected? Vulert can check the versions your app actually runs. Scan free →

Workaround

As a temporary workaround, avoid using repository paths that contain shell metacharacters when working with libgit2. This can help mitigate the risk of command injection until a patch is applied.

Conclusion

The shell command injection vulnerability in libgit2 (CVE-2026-5917) poses a significant risk to users utilizing versions v0.27.0 through v1.9.0 with the libssh2 SSH backend. It is crucial to update to a patched version to mitigate this risk and ensure the security of your applications.

See every vulnerability recorded for libgit2 →

Share this vulnerability

FAQ

CVE-2026-5917 is a vulnerability in libgit2 that allows remote attackers to execute arbitrary commands on an SSH server through shell command injection.

libgit2 versions v0.27.0 through v1.9.0 built with the libssh2 SSH backend are affected by this vulnerability.

You can use Vulert, which monitors and alerts for open-source vulnerabilities in your software. Visit Vulert Scanner to check if your application is affected without needing to sign up.

As a temporary measure, avoid using repository paths with shell metacharacters to reduce the risk of exploitation until you can apply the patch.

More details can be found in the official CVE database or by referring to the Debian security advisories related to libgit2.

Related vulnerabilities

Recent vulnerabilities recorded for libgit2.

How To Fix

No fixed version is published for this vulnerability.

Tip — Not sure whether your app is affected? Vulert can check the versions your app actually runs. 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