Skip to content
Heist/ feed
Back to feed
HighFix available

libgit2 — security advisory

Type: advisorySources: OSVAdvisory ID: DEBIAN-CVE-2026-5917

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.

Products
libgit2
Affected versions
1.5.1+ds-1, 1.5.1+ds-1+deb12u1, 1.9.0+ds-2, 1.9.1+ds-1, 1.9.2+ds-1, 1.9.2+ds-2, 1.9.2+ds-3, 1.9.2+ds-4, 1.9.2+ds-5, 1.9.2+ds-6, 1.9.2+ds-7, 1.9.2+ds-8, 1.9.2+ds-9, 1.9.3+ds-1, 1.9.4+ds-1, 1.9.6+ds-1
Fixed versions
1.5.1+ds-1+deb12u2, 1.9.0+ds-2+deb13u1, 1.9.7+ds-1
CVEs
CVE-2026-5917
Confirmed fixed CVEs
Not specified
Updated in this feed
30 Oct 2026, 06:39 UTC · Revision 1

Source evidence

DEBIAN-CVE-2026-5917

core-osv · Original source

Published 11 Aug 2026, 22:17 UTC

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.

osv:DEBIAN-CVE-2026-5917

libgit2

Fixed versions: 1.5.1+ds-1+deb12u2

libgit2

Fixed versions: 1.9.0+ds-2+deb13u1

libgit2

Fixed versions: 1.9.7+ds-1

Complete source record
{
  "id": "bac451c6f38d481f49a36de10155658bde2a3ecf030604a668f56aae1194b3fe",
  "url": "https://osv.dev/vulnerability/DEBIAN-CVE-2026-5917",
  "method": "structured",
  "payload": {
    "kind": "advisory",
    "title": "DEBIAN-CVE-2026-5917",
    "summary": "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.",
    "evidence": "osv:DEBIAN-CVE-2026-5917",
    "products": [
      {
        "name": {
          "value": "libgit2",
          "evidence": "/affected/0/package/name"
        },
        "prerequisites": [],
        "fixed_versions": [
          {
            "value": "1.5.1+ds-1+deb12u2",
            "evidence": "/affected/0/ranges"
          }
        ],
        "affected_versions": [
          {
            "value": "1.5.1+ds-1",
            "evidence": "/affected/0/versions"
          },
          {
            "value": "1.5.1+ds-1+deb12u1",
            "evidence": "/affected/0/versions"
          }
        ]
      },
      {
        "name": {
          "value": "libgit2",
          "evidence": "/affected/1/package/name"
        },
        "prerequisites": [],
        "fixed_versions": [
          {
            "value": "1.9.0+ds-2+deb13u1",
            "evidence": "/affected/1/ranges"
          }
        ],
        "affected_versions": [
          {
            "value": "1.9.0+ds-2",
            "evidence": "/affected/1/versions"
          }
        ]
      },
      {
        "name": {
          "value": "libgit2",
          "evidence": "/affected/2/package/name"
        },
        "prerequisites": [],
        "fixed_versions": [
          {
            "value": "1.9.7+ds-1",
            "evidence": "/affected/2/ranges"
          }
        ],
        "affected_versions": [
          {
            "value": "1.9.0+ds-2",
            "evidence": "/affected/2/versions"
          },
          {
            "value": "1.9.1+ds-1",
            "evidence": "/affected/2/versions"
          },
          {
            "value": "1.9.2+ds-1",
            "evidence": "/affected/2/versions"
          },
          {
            "value": "1.9.2+ds-2",
            "evidence": "/affected/2/versions"
          },
          {
            "value": "1.9.2+ds-3",
            "evidence": "/affected/2/versions"
          },
          {
            "value": "1.9.2+ds-4",
            "evidence": "/affected/2/versions"
          },
          {
            "value": "1.9.2+ds-5",
            "evidence": "/affected/2/versions"
          },
          {
            "value": "1.9.2+ds-6",
            "evidence": "/affected/2/versions"
          },
          {
            "value": "1.9.2+ds-7",
            "evidence": "/affected/2/versions"
          },
          {
            "value": "1.9.2+ds-8",
            "evidence": "/affected/2/versions"
          },
          {
            "value": "1.9.2+ds-9",
            "evidence": "/affected/2/versions"
          },
          {
            "value": "1.9.3+ds-1",
            "evidence": "/affected/2/versions"
          },
          {
            "value": "1.9.4+ds-1",
            "evidence": "/affected/2/versions"
          },
          {
            "value": "1.9.6+ds-1",
            "evidence": "/affected/2/versions"
          }
        ]
      }
    ],
    "severity": "high",
    "structured": {
      "id": "DEBIAN-CVE-2026-5917",
      "aliases": [
        "DEBIAN-CVE-2026-5917"
      ],
      "metrics": [
        {
          "type": "CVSS_V3",
          "score": "CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H"
        }
      ],
      "affected": [
        {
          "ranges": [
            {
              "type": "ECOSYSTEM",
              "events": [
                {
                  "introduced": "0"
                },
                {
                  "fixed": "1.5.1+ds-1+deb12u2"
                }
              ]
            }
          ],
          "package": {
            "name": "libgit2",
            "purl": "pkg:deb/debian/libgit2?arch=source&distro=bookworm",
            "ecosystem": "Debian:12"
          },
          "versions": [
            "1.5.1+ds-1",
            "1.5.1+ds-1+deb12u1"
          ],
          "database_specific": {
            "source": "https://storage.googleapis.com/debian-osv/debian-cve-osv/DEBIAN-CVE-2026-5917.json"
          },
          "ecosystem_specific": {
            "urgency": "not yet assigned"
          }
        },
        {
          "ranges": [
            {
              "type": "ECOSYSTEM",
              "events": [
                {
                  "introduced": "0"
                },
                {
                  "fixed": "1.9.0+ds-2+deb13u1"
                }
              ]
            }
          ],
          "package": {
            "name": "libgit2",
            "purl": "pkg:deb/debian/libgit2?arch=source&distro=trixie",
            "ecosystem": "Debian:13"
          },
          "versions": [
            "1.9.0+ds-2"
          ],
          "database_specific": {
            "source": "https://storage.googleapis.com/debian-osv/debian-cve-osv/DEBIAN-CVE-2026-5917.json"
          },
          "ecosystem_specific": {
            "urgency": "not yet assigned"
          }
        },
        {
          "ranges": [
            {
              "type": "ECOSYSTEM",
              "events": [
                {
                  "introduced": "0"
                },
                {
                  "fixed": "1.9.7+ds-1"
                }
              ]
            }
          ],
          "package": {
            "name": "libgit2",
            "purl": "pkg:deb/debian/libgit2?arch=source&distro=forky",
            "ecosystem": "Debian:14"
          },
          "versions": [
            "1.9.0+ds-2",
            "1.9.1+ds-1",
            "1.9.2+ds-1",
            "1.9.2+ds-2",
            "1.9.2+ds-3",
            "1.9.2+ds-4",
            "1.9.2+ds-5",
            "1.9.2+ds-6",
            "1.9.2+ds-7",
            "1.9.2+ds-8",
            "1.9.2+ds-9",
            "1.9.3+ds-1",
            "1.9.4+ds-1",
            "1.9.6+ds-1"
          ],
          "database_specific": {
            "source": "https://storage.googleapis.com/debian-osv/debian-cve-osv/DEBIAN-CVE-2026-5917.json"
          },
          "ecosystem_specific": {
            "urgency": "not yet assigned"
          }
        }
      ],
      "modified": "2026-10-12T17:00:08.757328055Z",
      "provider": "osv",
      "upstream": [
        "CVE-2026-5917"
      ],
      "references": [
        "https://security-tracker.debian.org/tracker/CVE-2026-5917"
      ]
    },
    "related_cves": [
      {
        "value": "CVE-2026-5917",
        "evidence": "/upstream"
      }
    ],
    "security_relevant": true,
    "severity_evidence": "/severity/0/score"
  },
  "source_id": "core-osv",
  "document_id": 300061,
  "published_at": "2026-08-11T22:17:37.39+00:00"
}