Skip to content
Access control Disclosed report Beginner

Any BMO user can list, create, delete, and edit instance-wide OAuth2 clients due to failing permission check in Bugzilla::App::OAuth2::Provider::Clients

Viridian Follow

Originally disclosed on Mozilla

  • 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:

PERL
$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:

  1. /admin/oauth/provider/list to list OAuth2 clients
  2. /admin/oauth/provider/create to create a new OAuth2 client
  3. /admin/oauth/provider/delete to delete OAuth2 clients
  4. /admin/oauth/provider/edit to 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

Steps to Reproduce

  1. Log in to BMO as an unprivileged user holding only membership in the everyone group (browse to https://bugzilla-dev.allizom.org/userprefs.cgi?tab=permissions to confirm this).

  2. 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.

The original report as published on Mozilla's Bugzilla, by Viridian. Images and videos are our own copies; raw HTML is shown as text. View it on Mozilla's Bugzilla.

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.

More by Viridian

View all

4 more disclosed reports, best first.

More from Mozilla

View all

The newest disclosed reports for this program.

Similar reports

View all

Same bug class and techniques, clearest first.

Broken access control

The lesson behind this report.

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.