Count login code requests against the member's own throttle - #4
Merged
Merged
Conversation
JeroenDeDauw
force-pushed
the
fix/login-code-throttle-per-identity
branch
4 times, most recently
from
August 16, 2026 22:42
926075a to
6bc84e4
Compare
MediaWiki keys its login throttle on the username the submitted requests declare, and the login code request declared a field of its own. So every code request counted against one counter keyed on the client IP with no account behind it: everyone behind an office NAT shared a budget of five in five minutes, and shared it with anyone pressing any other login button from the same IP. That counter lives in the main object cache, so this bit on every wiki that has one. The address now travels in the login form's own username field, which is what a member's username is, so each address draws on a budget of its own. The separate "Email address" box is gone. Keeping that box and declaring a username as well was the obvious alternative: it renders two identity boxes when local login is off, and any disagreement between the two makes MediaWiki throw where ConfirmEdit calls it without a catch, which is an uncaught fatal on the login form. What bounds a single client is now the extension's own limits, three per address per fifteen minutes and ten per IP, which count every code request alike whether or not the allowlist admits it. That field is also where ConfirmEdit reads the login subject, and its per-address bad-login counter is emptied only by a login that succeeds, which for a member's address means one the allowlist admitted. Whether a code request met a captcha would therefore have told an admitted address from any other, and a case variant of the address could never be cleared again. Loading the extension now turns that trigger off, wiki-wide, so accounts that do have passwords lose their per-account captcha escalation. The per-IP counter beside it, which no login empties, and core's own password throttle are left alone. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
JeroenDeDauw
force-pushed
the
fix/login-code-throttle-per-identity
branch
from
August 16, 2026 22:49
6bc84e4 to
e8cce1d
Compare
JeroenDeDauw
marked this pull request as ready for review
August 17, 2026 21:41
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.
MediaWiki keys its login throttle on the username the submitted requests declare, and the login code
request declared a field of its own. So every code request counted against one counter keyed on the
client IP with no account behind it: everyone behind an office NAT shared a budget of five in five
minutes, and shared it with anyone pressing any other login button from the same IP. That counter
lives in the main object cache, so this bit on every wiki that has one.
The address now travels in the login form's own username field, which is what a member's username
is, so each address draws on a budget of its own. The separate "Email address" box is gone. Keeping
that box and declaring a username as well was the obvious alternative: it renders two identity boxes
when local login is off, and any disagreement between the two makes MediaWiki throw where ConfirmEdit
calls it without a catch, which is an uncaught fatal on the login form.
What bounds a single client is now the extension's own limits, three per address per fifteen minutes
and ten per IP, which count every code request alike whether or not the allowlist admits it.
That field is also where ConfirmEdit reads the login subject, and its per-address bad-login counter
is emptied only by a login that succeeds, which for a member's address means one the allowlist
admitted. Whether a code request met a captcha would therefore have told an admitted address from
any other, and a case variant of the address could never be cleared again. Loading the extension now
turns that trigger off, wiki-wide, so accounts that do have passwords lose their per-account captcha
escalation. The per-IP counter beside it, which no login empties, and core's own password throttle
are left alone.
The box is now labelled "Username", so the cue that an email address belongs in it is the button
under it rather than the label on it; help text on an authentication field is never rendered, so the
label was the whole cue. A wiki can override
MediaWiki:Userlogin-yourname, or the extension couldrelabel the field through
AuthChangeFormFields. Neither is done here, because the wording is aproduct call.