mirror of
https://github.com/advplyr/audiobookshelf.git
synced 2026-01-01 20:17:51 -05:00
Compare commits
3 Commits
fix_pathex
...
pathexists
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
a6f10ca48e | ||
|
|
aac01d6d9a | ||
|
|
7a33a412fc |
@@ -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)
|
||||
|
||||
@@ -59,6 +59,12 @@ class MiscController {
|
||||
if (!library) {
|
||||
return res.status(404).send('Library not found')
|
||||
}
|
||||
|
||||
if (!req.user.checkCanAccessLibrary(library.id)) {
|
||||
Logger.error(`[MiscController] User "${req.user.username}" attempting to upload to library "${library.id}" without access`)
|
||||
return res.sendStatus(403)
|
||||
}
|
||||
|
||||
const folder = library.libraryFolders.find((fold) => fold.id === folderId)
|
||||
if (!folder) {
|
||||
return res.status(404).send('Folder not found')
|
||||
|
||||
Reference in New Issue
Block a user