Impact
The flaw exists in libgit2 versions before 1.8.7 and 1.9.0 before 1.9.7 when built with the libssh2 SSH backend. A vulnerable libgit2 implementation constructs a shell command by embedding a repository path directly into a string that is later executed by libssh2. An attacker can place shell metacharacters in the path, such as quotes, semicolons, or pipes, causing the command to be misinterpreted by the remote shell. The result is that the attacker can run arbitrary commands on the target SSH server under the victim’s user account. The weakness is a classic command injection (CWE-78, shell command injection). This flaw can be exploited during the processing of submodule URLs in a .gitmodules file during a recursive clone, making the impact wide and potentially system‑wide on the affected host.
Affected Systems
libgit2 versions earlier than 1.8.7 and 1.9.0 prior to 1.9.7 built with the libssh2 backend (USE_SSH=libssh2) are affected. No other vendor or product versions are listed as impacted.
Risk and Exploitability
The CVSS score of 8.6 indicates a high severity. The EPSS is less than 1 %, suggesting a low current exploitation probability, but this does not reduce the risk of a future attack. The issue is not listed in the CISA KEV catalog. The attack requires the attacker to supply a malicious submodule URL or repository path to a client that performs a recursive clone. If the client is run by a privileged user or provides access to critical resources, the attacker can gain arbitrary code execution on the remote SSH server.
OpenCVE Enrichment
Debian DSA