CVE-2026-45571Medium· 5.4▾ Sunlitgo-git: Crafted repositories may modify main and submodule .git directories
▾ Sunlit zone — Low / medium · no exploitation signal
impact 29.7 · likelihood 0.1 · exploitation 0
Need a working PoC? Pro members can cast a request and our team develops one — it lands right here.
Exploit-prediction probability, daily snapshots since Jul 25.
Disclosure to exploitation, from the record and what we observed since indexing it.
Disclosed via OSV
Last analysed / modified upstream
0.3%
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.
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.
Thanks to @kodareef5, @AyushParkara and @N0zoM1z0 for reporting this to the go-git project in three separate reports. 🙇
github.com/go-git/go-git/v5 < 5.19.1github.com/go-git/go-git/v6 < 6.0.0-alpha.4github.com/go-git/go-git <= 44.7.0Upgrade to a patched release:
github.com/go-git/go-git/v5 5.19.1github.com/go-git/go-git/v6 6.0.0-alpha.4Connected by shared product, vendor, weakness, or advisory.
GHSA-w5pp-99ch-qj29Medium· 6.5go-git: Malformed Git object data may cause panics or resource exhaustion
CVE-2026-41506Medium· 4.7go-git: Credential leak via cross-host redirect in smart HTTP transport
CVE-2023-49568High· 7.5Maliciously crafted Git server replies can cause DoS on go-git clients
CVE-2023-49569Critical· 9.8Maliciously crafted Git server replies can lead to path traversal and RCE on go-git clients
GO-2026-5693NoneGo-git: Malformed Git object data may cause panics or resource exhaustion in github.com/go-git/go-git
CVE-2026-45022Highgo-git's improper parsing of specially crafted objects may lead to inconsistent interpretation compared to upstream Git