Security: Make the personal file ownership filter a conjunction - #8937
Merged
AngelFQC merged 1 commit intoAug 25, 2026
Merged
Conversation
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.
The personal files collection filtered by owner with orWhere, so the ownership predicate would stop being mandatory as soon as any earlier WHERE existed on the query. It now uses andWhere, like the shared branch of the same extension and the sibling message tag extension.
Verified against a running instance. As the reporter states, there is no observable leak with the current extension order: a second student sees totalItems=0 on the collection, plain, filtered by title and filtered by resourceNode.parent, gets 403 on the item and is redirected away from the download, both before and after the change; the owner keeps seeing their file in all of those. The operator itself is what is wrong — building the same query with a WHERE already present yields 'WHERE title LIKE ? OR creator_id = ?' with orWhere against 'WHERE title LIKE ? AND creator_id = ?' with andWhere. debug:container confirms why it is dormant today: every Chamilo collection extension runs unprioritised while FilterExtension sits at -16, so this predicate is currently always the first WHERE.
Refs GHSA-8g72-66mc-3c4j