CSRF-login on bugzilla.mozilla.org
The multi-factor authentication (MFA) step in Bugzilla's login flow lacked the CSRF protections used elsewhere, so an attacker could craft a form that logs a victim into the attacker's account if the victim submits a valid MFA code. This could lead the victim to post sensitive bug reports under the attacker's account.
Originally disclosed on Mozilla
- Fixed in 8 days
- Paid in 12 days
- Disclosed after 8 days
BMO has a bunch of code designed to prevent CSRF attacks from logging users into an attacker's account:
https://github.com/mozilla-bteam/bmo/blob/34a94dd51164776f6c142219bc0baa334a93084b/Bugzilla/Auth/Login/CGI.pm#L40-L69
Presumably this is to mitigate the risk of a victim not realising they've been logged into an attacker's account, and then posting security sensitive bugs. Unfortunately the MFA implementation is missing these defences, so a CSRF login is still possible.
To replicate this, first ensure MFA is enabled on your BMO account, then start a log in by providing your username and password. Record the 't' input from the MFA code form and close the tab. Simulate the victim by opening a fresh private-browsing window, and visiting a third party website with the following HTML:
<html>
<body>
<form action="https://bugzilla.mozilla.org/token.cgi" method="POST">
<input type="hidden" name="a" value="mfa_l" />
<input name="t" value="t-token-here" />
<input name="code" value="mfa-code-here" />
<input type="submit" value="Submit request" />
</form>
</body>
</html>
If you supply the 't' value and a valid MFA code, you'll find the 'victim' has been logged into your account.
Please note I also filed a different low-severity issue in BMO yesterday, but forgot to use this form. You can find it here: https://bugzilla.mozilla.org/show_bug.cgi?id=1798491
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 MFA login handler did not include the same CSRF token validation that the standard login flow uses.
Impact
A victim could be logged into the attacker's account and might post security-sensitive bugs there, which the attacker could then read.
What the attacker needed
Attacker has MFA enabled; victim visits attacker's website; victim submits a valid MFA code
How it was found
- Enable MFA on your BMO account.
- Start a login by providing username and password, then record the 't' input from the MFA code form and close the tab.
- Open a fresh private-browsing window and visit a third-party website containing a form that posts to the MFA endpoint with the recorded 't' value and a valid MFA code.
- Submit the form; the victim is logged into the attacker's account.
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.
When you log in to a website, it usually uses a secret token to stop other sites from submitting forms on your behalf. Here, the extra security step (MFA) did not check that token, so an attacker could trick you into logging into their account. If you then posted a private bug report, the attacker could read it.
What is CSRF?
Another site makes a signed-in user's browser perform an action they did not intend.