mirror of
https://github.com/iptv-org/iptv
synced 2026-09-09 05:17:04 -04:00
fix: reject formatter paths outside storage
This commit is contained in:
@@ -51,6 +51,10 @@ export function getStoragePath(filepath: string, rootDir: string): string {
|
|||||||
return relative
|
return relative
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (path.isAbsolute(filepath) || filepath === '..' || filepath.startsWith(`..${path.sep}`)) {
|
||||||
|
throw new Error(`Filepath "${filepath}" is outside the storage directory`)
|
||||||
|
}
|
||||||
|
|
||||||
return filepath
|
return filepath
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user