mirror of
https://github.com/coder/coder.git
synced 2026-09-24 15:04:27 +08:00
fix: fix security vulnerabilities reported by CodeQL (#5467)
This commit is contained in:
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user