CVE-2026-5917: libgit2 Shell Command Injection via ssh_libssh2 Backend

Published Aug 11, 2026
·
Updated

Last updated 24 September 2026

Other sources

libgit2 versions before 1.8.7 and 1.9.0 before 1.9.7 built with the libssh2 SSH backend (USESSH=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 genproto() function in sshlibssh2.c inserts the repository path directly into a shell command string without escaping special characters before passing it to libssh2channelexec(), 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.

— MITRE

Affected Software

2 affected componentsFixes available
libgit2 libgit2<1.8.7, >=1.9.0<1.9.7
debian/libgit2<=1.5.1+ds-1+deb12u1
1.9.0+ds-2+deb13u11.9.7+ds-1

Remediation

Recommended actions to resolve this vulnerability, in priority order.

  1. Upgrade

    Upgrade debian/libgit2 to a version that resolves this vulnerability.

    Fixed in 1.9.0+ds-2+deb13u1Fixed in 1.9.7+ds-1
  2. Upgrade

    Upgrade libgit2 to a version that resolves this vulnerability.

    Fixed in 1.8.7

Event History

Aug 11, 2026
CVE Published
via MITRE·09:40 PM
Data Sourced
via MITRE·09:40 PM
DescriptionSeverityWeakness
Data Sourced
via NVD·10:17 PM
DescriptionSeverityWeakness
Sep 24, 2026
Data Sourced
via Ubuntu·11:04 PM
RemedyDescriptionSeverityAffected Software
Data Sourced
via Debian·11:06 PM
DescriptionAffected Software
Data Sourced
via Launchpad·11:06 PM
Description

Frequently Asked Questions

1

What is the severity of CVE-2026-5917?

CVE-2026-5917 has a critical severity rating of 9.6.

2

How do I fix CVE-2026-5917?

To mitigate CVE-2026-5917, upgrade libgit2 to version 1.9.1 or later.

3

What causes the CVE-2026-5917 vulnerability?

CVE-2026-5917 is caused by a shell command injection vulnerability in libgit2 when using the libssh2 backend.

4

Who is affected by CVE-2026-5917?

All users of libgit2 versions v0.27.0 through v1.9.0 built with the libssh2 SSH backend are affected by CVE-2026-5917.

5

Can CVE-2026-5917 lead to remote code execution?

Yes, CVE-2026-5917 allows remote attackers to execute arbitrary commands on an SSH server.

Contact

SecAlerts Pty Ltd.
132 Wickham Terrace
Fortitude Valley,
QLD 4006, Australia
info@secalerts.co
By using SecAlerts services, you agree to our services end-user license agreement. This website is safeguarded by reCAPTCHA and governed by the Google Privacy Policy and Terms of Service. All names, logos, and brands of products are owned by their respective owners, and any usage of these names, logos, and brands for identification purposes only does not imply endorsement. If you possess any content that requires removal, please get in touch with us.
© 2026 SecAlerts Pty Ltd.
ABN: 70 645 966 203, ACN: 645 966 203