gitlab-org--gitlab-foss/spec/features/groups/members
Rémy Coutable aec3475df9
Fix an information disclosure when requesting access to a group containing private projects
The issue was with the `User#groups` and `User#projects` associations
which goes through the `User#group_members` and `User#project_members`.

Initially I chose to use a secure approach by storing the requester's
user ID in `Member#created_by_id` instead of `Member#user_id` because I
was aware that there was a security risk since I didn't know the
codebase well enough.

Then during the review, we decided to change that and directly store the
requester's user ID into `Member#user_id` (for the sake of simplifying
the code I believe), meaning that every `group_members` / `project_members`
association would include the requesters by default...

My bad for not checking that all the `group_members` / `project_members`
associations and the ones that go through them (e.g. `Group#users` and
`Project#users`) were made safe with the `where(requested_at: nil)` /
`where(members: { requested_at: nil })` scopes.

Now they are all secure.

Signed-off-by: Rémy Coutable <remy@rymai.me>
2016-06-24 12:01:48 +02:00
..
last_owner_cannot_leave_group_spec.rb Add 'Leave Group' link 2016-06-18 06:06:35 +02:00
member_leaves_group_spec.rb Fix and remove duplicate specs 2016-06-20 12:36:59 +02:00
owner_manages_access_requests_spec.rb Fix specs 2016-06-20 16:40:35 +02:00
user_requests_access_spec.rb Fix an information disclosure when requesting access to a group containing private projects 2016-06-24 12:01:48 +02:00