Skip to content

Commit c47b437

Browse files
authored
chore: comment no-lint on gosec for unsafe zip extracting (#20741)
1 parent 7c8deaf commit c47b437

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

provisionersdk/tfpath/tfpath.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ func (l Layout) ExtractArchive(ctx context.Context, logger slog.Logger, fs afero
104104
return xerrors.Errorf("refusing to extract to non-local path")
105105
}
106106

107-
// nolint: gosec // TODO: Use relative paths inside the workdir only.
107+
// nolint: gosec // Safe to no-lint because the filepath.IsLocal check above.
108108
headerPath := filepath.Join(l.WorkDirectory(), header.Name)
109109
if !strings.HasPrefix(headerPath, filepath.Clean(l.WorkDirectory())) {
110110
return xerrors.New("tar attempts to target relative upper directory")

0 commit comments

Comments
 (0)