go-git clients vulnerable to DoS via maliciously crafted Git server replies
Published 6 Jan 2025 · Updated 10 Sept 2026
Is your project on an affected gopkg.in/src-d/go-git.v4?
Look after several Go apps? Indie watches up to 15 repos, private ones too, for $5 a month. See Indie
Affected packages
- Affected
- >=4.0.0 <=4.13.1
- Fixed in
- No fix released
- Affected
- <5.13.0
- Fixed in
- 5.13.0
go get github.com/go-git/go-git/v5@v5.13.0- Affected
- >=4.0.0 <=4.13.1
- Fixed in
- No fix released
Details
Impact
A denial of service (DoS) vulnerability was discovered in go-git versions prior to v5.13. This vulnerability allows an attacker to perform denial of service attacks by providing specially crafted responses from a Git server which triggers resource exhaustion in go-git clients.
This is a go-git implementation issue and does not affect the upstream git cli.
Patches
Users running versions of go-git from v4 and above are recommended to upgrade to v5.13 in order to mitigate this vulnerability.
Workarounds
In cases where a bump to the latest version of go-git is not possible, we recommend limiting its use to only trust-worthy Git servers.
Credit
Thanks to Ionut Lalu for responsibly disclosing this vulnerability to us.
Is GHSA-r9px-m959-cxf4 in any of your client repos?
Checking one package by hand is fine. Checking it across forty client projects is not. NPMscan reads the lockfiles in every GitHub repo you pick, finds each project with an affected gopkg.in/src-d/go-git.v4, and gives you the command that fixes it.
More advisories for gopkg.in/src-d/go-git.v4
- LowCVE-2025-21613Argument Injection via the URL field in github.com/go-git/go-git · 7 Jan 2025
- CriticalCVE-2025-21613go-git has an Argument Injection via the URL field · 6 Jan 2025
- LowCVE-2023-49568Denial of service in github.com/go-git/go-git/v5 and gopkg.in/src-d/go-git.v4 · 23 Jan 2024
- LowCVE-2023-49569Path traversal and RCE in github.com/go-git/go-git/v5 and gopkg.in/src-d/go-git.v4 · 23 Jan 2024
- CriticalCVE-2023-49569Maliciously crafted Git server replies can lead to path traversal and RCE on go-git clients · 10 Jan 2024
- HighCVE-2023-49568Maliciously crafted Git server replies can cause DoS on go-git clients · 27 Dec 2023
References
Advisory data from OSV.dev (opens OSV.dev in a new tab), refreshed daily.