Skip to content

Commit

Permalink
fix: check for parent dir reference when extracting cache (#251)
Browse files Browse the repository at this point in the history
Fixes #235
  • Loading branch information
agaffney authored Jun 11, 2024
1 parent 6f92468 commit 9662c2e
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions pkgmgr/registry.go
Original file line number Diff line number Diff line change
Expand Up @@ -170,6 +170,10 @@ func registryPackagesUrl(cfg Config, validate bool) ([]Package, error) {
if (zipFile.Mode() & fs.ModeDir) > 0 {
continue
}
// Ensure there are no parent dir references in path
if strings.Contains(zipFile.Name, "..") {
continue
}
outPath := filepath.Join(
cachePath,
zipFile.Name,
Expand Down

0 comments on commit 9662c2e

Please sign in to comment.