Advisory Database
  • Advisories
  • Dependency Scanning
  1. golang
  2. ›
  3. github.com/go-git/go-git/v5
  4. ›
  5. CVE-2026-71557

CVE-2026-71557: go-git: Malicious reference names may modify files outside the reference storage

August 7, 2026

A path traversal issue in go-git could allow malicious reference names to access files outside the repository’s intended reference storage.

Loose references are stored under .git/<reference-name>. The reference name was previously used as a path without verifying that the resolved path remained within the reference storage. A name such as refs/heads/../../config could therefore resolve to unrelated repository metadata such as .git/config or .git/HEAD.

A malicious Git server could advertise such a reference name. The name may also survive refspec mapping; for example, it could be mapped to refs/remotes/origin/../../config during a clone or fetch operation.

This vulnerability affects filesystem-backed repositories using the storage/filesystem package and its dotgit reference storage. Users relying exclusively on the in-memory storage implementation, storage/memory, are not affected, because reference names are not resolved as filesystem paths.

Exploitation requires an application using go-git with filesystem-backed storage to interact with a malicious Git server or otherwise process attacker-controlled reference names.

References

  • github.com/advisories/GHSA-qgq7-7hm3-q39j
  • github.com/go-git/go-git/commit/4a0e66d555de5f9a30c31e2df64f445f42bd01e7
  • github.com/go-git/go-git/commit/da9f7d8a0e98b475600177348d6ece384a370f36
  • github.com/go-git/go-git/pull/2247
  • github.com/go-git/go-git/pull/2254
  • github.com/go-git/go-git/releases/tag/v5.19.2
  • github.com/go-git/go-git/releases/tag/v6.0.0-alpha.5
  • github.com/go-git/go-git/security/advisories/GHSA-qgq7-7hm3-q39j
  • nvd.nist.gov/vuln/detail/CVE-2026-71557

Code Behaviors & Features

Detect and mitigate CVE-2026-71557 with GitLab Dependency Scanning

Secure your software supply chain by verifying that all open source dependencies used in your projects contain no disclosed vulnerabilities. Learn more about Dependency Scanning →

Affected versions

All versions before 5.19.2

Fixed versions

  • 5.19.2

Solution

Upgrade to version 5.19.2 or above.

Impact 6.3 MEDIUM

CVSS:3.1/AV:N/AC:L/PR:L/UI:R/S:U/C:N/I:H/A:L

Learn more about CVSS

Weakness

  • CWE-22: Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal')

Source file

go/github.com/go-git/go-git/v5/CVE-2026-71557.yml

Spotted a mistake? Edit the file on GitLab.

  • Site Repo
  • About GitLab
  • Terms
  • Privacy Statement
  • Contact

Page generated Sat, 05 Sep 2026 12:17:06 +0000.