Description
go-git is an extensible git implementation library written in pure Go. Prior to 5.19.2 and 6.0.0-alpha.5, reference names are not sanitized before being used to construct on-disk paths under the reference storage directory, so a maliciously crafted reference name (for example containing directory-traversal sequences) can cause go-git to write files outside the intended reference storage directory. Versions 5.19.2 and 6.0.0-alpha.5 fix the issue.
Published: 2026-08-07
Score: 6.3 Medium
EPSS: n/a
KEV: No
Impact: n/a
Action: n/a
AI Analysis

Impact

go‑git is a pure‑Go implementation of Git. Prior to releases 5.19.2 and 6.0.0‑alpha.5, reference names supplied by a caller are not validated before they are combined to form on‑disk paths under the reference storage directory. A specially crafted reference name that contains directory‑traversal segments can therefore cause the library to write arbitrary files outside that directory, potentially overwriting or creating sensitive files. The vulnerability is a path traversal flaw (CWE‑22).

Affected Systems

The affected product is go‑git (go‑git/go‑git). All releases before 5.19.2 and before 6.0.0‑alpha.5 are vulnerable.

Risk and Exploitability

The CVSS score of 6.3 indicates moderate severity. EPSS data is not available and the vulnerability is not listed in CISA’s KEV catalog. The likely attack vector is an attacker supplying a malicious reference name—such as when cloning or pulling from an untrusted repository—potentially allowing the flaw to be exploited to write files outside the repository’s reference directory, leading to local file corruption or potential privilege escalation if the process runs with elevated rights. The attack requires the victim to run go‑git to process the attacker‑controlled reference, which is feasible in many application environments that embed the library.

Generated by OpenCVE AI on August 7, 2026 at 17:51 UTC.

Remediation

No vendor fix or workaround currently provided.

OpenCVE Recommended Actions

  • Upgrade to go‑git v5.19.2 or newer, including the 6.0.0‑alpha.5 update, which sanitizes reference names.
  • Verify that any reference names used in application code are validated or sanitized before passing them to go‑git.
  • Restrict cloning and fetching operations to trusted sources or run the library in a restricted environment if upgrading is not immediately possible.

Generated by OpenCVE AI on August 7, 2026 at 17:51 UTC.

Tracking

Sign in to view the affected projects.

Advisories
Source ID Title
Github GHSA Github GHSA GHSA-qgq7-7hm3-q39j go-git: Malicious reference names may modify files outside the reference storage
History

Fri, 07 Aug 2026 18:30:00 +0000

Type Values Removed Values Added
Metrics ssvc

{'options': {'Automatable': 'no', 'Exploitation': 'none', 'Technical Impact': 'partial'}, 'version': '2.0.3'}


Fri, 07 Aug 2026 18:15:00 +0000

Type Values Removed Values Added
First Time appeared Go-git
Go-git go-git
Vendors & Products Go-git
Go-git go-git

Fri, 07 Aug 2026 16:45:00 +0000

Type Values Removed Values Added
Description go-git is an extensible git implementation library written in pure Go. Prior to 5.19.2 and 6.0.0-alpha.5, reference names are not sanitized before being used to construct on-disk paths under the reference storage directory, so a maliciously crafted reference name (for example containing directory-traversal sequences) can cause go-git to write files outside the intended reference storage directory. Versions 5.19.2 and 6.0.0-alpha.5 fix the issue.
Title go-git: Malicious reference names may modify files outside the reference storage
Weaknesses CWE-22
References
Metrics cvssV3_1

{'score': 6.3, 'vector': 'CVSS:3.1/AV:N/AC:L/PR:L/UI:R/S:U/C:N/I:H/A:L'}


cve-icon MITRE

Status: PUBLISHED

Assigner: GitHub_M

Published:

Updated: 2026-08-07T17:55:10.638Z

Reserved: 2026-08-06T21:24:15.376Z

Link: CVE-2026-71557

cve-icon Vulnrichment

Updated: 2026-08-07T17:53:26.375Z

cve-icon NVD

No data.

cve-icon Redhat

No data.

cve-icon OpenCVE Enrichment

Updated: 2026-08-07T18:15:03Z

Weaknesses
  • CWE-22

    Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal')