Skip to main content

go-git CVE-2026-45571

| EUVDEUVD-2026-32544 MEDIUM
Path Traversal (CWE-22)
2026-05-19 https://github.com/go-git/go-git GHSA-crhj-59gh-8x96
5.4
CVSS 3.1 · GitHub Advisory
View

Attack ChainAIDerived

Hypothetical attack flow derived from CVE metadata – not a confirmed exploit chain

  1. Access
    Attacker crafts repository with traversal payloads
  2. Delivery
    Victim clones or processes repo via go-git
  3. Exploit
    Path validation bypass allows out-of-bounds write
  4. Execution
    Files written to .git directory or parent filesystem paths
  5. Persist
    Repository metadata or hooks tampered
  6. Impact
    Follow-on code execution or supply chain compromise

Vulnerability Assessment

Weakness
CWE
OWASP Top 10:2025
A01:2025 - Broken Access Control
ASVS 5.0
V5 - File Handling Path canonicalization, traversal prevention
MITRE ATT&CK

2 techniques across 2 tactics: Discovery, Collection

The technique list with ATT&CK links and the kill-chain view is part of the Basic plan and up.

Exploitation Conditions

Exploitation requires that a victim clone or otherwise process a maliciously crafted Git repository using a vulnerable version of go-git - this maps directly to the CVSS UI:R (user interaction required) signal, meaning a human or automated process must actively fetch the attacker-controlled repository content. No authentication is required on the attacker's side (PR:N), and attack complexity is low (AC:L), meaning the path traversal payloads do not require timing or race conditions. Exploitation is limited by the following factors: users processing only trusted repositories are not affected; users who configure go-git to use memfs for the Storer while using osfs for the Worktree gain partial protection for the main repository's .git directory, though submodules remain exposed under this configuration; and some payloads are platform-specific, with certain traversal techniques effective only on Windows and others only on macOS, while a subset applies cross-platform. There is no evidence that default configurations of go-git are exploitable without the attacker supplying crafted repository data.

Impact

The CVSS 3.1 vector CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:N/I:L/A:L scores 5.4 (Medium), indicating network-accessible exploitation with low attack complexity and no authentication requirement - but requiring user interaction (UI:R), which anchors the practical risk. The integrity impact is limited (I:L) and availability impact is low (A:L), with no confidentiality impact (C:N), suggesting the primary harm is repository metadata tampering or unexpected file placement rather than data exfiltration. EPSS data was not provided in the available intelligence, so probabilistic exploitation likelihood cannot be quantified. This CVE is not listed in the CISA Known Exploited Vulnerabilities catalog and no publicly available exploit code has been identified at time of analysis, which distinguishes it from higher-urgency path traversal CVEs. Despite the moderate CVSS, risk is meaningfully elevated in environments that automatically clone or process third-party repositories - such as CI/CD systems, package mirrors, or developer tooling - where the UI:R threshold may effectively be met programmatically rather than through a human decision. The platform-specific nature of some payloads (Windows, macOS) adds complexity: defenders on heterogeneous infrastructure must treat all platforms as potentially affected.

Exploit ScenarioDerived

An attacker crafts a malicious Git repository containing tree entries or filenames with path traversal sequences (e.g., using directory separators or platform-specific path tricks for Windows or macOS) and hosts or distributes the repository. When a developer or automated system clones or processes the repository using a vulnerable version of go-git, the library writes files to locations outside the intended checkout directory - potentially overwriting .git/hooks, .git/config, or other metadata files, enabling follow-on code execution or supply chain interference. No public proof-of-concept has been identified, but three independent researchers reported this issue to the go-git project, indicating the vulnerability is discoverable from repository format analysis.

This Month Plan within 30 days. Why: MEDIUM severity (CVSS 4.0-6.9).
Patch available 0.0% exploitation probability (EPSS)

Get an e-mail when this CVE is exploited, patched or re-scored. Free account.

Alert me

AnalysisAIv1 – May 19, 2026

Path traversal in go-git allows crafted repository payloads to write files outside the intended checkout directory, including into the repository's .git directory and parent paths. The vulnerability stems from go-git failing to implement path validation checks that upstream Git adopted years ago, creating a drift-induced security gap across all supported platforms - with additional platform-specific attack vectors affecting Windows and macOS users distinctly. CVSS scores this at 5.4 medium with no public exploit identified at time of analysis and no CISA KEV listing, but the real-world risk is elevated in automated pipelines or developer tooling that processes untrusted repositories without human review.

RemediationAI

The primary remediation is to upgrade go-git to a patched release: v5 users should upgrade to v5.19.1 or later, and v6 alpha users should upgrade to v6.0.0-alpha.4 or later, as confirmed by GHSA-crhj-59gh-8x96. Users of the legacy unversioned go-git module should migrate to the v5 or v6 module, as no fix has been released for the legacy package. As a partial architectural workaround prior to patching, configure the go-git Storer to use a non-descendant or in-memory filesystem (e.g., go-billy's memfs) while keeping the Worktree on the OS filesystem (osfs); this prevents .git directory manipulation in the main repository because repository metadata is not materialized within the worktree filesystem. Note that this isolation does NOT protect against submodule attacks, as submodule dotgit directories may still be materialized within the worktree context. Additionally, restrict application-level trust - only clone or process repositories from verified, trusted sources, and consider sandboxing or containerizing any tooling that processes untrusted Git repositories to limit blast radius. The full advisory is at https://github.com/go-git/go-git/security/advisories/GHSA-crhj-59gh-8x96.

Affected VersionsENISA

go-git 6.0.0-alpha.1, < 6.0.0-alpha.4
go-git < 5.19.1

Affected Packages

go github.com/go-git/go-git no fix
go github.com/go-git/go-git/v5 fix: 5.19.1
go github.com/go-git/go-git/v6 fix: 6.0.0-alpha.4
euvd go_git fix: 5.19.1
euvd go_git_6_0_0_alpha_1 fix: 6.0.0-alpha.4

Source: OSV (Open Source Vulnerabilities)

Affects your stack

Affects 5 packages in go, euvd

Checking this CVE against your own stacks and servers is part of the Basic plan and up.

Technical ContextAI · show details

go-git is a pure-Go implementation of the Git version control system, used widely in Go-based tooling, CI/CD pipelines, and developer utilities. The root cause is CWE-22 (Improper Limitation of a Pathname to a Restricted Directory), colloquially known as path traversal. Upstream Git introduced path sanitization checks to prevent crafted tree entries or filenames from resolving outside the repository worktree - checks that go-git never adopted, causing it to drift from the reference implementation's security posture. The affected packages identified by CPE are pkg:go/github.com_go-git_go-git_v5 (through v5.19.0), pkg:go/github.com_go-git_go-git_v6 (through v6.0.0-alpha.3), and the legacy pkg:go/github.com_go-git_go-git package. The filesystem abstraction layer, go-billy, is central to the issue: the separation between the Storer (managing .git metadata) and the Worktree (managing checked-out files) determines whether the traversal can reach repository metadata. Tags in the advisory confirm Windows and macOS as platforms with distinct attack surface, suggesting OS-specific filename or path handling quirks are exploited.

Know when the next one hits your stack

  • Watch products and get an email when something new is published
  • Check this CVE against your own stack and servers
  • Exploit and PoC references, threat intelligence from 22 sources

No credit card · 7-day full trial

Severity by source

GitHub Advisory PRIMARY 5.4 MEDIUM
AV:N/AC:L/PR:N/UI:R/S:U/C:N/I:L/A:L
Red Hat 5.4 MEDIUM

Primary rating from GitHub Advisory.

CVSS VectorGitHub Advisory

Attack Vector
Network
Attack Complexity
Low
Privileges Required
None
User Interaction
Required
Scope
Unchanged
Confidentiality
None
Integrity
Low
Availability
Low

DescriptionGitHub Advisory

Impact

A path validation issue in go-git could allow crafted repository data to affect files outside the intended checkout target, including the repository's .git directory.

These validations were introduced in upstream Git years ago, so the vulnerability arose from go-git drifting from those checks. Some attack vectors were platform-specific: certain payloads affected only Windows users, others affected only macOS users, and some applied across all supported platforms.

Using non-descendant go-billy filesystem instances, or different filesystem types, for the Storer and Worktree may provide some isolation against .git directory manipulation. For example, users that store the .git directory through memfs while using osfs for the worktree are not affected by this vulnerability in the main repository, because repository metadata is not materialized inside the worktree filesystem.

However, this isolation does not necessarily apply when the repository contains submodules, since submodule dotgit directories may still be represented or materialized within the worktree context.

It is important to note that exploitation requires a maliciously crafted repository payload. Users should always exercise caution when interacting with repositories or Git servers they do not trust.

Patches

Users should upgrade to a patched version in order to mitigate this vulnerability. Versions prior to v5 are likely to be affected, users are recommended to upgrade to a supported go-git version.

Credits

Thanks to @kodareef5, @AyushParkara and @N0zoM1z0 for reporting this to the go-git project in three separate reports. 🙇

Threat Intelligence Overview

EPSS Score
0.0%
Top 97% exploitable
Threat Intel
1
1 sources
Data Quality
7 sources
Confidence: High

How this decision was reached

The engine reads each signal below and applies a fixed list of rules from top to bottom. The first rule that matches sets the recommended action – like a statement, every line is shown.

SignalValue
Severity MEDIUM
CISA KEV No
Public POC No
EPSS 0.0%
Patch available Yes
Active threat No
Deciding rule
MEDIUM severity (CVSS 4.0-6.9)
What every action level means
Emergency Immediate action required. Criteria: CRITICAL + in CISA KEV (actively exploited) without patch, OR CRITICAL + EPSS > 30% without patch, OR CRITICAL + active threat signals without patch.
Act Now Prioritize within 24-48h. Criteria: in KEV with patch available, OR CRITICAL + public POC, OR HIGH + EPSS > 10%, OR CRITICAL + active threat, OR any CRITICAL severity.
This Week Schedule remediation this week. Criteria: HIGH severity (CVSS 7.0-8.9). Patch within normal change window.
This Month Plan within 30 days. Criteria: MEDIUM severity (CVSS 4.0-6.9), lower exploitation probability. Include in regular patch cycle.
Monitor Track and reassess. Criteria: LOW severity (CVSS 0.1-3.9), minimal exploitation risk. No immediate action needed.

SSVC AssessmentENISA

SSVC Decision· derived
Scheduled
Exploitation· derived
None
System Exposure· derived
Open
Automatable· derived
No
Human Impact· derived
Medium

Priority Score

27
Low Medium High Critical
KEV: 0
EPSS: 0
CVSS: +27
PoC: 0
Weaponized: 0
Threat intel: 0
Gov advisory: 0

Attack Technique

Path traversal exploits occur when applications use user-controlled input to construct file system paths without proper validation.

Vendor StatusVendor

SUSE

Product Status
openSUSE Tumbleweed Fixed

This site uses cookies essential for authentication and security. No tracking or analytics cookies are used. Privacy Policy