Fix tenant leak in CuratorPanel search (3.x backport) - #714
Merged
Conversation
Backport of the 4.x/5.x fix. updatedSearch() built its query without the tenant ownership scope applied in getFiles(), allowing an authenticated panel user to retrieve media metadata belonging to other tenants via the picker search (CWE-284). The ungrouped orWhere chain also broke out of the isLimitedToDirectory filter. Apply the tenant scope and group the search terms so they cannot escape the directory/tenant constraints. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Backport of the tenant search leak fix already shipped in 4.1.1 and 5.1.1.
Problem
CuratorPanel::updatedSearch()built its query without the tenant ownership scope thatgetFiles()applies, so in multitenant panels an authenticated user could retrieve media metadata belonging to other tenants via the picker search (CWE-284). The ungroupedorWherechain also broke out of theisLimitedToDirectoryfilter.The vulnerability dates back to v3.2.4 (when multitenancy support was added to the picker).
Fix
Apply the same tenant scope used by
getFiles()and wrap the search terms in a nested group so they can't escape the directory/tenant constraints. Identical in behavior to the merged 4.x/5.x fix.Note on tests
The 3.x branch has no Livewire/feature test infrastructure or tenancy fixtures (unlike 4.x/5.x), so this carries no new automated test. The change is syntax-checked and mirrors the regression-tested fix on the newer branches. Happy to build out the test harness if we want coverage here.
Security release to follow.