This commit is contained in:
Scott A Miller-Tatasciore 2026-02-25 02:55:11 +01:00 committed by GitHub
commit f37944b761
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 27 additions and 20 deletions

View file

@ -88,7 +88,7 @@ class FileSystemController {
return res.sendStatus(403)
}
const { directory, folderPath } = req.body
const { folderPath, directory, fileName } = req.body
if (!directory?.length || typeof directory !== 'string' || !folderPath?.length || typeof folderPath !== 'string') {
Logger.error(`[FileSystemController] Invalid request body: ${JSON.stringify(req.body)}`)
return res.status(400).json({
@ -113,7 +113,7 @@ class FileSystemController {
return res.sendStatus(403)
}
let filepath = Path.join(libraryFolder.path, directory)
let filepath = Path.join(libraryFolder.path, directory, fileName)
filepath = fileUtils.filePathToPOSIX(filepath)
// Ensure filepath is inside library folder (prevents directory traversal)