Skip to main content
EPSS 1.4%top 28%

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… (CVE-2026-5917)

0
Medium
Published: 08/11/2026 (08/11/2026, 22:17:00 UTC)
Source: GCVE Database
Product: libgit2

Description

libgit2 versions before 1.8.7 and 1.9.0 before 1.9.7 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. The vulnerability arises because the repository path is inserted directly into a shell command without proper escaping, enabling command injection during recursive clone operations involving malicious submodule URLs.

CVSS v3.1

Score 8.8high

Attack Vector
Network
Attack Complexity
Low
Privileges Required
None
User Interaction
Required
Scope
Unchanged
Confidentiality
High
Integrity
High
Availability
High
CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H

Affected software

GitHub Actionsmore threats →ai
libgit2/libgit2
pkg:github/libgit2/libgit2
Affected versions
>=0.27.0 <=1.9.0
Ubuntu:Pro:16.04:LTSmore threats →ghsa
libgit2
pkg:deb/ubuntu/libgit2?arch=source&distro=esm-apps-legacy/xenial
Affected versions
=0.22.2-2=0.23.1-1=0.24.1-2=0.24.1-2ubuntu0.2=0.24.1-2ubuntu0.2+esm1=0.24.1-2ubuntu0.2+esm2=0.24.1-2ubuntu0.2+esm3=0.24.1-2ubuntu0.2+esm4
Ubuntu:Pro:18.04:LTSmore threats →ghsa
libgit2
pkg:deb/ubuntu/libgit2?arch=source&distro=esm-apps/bionic
Affected versions
=0.25.1+really0.24.6-1=0.26.0+dfsg.1-1.1=0.26.0+dfsg.1-1.1build1=0.26.0+dfsg.1-1.1ubuntu0.2=0.26.0+dfsg.1-1.1ubuntu0.2+esm1=0.26.0+dfsg.1-1.1ubuntu0.2+esm2=0.26.0+dfsg.1-1.1ubuntu0.2+esm3
Ubuntu:Pro:20.04:LTSmore threats →ghsa
libgit2
pkg:deb/ubuntu/libgit2?arch=source&distro=esm-apps/focal
Affected versions
=0.27.7+dfsg.1-0.2build1=0.28.3+dfsg.1-1=0.28.3+dfsg.1-1ubuntu1=0.28.4+dfsg.1-2=0.28.4+dfsg.1-2ubuntu0.1=0.28.4+dfsg.1-2ubuntu0.1+esm1=0.28.4+dfsg.1-2ubuntu0.1+esm2
Ubuntu:Pro:22.04:LTSmore threats →ghsa
libgit2
pkg:deb/ubuntu/libgit2?arch=source&distro=esm-apps/jammy
Affected versions
=1.1.0+dfsg.1-4=1.1.0+dfsg.1-4.1=1.1.0+dfsg.1-4.1build1=1.1.0+dfsg.1-4.1ubuntu0.1=1.1.0+dfsg.1-4.1ubuntu0.1+esm1=1.1.0+dfsg.1-4.1ubuntu0.1+esm2
Ubuntu:24.04:LTSmore threats →ghsa
libgit2
pkg:deb/ubuntu/libgit2?arch=source&distro=noble
Affected versions
=1.5.1+ds-1ubuntu1=1.7.1+ds-2ubuntu1=1.7.2+ds-1ubuntu1=1.7.2+ds-1ubuntu2=1.7.2+ds-1ubuntu3=1.7.2+ds-1ubuntu3.1=1.7.2+ds-1ubuntu3.2
Ubuntu:26.04:LTSmore threats →ghsa
libgit2
pkg:deb/ubuntu/libgit2?arch=source&distro=resolute
Affected versions
=1.9.0+ds-2ubuntu2=1.9.1+ds-1ubuntu1=1.9.1+ds-1ubuntu1.1=1.9.1+ds-1ubuntu1.2

Run on your own infrastructure? Check whether these packages are installed with threat-finder — our free open-source scanner.

AI-Powered Analysis

Machine-generated threat intelligence

AILast updated: 09/24/2026, 08:28:17 UTC

Technical Analysis

CVE-2026-5917 affects libgit2 versions prior to 1.8.7 and 1.9.0 prior to 1.9.7 when built with the libssh2 SSH backend (USE_SSH=libssh2). The vulnerability is a shell command injection in the gen_proto() function within ssh_libssh2.c, where the repository path is embedded directly into a shell command string without escaping special characters before passing it to libssh2_channel_exec(). An attacker can craft a malicious submodule URL in a .gitmodules file that, when processed during a recursive clone, causes the remote SSH server's shell to execute arbitrary commands under the victim's SSH user account.

Potential Impact

Successful exploitation allows remote attackers to execute arbitrary shell commands on the SSH server under the victim's SSH user account. This can lead to full compromise of the server's privileges accessible to that user, including data theft, system manipulation, or further lateral movement. The CVSS 3.1 score is 8.8, indicating a high severity impact with network attack vector, low attack complexity, no privileges required, user interaction required, and high confidentiality, integrity, and availability impacts.

Mitigation Recommendations

A fix is available in libgit2 versions 1.8.7 and 1.9.7 and later. Users should upgrade to these or newer versions to remediate this vulnerability. Until patched, avoid using vulnerable versions built with the libssh2 SSH backend or do not process untrusted repository paths containing shell metacharacters. No vendor advisory content was provided to indicate alternative mitigations or that the issue is already mitigated.

Pro Console: star threats, build custom feeds, automate alerts via Slack, email & webhooks.Upgrade to Pro

Technical Details

Gcve Source
db.gcve.eu
Osv Id
GHSA-3gwr-xcwq-7892
Osv Schema Version
1.4.0
Aliases
["CVE-2026-5917"]
Database Specific Severity
CRITICAL
Cvss Version
3.1

Threat ID: 6a7c9b6bbf8831d539cdfc11

Added to database: 08/12/2026, 16:12:27 UTC

Last enriched: 09/24/2026, 08:28:17 UTC

Last updated: 09/25/2026, 01:47:43 UTC

Views: 26

Community Reviews

0 reviews

Crowdsource mitigation strategies, share intel context, and vote on the most helpful responses. Sign in to add your voice and help keep defenders ahead.

Sort by
Loading community insights…

Want to contribute mitigation steps or threat intel context? Sign in or create an account to join the community discussion.

Actions

PRO

Updates to AI analysis require Pro Console access. Upgrade inside Console → Billing.

Please log in to the Console to use AI analysis features.

Need more coverage?

Upgrade to Pro Console for AI refresh and higher limits.

For incident response and remediation, OffSeq services can help resolve threats faster.

Latest Threats

Breach by OffSeqOFFSEQFRIENDS — 25% OFF

Check if your credentials are on the dark web

Instant breach scanning across billions of leaked records. Free tier available.

Scan now
OffSeq TrainingCredly Certified

Lead Pen Test Professional

Technical5-day eLearningPECB Accredited
View courses