Track vulnerabilities like this one. Sign up free to get alerted when software you use is affected.
9.9

libgit2 lets attacker run commands via crafted repository path

published 10 days ago
Summary

If you use libgit2 versions earlier than 1.8.7 or 1.9.0‑1.9.6 with the libssh2 SSH option, an attacker can embed special characters in a repository URL and cause the server to execute unwanted commands. This can happen when a malicious .gitmodules file is processed during a recursive clone, affecting Docker images that include this library. Upgrade libgit2 to the latest release or rebuild it without the libssh2 SSH backend, and avoid accepting untrusted repository paths.

What to do

The CVE record does not list a fixed version. Check the vendor's site or the advisory links below - a fix may already be released.

Affected software
Ecosystem VendorProductAffected versions
Docker Hardened Images:Alpine:3.24 docker hardened images libgit2 All versions
Original advisory text
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…
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.
Fix within
Internet-facing 14 days
Internal At next upgrade
  • Not known to be exploited
  • Needs hands-on effort to exploit (estimated)
  • Gives an attacker full control (estimated)
Severity
9.9 Critical
Timeline
Published11 Nov 2026
Updated16 Nov 2026
First seen16 Nov 2026
Sources
Track software like this
Free during beta