cve.bz

CVE-2026-5917 libgit2 libgit2: OS Command Injection

8.6 highEPSS 1.4%

High (8.6) in libgit2 libgit2. EPSS 1.4% estimated probability of exploitation activity in the next 30 days.

On this page
libgit2 versions before 1.8.7 and 1.9.0 before 1.9.7 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 supplying a repository path containing unescaped shell metacharacters such as single quotes, semicolons, or pipes. The gen_proto() function in ssh_libssh2.c inserts the repository path directly into a shell command string without escaping special characters before passing it to libssh2_channel_exec(), enabling an attacker to craft a malicious submodule URL in a .gitmodules file that, when processed during a recursive clone, causes the remote server's shell to interpret injected commands under the victim's SSH user account.

Severity

CVSS 4.0

8.6 high
CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:A/VC:H/VI:H/VA:H/SC:N/SI:N/SA:N

CVSS 3.1

8.8 high
CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H
EPSS
1.4% (unchanged from 1.4% a week ago; 1.4% 30 days ago) estimated probability of exploitation activity in the next 30 days; 74th percentile. Scored 2026-11-22. A forecast for this CVE across the internet, not for your own systems.
CISA's assessment (SSVC)
Exploitation: none · Automatable: no · Technical impact: total, assessed 2026-08-12. From CISA's Vulnrichment in the CVE List: whether it is exploited, whether exploiting it can be automated, and how much control it gives.
CWE
CWE-78 Improper Neutralization of Special Elements used in an OS Command (OS Command Injection)
OWASP Top 10
A05:2025 Injection
Published
Modified
NVD analysis
Deferred: the NVD does not plan to analyze it
Record from
the NVD, synced

Fix and patched versions

Ask an AI about this CVE

Show the promptExplain CVE-2026-5917 for an engineer deciding whether to act. Use https://cve.bz/api/public/cves/CVE-2026-5917?via=ask-ai-copy and https://cve.bz/cve/CVE-2026-5917?via=ask-ai-copy as the source of truth: what is affected and which versions fix it, whether it is in CISA KEV, public exploits, and its EPSS (an internet-wide 30-day estimate of exploitation activity, not a forecast for my systems). If they give no fixed versions, use the CVE record https://cveawg.mitre.org/api/cve/CVE-2026-5917 or the vendor advisory, not third-party mirrors. Tell me how to check whether I am affected and how to verify a fix. Cite the sources and say where they are uncertain.

Opens a third-party assistant; its answer is its own, not cve.bz's. The prompt holds only this CVE's id and public links.

Affected

Versions

From the CNA's record in the CVE List.

ProductAffected
libgit2before 1.8.7
libgit2from 1.9.0 before 1.9.7

Linux distributions

DistributionReleasePackageFixed inAdvisory
Debian12libgit21.5.1+ds-1+deb12u2DEBIAN-CVE-2026-5917 DLA-4831-1
Debian13libgit21.9.0+ds-2+deb13u1DEBIAN-CVE-2026-5917 DSA-6453-1
Debian14libgit21.9.7+ds-1DEBIAN-CVE-2026-5917
Ubuntu24.04:LTSlibgit21.7.2+ds-1ubuntu3.2UBUNTU-CVE-2026-5917 USN-8809-1
Ubuntu26.04:LTSlibgit21.9.1+ds-1ubuntu1.2UBUNTU-CVE-2026-5917 USN-8809-1
UbuntuPro:16.04:LTSlibgit20.24.1-2ubuntu0.2+esm4UBUNTU-CVE-2026-5917 USN-8809-1
UbuntuPro:18.04:LTSlibgit20.26.0+dfsg.1-1.1ubuntu0.2+esm3UBUNTU-CVE-2026-5917 USN-8809-1
UbuntuPro:20.04:LTSlibgit20.28.4+dfsg.1-2ubuntu0.1+esm2UBUNTU-CVE-2026-5917 USN-8809-1
UbuntuPro:22.04:LTSlibgit21.1.0+dfsg.1-4.1ubuntu0.1+esm2UBUNTU-CVE-2026-5917 USN-8809-1
openSUSETumbleweedlibgit21.9.7-1.1openSUSE-SU-2026:11521-1
Alpinev3.23, v3.24libgit21.9.7-r0ALPINE-CVE-2026-5917
Alpaquita25, streamlibgit21.9.7-r0BELL-CVE-2026-5917

From the distributions' data via OSV.dev: the Debian Security Tracker; Ubuntu Security Notices © Canonical Ltd., CC BY-SA 4.0; SUSE security data, CC BY 4.0; the Alpine secdb, CC BY-SA 4.0; BellSoft's OSV database, MIT. Modified: reformatted and linked to CVE records. Credits. On the distributions' own pages: Debian · Ubuntu · openSUSE · Alpine · Alpaquita.

Red Hat

Red Hat rates this Important.

Red Hat's statement

This is an Important flaw. Red Hat products utilizing libgit2 with the libssh2 SSH backend are susceptible to remote arbitrary code execution. This occurs when processing a maliciously crafted repository path containing unescaped shell metacharacters during a recursive clone operation, allowing an attacker to inject and execute commands on the SSH server under the victim's user account.

Red Hat's mitigation

To mitigate this issue, avoid cloning Git repositories from untrusted sources, especially those containing submodules. If possible, disable automatic recursive cloning of submodules when working with potentially untrusted repositories. Ensure that SSH user accounts used for cloning have minimal necessary privileges to limit the impact of successful exploitation.

ProductPackageStateAdvisory
Red Hat Enterprise Linux 10rustNot affected
Red Hat Enterprise Linux 8libgit2Not affected
Red Hat Enterprise Linux 9rustNot affected
Red Hat Enterprise Linux AI (RHEL AI) 3libgit2Affected
Red Hat Enterprise Linux AI (RHEL AI) 3rustNot affected
Red Hat Hardened Imageslibgit2Not affected

Contains Red Hat Security Data © Red Hat, Inc., licensed under CC BY 4.0. Source: https://access.redhat.com/security/data. Modified: reformatted. Red Hat's page for CVE-2026-5917.

Attack patterns (CAPEC)

  • CAPEC-6 Argument Injection Likelihood: High · Severity: High
  • CAPEC-15 Command Delimiters Likelihood: High · Severity: High
  • CAPEC-43 Exploiting Multiple Input Interpretation Layers Likelihood: Medium · Severity: High
  • CAPEC-88 OS Command Injection Likelihood: High · Severity: High
  • CAPEC-108 Command Line Execution through SQL Injection Likelihood: Low · Severity: Very High

The attack patterns MITRE's CAPEC relates to this record's weaknesses, as MITRE names them. Credits.

References

Check your stackJSON