gitlab-org--gitlab-foss/app/views/admin
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
..
abuse_reports Added author to various Markdown calls in views 2016-05-26 17:14:06 +02:00
appearances Merge branch 'dz-fix-appearance-preview' into 'master' 2016-06-21 16:31:33 +00:00
application_settings Put some admin settings in dropdown 2016-06-20 14:55:20 +03:00
applications
background_jobs Nest li elements directly under ul 2016-06-15 09:11:17 -05:00
broadcast_messages
builds Move builds tab to admin overview 2016-06-15 09:10:16 -05:00
dashboard Move admin->runners tab as subnav of overview tab 2016-06-16 21:39:30 +03:00
deploy_keys
groups Display group/project access requesters separately in admin 2016-06-20 16:12:46 +02:00
health_check Add monitoring link with subtabs 2016-06-15 09:10:16 -05:00
hooks
identities
keys
labels
logs Add monitoring link with subtabs 2016-06-15 09:10:16 -05:00
projects Display group/project access requesters separately in admin 2016-06-20 16:12:46 +02:00
runners Merge remote-tracking branch 'upstream/master' into feature/runner-lock-on-project 2016-06-20 14:04:14 +00:00
services
spam_logs
users Fix an information disclosure when requesting access to a group containing private projects 2016-06-24 12:01:48 +02:00