Skip to content

Commit

Permalink
Merge pull request #364 from pixlise/feature/em-import
Browse files Browse the repository at this point in the history
Fixing warning from CodeQL saying if uploaded scan zip has .. in a pa…
  • Loading branch information
pnemere authored Nov 15, 2024
2 parents 4e2585e + 016584d commit 1b6b4f7
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions api/ws/handlers/scan.go
Original file line number Diff line number Diff line change
Expand Up @@ -510,6 +510,10 @@ func processEM(importId string, zipReader *zip.Reader, zippedData []byte, destBu
sdf_raw_zipPath := ""

for _, f := range zipReader.File {
if strings.Contains(f.Name, "..") {
return fmt.Errorf("Found invalid path in zip that references ..: %v", f.Name)
}

if !f.FileInfo().IsDir() {
// Add to list of files we're interested in
if strings.HasSuffix(f.Name, "sdf_raw.txt") {
Expand Down

0 comments on commit 1b6b4f7

Please sign in to comment.