Skip to main content
No exploitation reportedFix available

CVE-2026-5917

No exploitation reported by the sources we read.

  • Published2026-08-11
  • WeaknessCWE-78

Am I affected?

With a domain, we read the version its public headers and pages expose. A distribution build can carry the fix under an older number.

Description

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.

Timeline

dates in UTC
  1. 2026-08-1122:17CVE publishedNVD

Versions per branch

Products declared by the CNA1 product

As VulnCheck, the CNA that assigned this CVE, declared them in the CVE record; versions as written.

  • libgit2other versions: affected
    Affected
    • < 1.8.7fixed in 1.8.7custom
    • ≥ 1.9.0, < 1.9.7fixed in 1.9.7semver

Source: the CNA record (CVE Program), © The MITRE Corporation,CVE Terms of UseCVE recordupdated 2026-10-01

Distribution builds and vendor advisories

Packages from OSV.dev and products from the vendors' CSAF advisories.

version not verifiedVersions not verified: read as OSV.dev and the vendors publish them, not checked against each vendor's release list.

Packages

  • LibGit2_jllJuliaall versions · fixed in 1.9.1+0
  • libgit2Ubuntu:Pro:22.04:LTSall versions · fixed in 1.1.0+dfsg.1-4.1ubuntu0.1+esm2
  • libgit2Ubuntu:Pro:20.04:LTSall versions · fixed in 0.28.4+dfsg.1-2ubuntu0.1+esm2
  • libgit2Ubuntu:Pro:18.04:LTSall versions · fixed in 0.26.0+dfsg.1-1.1ubuntu0.2+esm3
  • libgit2Ubuntu:Pro:16.04:LTSall versions · fixed in 0.24.1-2ubuntu0.2+esm4
  • libgit2Ubuntu:26.04:LTSall versions · fixed in 1.9.1+ds-1ubuntu1.2
  • libgit2Ubuntu:24.04:LTSall versions · fixed in 1.7.2+ds-1ubuntu3.2
  • libgit2openSUSE:Tumbleweedall versions · fixed in 1.9.7-1.1

13 more package ranges on OSV.dev

Vendor advisories

  • CVE-2026-5917 Red Hat Product Security1 known affected

    libgit2: libgit2: Arbitrary code execution via shell command injection in SSH backend

    libgit2.src as a component of Red Hat Enterprise Linux AI (RHEL AI) 3

Full record on NVD

Fix

  1. Workaround from the vendor Red Hat Product Security CVE-2026-5917 · 1 productTo 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 nec…
  2. No fix available, says the vendor Red Hat Product Security CVE-2026-5917 · 1 productAffected

Detection

Nuclei template
none so far
ProjectDiscovery
Exploit-DB
no entry
Exploit-DB
Proof of concept
Metasploit modules
none listed
Metasploit Framework

Sources

Identifiers

Technical details

CVSS v3 Vector
CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H
CVSS 4.0 vector
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/E:X/CR:X/IR:X/AR:X/MAV:X/MAC:X/MAT:X/MPR:X/MUI:X/MVC:X/MVI:X/MVA:X/MSC:X/MSI:X/MSA:X/S:X/AU:X/R:X/V:X/RE:X/U:X
Published
2026-08-11
Last Modified
2026-09-24
NVD status
Deferred
GitHub Advisory
GHSA-3gwr-xcwq-7892

Frequently asked questions

What is CVE-2026-5917?

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.

Is CVE-2026-5917 actively exploited?

Active exploitation of CVE-2026-5917 has not been confirmed. Its EPSS score was 1.4% on 2026-11-18, the estimated probability of exploitation in the next 30 days.

What is the CVSS score for CVE-2026-5917?

CVE-2026-5917 has a CVSS v3 base score of 8.8 (HIGH severity), with vector string CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H.

Running libgit2? Hear about its next vulnerability

Surveillance reads the versions in your stack — a domain, a lockfile or a list — checks each CVE against the ranges its sources publish, and alerts you when one you run is exploited or enters CISA KEV. A version it cannot read stays « version not verified ».

No credit card required · No monthly cap on website lookups · 250 API requests/month

Sources for this record