mirror of
https://github.com/advplyr/audiobookshelf.git
synced 2026-03-02 22:46:56 -05:00
[Bug]: Users are able to see items they do not have access to in filter list #2512
Labels
No labels
authentication
awaiting release
backlog
bug
chapter editor
config-issue
ebooks
encoding/embedding
enhancement
help wanted
listening sessions & progress
planned
possible plugin
progress sync
sorting/filtering/searching
unable to reproduce
upload
users & permissions
waiting
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/audiobookshelf#2512
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @nichwall on GitHub (Oct 28, 2024).
What happened?
Users are able to see items in the filter list even if they don't have access to the list, such as "Authors", "Series", "Tag", etc. The function
getFilterDatacreates the filter based on the library without taking user access into account.I limited this user to only view the "Science Fiction" tag, which for example should not show "Fantasy" or "Brandon Sanderson".


What did you expect to happen?
Filter information by user similar to other parts of the API.
A potential solution is to add a user parameter to filter the data and have user specific caches for the filter data for each library.
Steps to reproduce the issue
Audiobookshelf version
v2.16.1
How are you running audiobookshelf?
Built from source
What OS is your Audiobookshelf server hosted from?
Linux
If the issue is being seen in the UI, what browsers are you seeing the problem on?
None
Logs
Additional Notes
The above log is an additional debug printout
Logger.debug('Filter data:', data)togetFilterDatagithub.com/advplyr/audiobookshelf@50fd659749/server/utils/queries/libraryFilters.js (L435C1-L548C4)@davidlfox commented on GitHub (Jan 6, 2025):
i didnt dig too deep into
getFilterDatareferenced above, but i can debug this locally and the search will turn up narrators, series, authors, genres (possibly tags too) in this area of code too https://github.com/advplyr/audiobookshelf/blob/master/server/utils/queries/libraryItemsBookFilters.js#L1091