Repository navigation
Conversation
…the viewer's The query executor narrows a query's library_ids to the viewer's allowed libraries. When the two shared none, the narrowed list was empty, no library clause was emitted, and the query ran over every library. The same happened for a viewer with no allowed libraries while a library was disabled. jellycompat BoxSet children, collection items and custom filter rows pass a query's own library_ids to the executor, so they could list titles from libraries the viewer cannot open. An allowlist that leaves no library now adds 1 = 0, as an empty allowlist already did. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
Silo Kody — review completeReview finished. Check the inline comments for findings and verify each suggestion against the code and tests. Reviewing changes in Silo
Review settingsReview OptionsThe following review options are enabled or disabled:
|
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
Navigate logical layers of code changes, visualize relationships, and explore their blast radius. No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configuration
📒 Files selected for processing (4)
Included review availability: This review used your included allowance. Your plan provides up to 4 included reviews per hour; 1 remain after this review. 📝 WalkthroughWalkthroughThe change preserves empty library access scopes in collection rail queries and makes preview SQL exclude results when the effective library selection is empty. ChangesLibrary access scope enforcement
Priority: ⬆️ High Estimated code review effort: 2 (Simple) | ~10 minutes Change: Bug fix Suggested reviewers: Merge Risk: ⚪ Minimal · up to This change makes restricted viewers get no results, instead of results from all libraries, when they query libraries outside their allowlist. No merge-blocking risk was found. DB-backed tests and a manual check in a running app were not run. Security Architecture ReviewSecurity architecture risk: 🔵 Low · up to The changes tighten existing library access checks and preserve denied scopes. No introduced security weakness was identified, but full request-path and database-backed verification remains incomplete. Retained concerns Security review detailsSecurity Blast Radius
Security Findings and Attack Paths
Trust Boundaries and Controls
Resilience and Maintainability Implications
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches 💡 1📝 Generate docstrings 💡
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
collectionRailQueryAccess copied the effective library list with append([]int(nil), ids...), which turns an empty list into nil. An empty allowlist means no library and nil means every library, so a sorted collection row showed every member to a profile allowed no library. slices.Clone keeps the empty list non-nil. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
Silo Kody — review completeReview finished. Check the inline comments for findings and verify each suggestion against the code and tests. Reviewing changes in Silo
Review settingsReview OptionsThe following review options are enabled or disabled:
|
|
Silo's pull request guidance changed today (#2016). A PR that changes what a user sees now needs before-and-after evidence in its Evidence section, and a PR with no visible change says Missing here: Before-and-after screenshots of an affected home or collection rail for a restricted viewer, or before-and-after section API excerpts for the same request. The rules are in Show visible changes, and the PR template shows the Evidence section layout. I've converted this PR to draft for now. Mark it ready for review once the Evidence section is filled in. Generated by Claude Code |
|
This PR is superseded: #2013 brought both of its commits to main, and #1953 and #2006 later moved the preview-plan guard onto The PR has no |
|
Closing as superseded: #2013 brought both fixes and their tests to main. |
Problem
Related issue: N/A
Validation tasks: changes #1137 AC5; reaches #194 A5 and #195 W3 (restricted profiles)
A restricted profile could see titles from libraries it isn't allowed to open. This happened whenever a query named only libraries outside the profile's allowed set: a Home or library rule row scoped to another library, the children of a Jellyfin BoxSet for a smart collection, or a collection's item page. Instead of returning nothing, the query ran over every library. Rating limits still applied. This change makes those queries return nothing.
A second path had the same effect for a profile allowed no library at all: a sorted collection row copied the viewer's library list in a way that turned an empty list (no library) into nil (every library), so the row showed every member. That is fixed too.
The query executor narrows a query's
library_idsto the viewer's allowed libraries (internal/catalog/query_executor.go). When the two lists share no library, the narrowed list is empty, no library clause is added, and the query is unscoped. The executor also missed a viewer with no allowed libraries while some library was disabled: it got the disabled-library clause but not the "match nothing" guard.Approach
1 = 0, as it already did for an empty allowlist. The guard now runs whether or not a disabled-library clause was added.collectionRailQueryAccess(internal/sections/fetcher.go) copies the library list withslices.Clone, which keeps an empty list non-nil, instead ofappend([]int(nil), ...).Validation
go testpasses forinternal/catalog,internal/sections,internal/jellycompatandinternal/api/handlers.gofmt,go vetandmake lint-changedare clean.Risks
None identified. A query whose libraries overlap the viewer's allowed set builds the same SQL as before.
/api/v1uses the same executor, so the fix applies there too.Checklist
AI Disclosure
🤖 Generated with Claude Code
Note
Fix catalog queries outside viewer's libraries matching every library
collectionRailQueryAccessin fetcher.go now preserves the difference between nil and empty scopes when cloning effective library IDs, so an explicitly empty scope stays a denying scope rather than becoming unrestricted.Macroscope summarized 168c7ad.