Bug 2059948 - Do not offer recovery codes to Duo users - #2723
Open
loganrosen wants to merge 1 commit into
Open
Conversation
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
There was a problem hiding this comment.
Pull request overview
Restricts BMO recovery-code generation to TOTP accounts and rejects forged requests for unsupported MFA providers.
Changes:
- Adds an explicit recovery-code capability enabled only for TOTP.
- Hides Duo recovery controls and adds server-side enforcement.
- Adds Duo regression coverage and updates documentation.
Show a summary per file
| File | Description |
|---|---|
userprefs.cgi |
Validates recovery requests against the account’s provider. |
Bugzilla/MFA.pm |
Defines and enforces the provider capability. |
Bugzilla/MFA/TOTP.pm |
Enables recovery codes for TOTP. |
template/en/default/account/prefs/mfa.html.tmpl |
Conditionally displays recovery controls. |
template/en/default/global/user-error.html.tmpl |
Adds the unsupported-provider error. |
qa/t/2_test_login_duo.t |
Tests hidden controls and forged requests. |
docs/en/rst/using/two-factor-authentication.rst |
Documents recovery codes as TOTP-only. |
Review details
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
- Files reviewed: 7/7 changed files
- Comments generated: 0
- Review effort level: Balanced
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
BMO recovery codes only work with TOTP, but Duo users could still generate them from their MFA preferences.
This change makes recovery-code support an explicit MFA provider capability, enables it for TOTP only, and hides the recovery-code controls for Duo accounts. Server-side checks reject forged recovery requests, including requests that spoof TOTP as the provider. The two-factor authentication guide now documents recovery codes as TOTP-only.
Tests:
t/001compile.t t/004template.t t/005whitespace.t t/012throwables.tqa/t/2_test_login_duo.tqa/t/2_test_login_totp.thttps://bugzilla.mozilla.org/show_bug.cgi?id=2059948