mirror of
https://github.com/iptv-org/iptv
synced 2026-09-06 12:01:57 -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
|
||||
}
|
||||
|
||||
if (path.isAbsolute(filepath) || filepath === '..' || filepath.startsWith(`..${path.sep}`)) {
|
||||
throw new Error(`Filepath "${filepath}" is outside the storage directory`)
|
||||
}
|
||||
|
||||
return filepath
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user