Published Date: January 7, 2025
Package | Affected Versions | Patched Versions | Severity |
---|---|---|---|
📦 gopkg.in/src-d/go-git.v4 (Go) | >= 4.0.0, <= 4.13.1 | – | High |
Description
go-git
, a popular library for interacting with Git repositories in Go. Attackers can exploit this flaw by sending specially crafted responses from a Git server. These responses cause resource exhaustion in go-git
clients, potentially rendering them unresponsive.Important Note: This vulnerability only affects
go-git
implementations. The standard Git CLI remains unaffected.Affected Versions:
github.com/go-git/go-git
(Go):>= 4.0.0
,<= 4.13.1
gopkg.in/src-d/go-git.v4
(Go):>= 4.0.0
,<= 4.13.1
Patched Versions:
github.com/go-git/go-git/v5
:>= 5.13.0
Impact:
Attackers can use malicious Git server replies to overwhelm client resources, leading to service interruptions or crashes.
Patches & Workarounds
- Upgrade to v5.13.0: If you’re using a vulnerable version, update your dependency to
go-git v5.13.0
immediately.
Example in
go.mod
:Workarounds:
If upgrading isn’t possible:
- Restrict Access: Only connect to trusted Git servers.
- Monitor Traffic: Watch for unusual activity or responses from Git servers.
While upgrading is the ideal fix, restricting connections to trusted sources provides a reasonable stopgap. Stay safe out there—malicious Git servers aren’t something you want sneaking into your build pipeline.