CVE-2025-21613: go-git has an Argument Injection via the URL field
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.
Published Jan 6, 2025
Affected packages
gopkg.in/src-d/go-git.v4
- Ecosystem
- Go
- Affected
- >= 4.0.0, <= 4.13.1
- Fixed in
- No patched version yet
- Check
go list -m gopkg.in/src-d/go-git.v4
github.com/go-git/go-git/v5
- Ecosystem
- Go
- Affected
- < 5.13.0
- Fixed in
- 5.13.0
- Check
go list -m github.com/go-git/go-git/v5
Advisory details
From the GitHub Advisory Database (CC BY 4.0).
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.
Credited to vin01.
References
How this page is made: the data panel comes from the GitHub Advisory Database, CISA’s KEV catalog, the NVD and FIRST EPSS, and updates twice a day. No analysis has been written for this entry yet. Methodology
