mirror of
https://github.com/discourse/discourse.git
synced 2025-05-22 21:01:04 +08:00
SECURITY: Remove indication that a group exists if user can't see it.
Minor security fix but we should not leak any hints that a group exists even if a user does not have access to the group.
This commit is contained in:
@ -629,7 +629,7 @@ class GroupsController < ApplicationController
|
||||
def find_group(param_name, ensure_can_see: true)
|
||||
name = params.require(param_name)
|
||||
group = Group.find_by("LOWER(name) = ?", name.downcase)
|
||||
guardian.ensure_can_see!(group) if ensure_can_see
|
||||
raise Discourse::NotFound if ensure_can_see && !guardian.can_see_group?(group)
|
||||
group
|
||||
end
|
||||
|
||||
|
Reference in New Issue
Block a user