go-git: Crafted repositories may modify main and submodule .git directories
go-git
Affected versions
| Product | Affected | Fixed in |
|---|---|---|
| github.com/go-git/go-git/v5 Go |
|
|
| github.com/go-git/go-git/v6 Go |
|
|
| github.com/go-git/go-git Go |
go-git
| Product | Affected | Fixed in |
|---|---|---|
| github.com/go-git/go-git/v5 Go |
|
|
| github.com/go-git/go-git/v6 Go |
|
|
| github.com/go-git/go-git Go |
|
| No fix yet |
go-git is an extensible git implementation library written in pure Go. Prior to 5.19.1 and 6.0.0-alpha.4, 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. This vulnerability is fixed in 5.19.1 and 6.0.0-alpha.4.
From the CVE record · GitHub_M
A path validation issue in go-git can allow crafted repository data to affect files outside the intended checkout target, including the repository's .git directory. This can occur when go-git processes crafted repository data; network access, authentication, and user-interaction requirements are not specified.
Teams using github.com/go-git/go-git/v5 before 5.19.1, github.com/go-git/go-git/v6 before 6.0.0-alpha.4, or github.com/go-git/go-git through 44.7.0 should check their dependencies.