fix: fix security vulnerabilities reported by CodeQL (#5467)

This commit is contained in:
Dean Sheather
2022-12-19 19:25:59 +00:00
committed by GitHub
parent e359f3cd23
commit 1bc4eb5329
8 changed files with 42 additions and 22 deletions
+3
View File
@@ -131,6 +131,9 @@ func Untar(directory string, archive []byte) error {
if err != nil {
return err
}
if header.Name == "." || strings.Contains(header.Name, "..") {
continue
}
// #nosec
target := filepath.Join(directory, filepath.FromSlash(header.Name))
switch header.Typeflag {