mirror of
https://github.com/advplyr/audiobookshelf.git
synced 2026-07-07 09:51:37 +00:00
Compare commits
No commits in common. "7a33a412fca825b97dd6620726146544a8df058e" and "6968a5c02aea5076ae7efcc20354328b7a701da9" have entirely different histories.
7a33a412fc
...
6968a5c02a
1 changed files with 2 additions and 2 deletions
|
|
@ -89,6 +89,7 @@ class FileSystemController {
|
|||
}
|
||||
|
||||
const { directory, folderPath } = 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({
|
||||
|
|
@ -108,8 +109,7 @@ class FileSystemController {
|
|||
return res.sendStatus(404)
|
||||
}
|
||||
|
||||
const filepath = Path.join(libraryFolder.path, directory)
|
||||
|
||||
const filepath = Path.posix.join(libraryFolder.path, directory)
|
||||
// Ensure filepath is inside library folder (prevents directory traversal)
|
||||
if (!filepath.startsWith(libraryFolder.path)) {
|
||||
Logger.error(`[FileSystemController] Filepath is not inside library folder: ${filepath}`)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue