go-git: Worktree operations may follow symlinks
go-git
Affected versions
| Product | Affected | Fixed in |
|---|---|---|
| github.com/go-git/go-git/v5 Go |
|
|
| github.com/go-git/go-git/v6 Go |
|
|
go-git
| Product | Affected | Fixed in |
|---|---|---|
| github.com/go-git/go-git/v5 Go |
|
|
| github.com/go-git/go-git/v6 Go |
|
|
go-git is an extensible git implementation library written in pure Go. Prior to 5.19.2 and 6.0.0-alpha.5, worktree operations (including checkout, status, and add) resolve symbolic links inside the working tree without confining resolution to the worktree boundary, so a maliciously crafted repository containing a symlink can cause go-git to read from or write to files outside the intended working directory when the repository is cloned and its worktree operations are used. Versions 5.19.2 and 6.0.0-alpha.5.
From the CVE record · GitHub_M
go-git worktree operations, including checkout, status, and add, can follow symlinks outside the working tree. An attacker who supplies a malicious repository can cause reads from or writes to files outside the intended directory when the repository is cloned and those operations are used.
Check applications using github.com/go-git/go-git/v5 before 5.19.2 or github.com/go-git/go-git/v6 before 6.0.0-alpha.5.