2 parents 405be6e + 1878422 commit d0e719fCopy full SHA for d0e719f
1 file changed
nsite.go
@@ -273,7 +273,11 @@ var nsite = &cli.Command{
273
signer := keyer.NewReadOnlySigner(pk)
274
275
for path, hash := range mnf.Paths {
276
- fullPath := filepath.Join(outputDir, filepath.FromSlash(strings.TrimPrefix(path, "/")))
+ relPath := strings.TrimPrefix(path, "/")
277
+ if !filepath.IsLocal(relPath) {
278
+ return fmt.Errorf("manifest path %q escapes output directory", path)
279
+ }
280
+ fullPath := filepath.Join(outputDir, filepath.FromSlash(relPath))
281
if err := os.MkdirAll(filepath.Dir(fullPath), 0o755); err != nil {
282
return fmt.Errorf("failed to create %s: %w", filepath.Dir(fullPath), err)
283
}
0 commit comments