Skip to content

Commit

Permalink
Merge pull request shipwright-io#1429 from SaschaSchwarze0/sascha-all…
Browse files Browse the repository at this point in the history
…-doubledot-in-name

Allow a file or directory having a name with two subsequent dots while still preventing path traversal
  • Loading branch information
SaschaSchwarze0 authored Nov 9, 2023
2 parents f7d84ce + 5cb0f9e commit 3a85565
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 3a85565

Please sign in to comment.