Any BMO user can list, create, delete, and edit instance-wide OAuth2 clients due to failing permission check in Bugzilla::App::OAuth2::Provider::Clients
- Fixed in 33 hours
- Paid in 44 hours
- Disclosed after 33 hours
Summary
According to admin.html.tmpl, only BMO users who are members of the admin group should be able to "add, modify, or remove OAuth2 provider clients" for that BMO instance.
OAuth2 clients are managed using the Bugzilla::App::OAuth2::Provider::Clients package which contains the following adminship check:
$user->in_group('admin')
|| return $c->user_error('auth_failure',
{group => 'admin', action => 'edit', object => 'oauth_clients'});
Other CGI controllers with a $user->in_group('admin') check that I tested correctly threw an "Authorization Required" error, but due to what I suspect is logic in the 'parent' $client_route not being fully passed down to the 'child' routes, any BMO user can interact with all of the routes defined in the package:
/admin/oauth/provider/listto list OAuth2 clients/admin/oauth/provider/createto create a new OAuth2 client/admin/oauth/provider/deleteto delete OAuth2 clients/admin/oauth/provider/editto edit existing OAuth2 clients and view client IDs and secrets
For verification purposes I created a single test client on the BMO dev environment using the account listed in the "Environment" section below and removed it immediately after verification. I did not attempt to create any clients on the production environment nor did I attempt the deletion of any clients besides my own test client when cleaning up.
Environment
- BMO Test Account: [address removed] on https://bugzilla-dev.allizom.org
Steps to Reproduce
-
Log in to BMO as an unprivileged user holding only membership in the
everyonegroup (browse to https://bugzilla-dev.allizom.org/userprefs.cgi?tab=permissions to confirm this). -
Browse to https://bugzilla-dev.allizom.org/admin/oauth/provider/list and observe that you can list, edit, delete, and create OAuth2 clients using the endpoints outlined in the "Summary" section above.
The steps above use the BMO dev environment as I was able to safely test the endpoints there. I was able to reproduce viewing the OAuth2 client list on https://bugzilla.mozilla.org/admin/oauth/provider/list also but as noted in the "Summary" section above I did not attempt to create or delete any clients there.
Impact
Any authenticated BMO user (specifically, members of the everyone group) can perform admin-level actions on instance-wide OAuth2 clients including but not limited to modifying redirect URLs, reading client IDs and secrets, and deleting clients entirely.
Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.
What is known
A medium-severity access control bug in General. Mozilla made it public on 5 October 2022.
About Access control
A user can do something their role should not allow: reach an admin function, act on a feature they have not paid for, or skip a permission check. IDOR is the special case where the object belongs to someone else.
Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.
What is Access control?
A user can do something their role should not allow: reach an admin function, act on a feature they have not paid for, or skip a permission check. IDOR is the special case where the object belongs to someone else.