Skip to content

Commit

Permalink
Update internal/unpackinfo/unpackinfo.go
Browse files Browse the repository at this point in the history
Co-authored-by: Kent Gruber <kent.picat.gruber@gmail.com>
  • Loading branch information
dduzgun-security and picatz authored Jan 27, 2025
1 parent be79e05 commit 9bf13d2
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion internal/unpackinfo/unpackinfo.go
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ func NewUnpackInfo(dst string, header *tar.Header) (UnpackInfo, error) {

// Check for path traversal by ensuring the target is within the destination
rel, err := filepath.Rel(dst, target)
if err != nil || strings.HasPrefix(rel, "..") || strings.Contains(dst, "..") || strings.Contains(path, "..") {
if err != nil || strings.HasPrefix(rel, "..") {
return UnpackInfo{}, errors.New("invalid filename, traversal with \"..\" outside of current directory")
}

Expand Down

0 comments on commit 9bf13d2

Please sign in to comment.