mirror of
https://github.com/advplyr/audiobookshelf.git
synced 2025-06-20 09:48:25 +02:00
Update pathexists endpoint to check user has access to library
This commit is contained in:
parent
7a33a412fc
commit
aac01d6d9a
@ -108,6 +108,11 @@ class FileSystemController {
|
||||
return res.sendStatus(404)
|
||||
}
|
||||
|
||||
if (!req.user.checkCanAccessLibrary(libraryFolder.libraryId)) {
|
||||
Logger.error(`[FileSystemController] User "${req.user.username}" attempting to check path exists for library "${libraryFolder.libraryId}" without access`)
|
||||
return res.sendStatus(403)
|
||||
}
|
||||
|
||||
const filepath = Path.join(libraryFolder.path, directory)
|
||||
|
||||
// Ensure filepath is inside library folder (prevents directory traversal)
|
||||
|
Loading…
x
Reference in New Issue
Block a user