Maliciously crafted Git server replies can lead to path traversal and RCE on go-git clients
go-git
Affected versions
| Product | Affected | Fixed in |
|---|---|---|
| github.com/go-git/go-git/v5 Go |
|
|
| gopkg.in/src-d/go-git.v4 Go |
| No fix yet |
go-git
| Product | Affected | Fixed in |
|---|---|---|
| github.com/go-git/go-git/v5 Go |
|
|
| gopkg.in/src-d/go-git.v4 Go |
| No fix yet |
A path traversal vulnerability was discovered in go-git versions prior to v5.11. This vulnerability allows an attacker to create and amend files across the filesystem. In the worse case scenario, remote code execution could be achieved.
Applications are only affected if they are using the ChrootOS https://pkg.go.dev/github.com/go-git/go-billy/v5/osfs#ChrootOS , which is the default when using "Plain" versions of Open and Clone funcs (e.g. PlainClone). Applications using BoundOS https://pkg.go.dev/github.com/go-git/go-billy/v5/osfs#BoundOS or in-memory filesystems are not affected by this issue. This is a go-git implementation issue and does not affect the upstream git cli.
From the CVE record · Bitdefender
go-git has a path traversal vulnerability that lets an attacker create or modify files across the filesystem and could, in the worst case, lead to remote code execution. Applications are affected when they use ChrootOS, including the default configuration of Plain Open and Clone functions; applications using BoundOS or in-memory filesystems are not affected.
Check applications using github.com/go-git/go-git/v5 versions 5.0.0 through 5.10.x or gopkg.in/src-d/go-git.v4 versions 4.0.0 through 4.13.1.