go-git has an Argument Injection via the URL field
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.0Details
Impact
An argument injection vulnerability was discovered in go-git versions prior to v5.13.
Successful exploitation of this vulnerability could allow an attacker to set arbitrary values to git-upload-pack flags. This only happens when the file transport protocol is being used, as that is the only protocol that shells out to git binaries.
Affected versions
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 users to enforce restrict validation rules for values passed in the URL field.
Credit
Thanks to @vin01 for responsibly disclosing this vulnerability to us.
Is GHSA-v725-9546-7q7m 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-21614Clients vulnerable to DoS via maliciously crafted Git server replies in github.com/go-git/go-git · 7 Jan 2025
- HighCVE-2025-21614go-git clients vulnerable to DoS via maliciously crafted Git server replies · 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.