Skip to content

Commit

Permalink
Allow a file or directory having a name with two subsequent dots whil…
Browse files Browse the repository at this point in the history
…e still preventing path traversal
  • Loading branch information
SaschaSchwarze0 committed Nov 9, 2023
1 parent f7d84ce commit 5cb0f9e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion pkg/bundle/bundle.go
Original file line number Diff line number Diff line change
Expand Up @@ -240,7 +240,7 @@ func Unpack(in io.Reader, targetPath string) error {
}

var target = filepath.Join(targetPath, header.Name)
if strings.Contains(target, "..") {
if strings.Contains(target, "/../") {
return fmt.Errorf("targetPath validation failed, path contains unexpected special elements")
}

Expand Down

0 comments on commit 5cb0f9e

Please sign in to comment.