CVE-2026-5917: libgit2 v0.27.0-v1.9.0 Shell Command Injection via ssh_libssh2 Backend
libgit2 versions v0.27.0 through v1.9.0 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.
Security readout for executives and security teams
Plain-English summary
Affected software can turn a malicious Git submodule address into commands executed on an SSH server using the victim’s account. Exploitation requires a vulnerable libgit2 build and user-triggered processing, such as a recursive clone. Successful attacks could compromise data, systems, and availability on the SSH server.
Executive priority
Treat confirmed vulnerable configurations as an urgent remediation priority, especially in CI/CD, developer tooling, or services processing untrusted repositories. Prioritize configuration discovery first because the issue depends on the libssh2 backend and a specific workflow. Do not represent exploitation as active based on the supplied evidence.
Technical view
The reported flaw is in ssh_libssh2.c gen_proto(). In libgit2 built with USE_SSH=libssh2, an attacker-controlled repository path is inserted into a command without safely escaping shell metacharacters before libssh2_channel_exec(). A crafted .gitmodules SSH URL processed during a recursive clone can therefore cause shell command injection on the remote SSH server.
Likely exposure
Exposure is limited to applications embedding reportedly affected libgit2 versions, compiled with the libssh2 SSH backend, that process attacker-influenced SSH repository or submodule paths. Recursive cloning of untrusted repositories is the clearest reported trigger. Builds using another SSH backend are not established as affected by this source bundle.
Exploitation context
The CVSS 3.1 score is 9.6, reflecting potential high confidentiality, integrity, and availability impact. User interaction is required, but no privileges are required to prepare the malicious repository metadata. The bundle marks this CVE as absent from KEV and provides no evidence of active exploitation.
Researcher notes
The narrative reports versions 0.27.0 through 1.9.0, while the structured affected entry lists only 0.27.0. Validate the authoritative affected range and fixed release with updated CVE or vendor guidance. The reported execution context is the remote SSH server under the victim’s SSH account, not necessarily the cloning client.
Mitigation direction
Identify and prioritize systems using libgit2 with the libssh2 SSH backend.
Avoid recursive cloning or submodule processing for untrusted repositories until remediation is confirmed.
Restrict attacker-controlled SSH repository and submodule URLs in affected workflows.
Apply vendor-confirmed fixes when available; the supplied sources do not name a patched version.
Review vendor guidance before changing SSH backends or rebuilding libgit2.
Validation and detection
Inventory embedded libgit2 versions across developer tools, services, build agents, and automation.
Verify whether each libgit2 build uses USE_SSH=libssh2.
Identify workflows performing recursive clones or processing untrusted .gitmodules files.
Review accepted SSH repository paths and determine whether untrusted users can influence them.
Inspect relevant SSH server telemetry for anomalous activity associated with clone or submodule operations.
Generated from the cited source records. This long-tail analysis has not been individually reviewed by a named human.
Potential ATT&CK relevance
Conservative CVE-to-ATT&CK context
These mappings and lookup hints may be relevant to the vulnerability behavior, CWE, affected product, or exposure path. Glexia-inferred context is not an official MITRE, ATT&CK, CWE, or CVE Program mapping.
ATT&CK lookup starting points
Use these exact CWE pages and searches to review the Glexia ATT&CK library from this CVE's weakness and description context.
cwe · medium confidence lookup
CWE-78: Command execution behavior lookup
Command injection weaknesses can lead defenders to review execution techniques and command interpreter telemetry. Open the exact CWE lookup page first, then review the ATT&CK searches from that MITRE weakness context. This is a Glexia lookup hint, not an official ATT&CK mapping.
The CVE wording references code or command execution, so execution technique review may help defensive triage. This is a Glexia inferred lookup path, not an official MITRE, ATT&CK, or CVE Program mapping.
These fields come from the CVE record and ADP containers, not from Glexia's Take. They preserve time-varying source decisions such as CISA SSVC, KEV status, CVSS metrics, and provider references.
2CVSS vectors
3Timeline events
1ADP providers
3Source links
SSVC decision data
CISA-ADPCISA Coordinator
Timestamp
Version
2.0.3
Exploitation: noneAutomatable: noTechnical Impact: total
CVSS vector scores
2 official scores
We collect every scored CVSS vector available in the official CNA and ADP containers. When more than one version is present, the table keeps the source vectors side by side instead of collapsing them into the highest score.