Steps to replicate the issue:
- Set up a MediaWiki installation with OATHAuth installed.
- Add the following lines of code to LocalSettings.php:
$wgRateLimits['badoath']['&can-bypass'] = false; $wgRateLimits['badoath']['user'] = [ 1, 60 ]; $wgRateLimits['badoath']['user-global'] = [ 1, 60 ];
or
$wgRateLimits['badoath']['&can-bypass'] = false; $wgRateLimits['badoath']['ip-all'] = [ 1, 60 ];
- Just in case, restart the web server and whatever is running the PHP for the web server (e.g. PHP FPM).
- Create a new wiki user via the web interface or via the createAndPromote maintenance command.
- Set up 2FA for the new user.
- Log out.
- Log back in.
- When prompted, enter and submit an incorrect 2FA code multiple times.
- Enter and submit a correct 2FA code.
What happens?:
You're fully logged into your account.
What should have happened instead?:
You're rate limited at step 8 for 60 seconds.
Software version (on Special:Version page; skip for WMF-hosted wikis like Wikipedia):
| Product | Version |
|---|---|
| MediaWiki | 1.42.3 |
| PHP | 8.3.6 (fpm-fcgi) |
| ICU | 74.2 |
| MariaDB | 10.11.8-MariaDB-0ubuntu0.24.04.1 |
| Pygments | 2.17.2 |
OATHAuth extension's version is 0.5.0. The web server is nginx version 1.24.0.
Other information (browser name/version, screenshots, etc.):
Issue was observed both on a pre-existing wiki running behind Cloudflare as well as on a fresh (completely separate VPS; MediaWiki downloaded, installed and configured as instructed by MediaWiki.org itself) newly spun up wiki set up via the web interface (aforementioned software version info identical on both wikis) with nothing (including no other extensions than OATHAuth) additional installed or modified (excluding the issue reproduction steps) accessed directly via the server's IP. Both wikis use PHP's object cache as the MediaWiki cache and have PHP APCu installed.
