Track vulnerabilities like this one.
Sign up free to get alerted when software you use is affected.
9.9
libgit2 allows remote command execution via malicious repository path
published 3 days ago
Summary
Versions of libgit2 older than 1.8.7 and 1.9.7 (when built with the libssh2 SSH option) can run unwanted commands on an SSH server if a specially crafted repository path is used. This can happen during a recursive clone that reads a malicious .gitmodules file. Update libgit2 to the latest release or rebuild it without the libssh2 SSH backend to eliminate the risk.
What to do
- Update openeuler libgit2 to version 1.3.2-4.oe2203sp4.
Affected software
| Ecosystem | Vendor | Product | Affected versions |
|---|---|---|---|
| openEuler:22.03-LTS-SP4 | openeuler | libgit2 |
< 1.3.2-4.oe2203sp4 Fix: upgrade to 1.3.2-4.oe2203sp4
|
Original advisory text
libgit2 security update
libgit2 is a portable, pure C implementation of the Git core methods provided as a re-entrant linkable library with a solid API, allowing you to write native speed custom Git applications in any language which supports C bindings.
Security Fix(es):
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.(CVE-2026-5917)
Security Fix(es):
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.(CVE-2026-5917)
References
- https://www.openeuler.org/zh/security/security-bulletins/detail/?id=openEuler-SA... Vendor Advisory
- https://nvd.nist.gov/vuln/detail/CVE-2026-5917 Vendor Advisory
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)
Timeline
Published19 Nov 2026
Updated19 Nov 2026
First seen19 Nov 2026
Sources
OESA-2026-4959 · OSV
Track software like this
Free during beta