Repository navigation
Fix unreadable revisions leaking in search - #2429
Open
rikvanriel wants to merge 1 commit into
Open
rikvanriel wants to merge 1 commit into
rikvanriel wants to merge 1 commit into
Conversation
On the base tree, search_meta and search_meta_page over ALL_REVS yield the protected revision instead of only the readable one, so item and global history list revisions the user cannot read. The count in search_results_size is unfiltered too, leaking how many private revisions exist, which breaks pagination as well. The filter has two bugs: ALL_REVS hits carry no indexed ACL (the schema has no ACL field), so _get_acls treats ACL-less meta as authoritative and falls back to the configured default; and the cached allows() key carries no item identity, reusing one item's verdict for every other item. Fix both: fall through to the storage ACL lookup when the indexed meta has none, and evaluate _allows directly in the search filters, where the inner parse/eval/lookup caches still apply. Counting now iterates the filtered output of search_meta over every matching ALL_REVS hit, with the whoosh default limit of 10 lifted. Cost: one storage lookup per ACL-less item on LATEST_REVS listings (300 items went from 0 to 300 get_item calls).
Collaborator
|
@rikvanriel, could you please give an example of how the problem can be reproduced in the UI? I'm worried that this change will have a significant impact on the performance of large wikis. |
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.
Fix unreadable revisions leaking in search
On the base tree, search_meta and search_meta_page over ALL_REVS
yield the protected revision instead of only the readable one, so
item and global history list revisions the user cannot read. The
count in search_results_size is unfiltered too, leaking how many
private revisions exist, which breaks pagination as well.
The filter has two bugs: ALL_REVS hits carry no indexed
ACL (the schema has no ACL field), so _get_acls treats ACL-less meta
as authoritative and falls back to the configured default; and the
cached allows() key carries no item identity, reusing one item's
verdict for every other item. Fix both: fall through to the storage
ACL lookup when the indexed meta has none, and evaluate _allows
directly in the search filters, where the inner parse/eval/lookup
caches still apply.
Counting now iterates the filtered output of search_meta over every
matching ALL_REVS hit, with the whoosh default limit of 10 lifted.
Cost: one storage lookup per ACL-less item on LATEST_REVS listings
(300 items went from 0 to 300 get_item calls).