Skip to content

fix(files_sharing): enforce minimum search length in getUsers() and getGroups()#41580

Open
DeepDiver1975 wants to merge 3 commits into
masterfrom
security/fix-sharees-min-search-length
Open

fix(files_sharing): enforce minimum search length in getUsers() and getGroups()#41580
DeepDiver1975 wants to merge 3 commits into
masterfrom
security/fix-sharees-min-search-length

Conversation

@DeepDiver1975
Copy link
Copy Markdown
Member

Summary

  • getUsers() and getGroups() in ShareesController only blocked empty strings, not strings shorter than the admin-configured user.search_min_length
  • isSearchable() was already enforced in getRemote() but not in the other two search methods
  • Fix adds the missing isSearchable() guard, closing the bypass

Security Impact

Low — authenticated-only endpoint; bypass only relevant when admin raises min length above default

Test plan

  • New tests testGetUsersBlocksShortSearchTerm() and testGetGroupsBlocksShortSearchTerm() assert that backends are never queried when search term is below configured minimum
  • Run make test TEST_PHP_SUITE=apps/files_sharing

🤖 Generated with Claude Code

…etGroups()

The admin-configurable user.search_min_length was only enforced in
getRemote() via isSearchable() but not in getUsers() or getGroups().
A 1-character search bypassed the intended restriction and allowed
authenticated users to enumerate users even when a higher minimum
was configured. Add the missing isSearchable() guard to both methods.

Signed-off-by: Thomas Müller <thomas.mueller@owncloud.com>
Signed-off-by: Thomas Müller <1005065+DeepDiver1975@users.noreply.github.com>
@update-docs
Copy link
Copy Markdown

update-docs Bot commented Jun 5, 2026

Thanks for opening this pull request! The maintainers of this repository would appreciate it if you would create a changelog item based on your changes.

Signed-off-by: Thomas Müller <1005065+DeepDiver1975@users.noreply.github.com>
… setUp

Signed-off-by: Thomas Müller <1005065+DeepDiver1975@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant