Skip to content
Account takeover Disclosed report Intermediate

Logged-in 2FA bypass for bugzilla

The 2FA enrolment endpoint remained accessible after setup, allowing anyone with a logged-in session to retrieve the account's 2FA root secret via the API token. An attacker with session access could then permanently bypass 2FA.

James Kettle Follow

Originally disclosed on Mozilla

  • Fixed in 24 hours
  • Paid in 6 days
  • Disclosed after 24 hours
Text
Steps to reproduce:

Anyone with access to a logged-in session can grab the account's 2FA root secret, enabling a permanent 2FA bypass. 
- Go to /userprefs.cgi, view the page source and grab the api_token
- Send the token to /rest/user/mfa/totp/enroll?Bugzilla_api_token=$token 
- This endpoint will respond with the QR code embedding the 2FA secret. You can render it by stripping \n from the png code then sending your browser to data:image/png;base64,$pngcode

This is not the world's most serious security issue but I felt it was worth reporting, especially as you have 2FA controls on /userprefs.cgi?tab=mfa which can be bypassed using this technique. 

To resolve this, I recommend ensuring that the enrol functionality can't be accessed after setup is completed.

The original report as published on Mozilla's Bugzilla, by Jаmes Kettle. 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.

How it worked

Root cause

Likely the 2FA enrolment endpoint did not check whether enrolment had already been completed, so it kept returning the secret.

Impact

An attacker with access to a logged-in session could obtain the 2FA secret and permanently bypass 2FA, though the report notes this is not the most serious issue.

What the attacker needed

Access to a logged-in session

The fix

The enrolment functionality should be blocked once setup is complete.

How it was found

  1. Open the user preferences page and view its source to find the API token.
  2. Send the token to the MFA TOTP enrolment endpoint.
  3. The endpoint returns a QR code containing the 2FA secret.
  4. Render the QR code by removing line breaks and opening it as a data URL.

Explained by bugbounty.wiki with AI from the original and checked against quotes from it; it can still be wrong. Read the original before relying on a detail.

Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.

Two-factor authentication (2FA) adds a second step to logging in, usually a code from an app. The secret that generates those codes should only be shown once, during setup. Here, the setup page stayed open, so someone already logged in could ask the server for the secret again and then make valid codes forever.

What is Account takeover?

Getting into someone else's account through a flaw in sign-in, password reset, second factor, single sign-on or session handling.

More by James Kettle

View all

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

Account takeover

The lesson behind this report.

Getting into someone else's account through a flaw in sign-in, password reset, second factor, single sign-on or session handling.