mirror of
https://github.com/zoriya/flood.git
synced 2026-06-04 11:35:11 +00:00
server: torrents: ensure path is allowed when mediainfo is requested
This commit is contained in:
@@ -668,6 +668,9 @@ router.get('/:hash/mediainfo', async (req, res) => {
|
|||||||
}
|
}
|
||||||
|
|
||||||
const contentPath = fs.existsSync(path.join(directory, name)) ? path.join(directory, name) : directory;
|
const contentPath = fs.existsSync(path.join(directory, name)) ? path.join(directory, name) : directory;
|
||||||
|
if (!isAllowedPath(contentPath)) {
|
||||||
|
callback(null, accessDeniedError());
|
||||||
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
const mediainfoProcess = childProcess.execFile(
|
const mediainfoProcess = childProcess.execFile(
|
||||||
|
|||||||
Reference in New Issue
Block a user