Skip to content
This repository has been archived by the owner on Sep 13, 2024. It is now read-only.

Commit

Permalink
trying to fix the issue
Browse files Browse the repository at this point in the history
  • Loading branch information
PatrickLaabs committed Mar 4, 2024
1 parent e547ba4 commit 4a418ae
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions pkg/cluster/internal/logs/logs.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ import (
"os"
"path"
"path/filepath"
"strings"

"github.com/alessio/shellescape"

Expand Down Expand Up @@ -61,6 +62,11 @@ func untar(logger log.Logger, r io.Reader, dir string) (err error) {
for {
f, err := tr.Next()

if strings.Contains(f.Name, "..") {
logger.Warnf("Skipping potentially unsafe path: %s", f.Name)
continue // Skip this file
}

switch {
case err == io.EOF:
// drain the reader, which may have trailing null bytes
Expand Down

0 comments on commit 4a418ae

Please sign in to comment.