Things my team is working on: MediaWiki-Core-Platform-Team
Side projects I am working on (or planning to, eventually): User-Tgr
You can find more info about me on my user page.
User Details
- User Since
- Sep 19 2014, 4:55 PM (633 w, 4 d)
- Availability
- Available
- IRC Nick
- tgr
- LDAP User
- Gergő Tisza
- MediaWiki User
- Tgr (WMF) [ Global Accounts ]
Yesterday
I think this is fixed? The dashboard certainly shows plenty of globally-blocked autocreation attempts. We might just have forgotten to update it.
Mon, Nov 9
T444228: MediaWiki reauthentication prompt does not appear with $wgNamespaceProtections is not exactly a JS editing issue, but somewhat related.
No real reasons I know of, other than both having existed for a long time. We wanted to change it once but got lost in bikeshedding about the name.
Sun, Nov 8
Documentation changes:
- mw:OAuth/Client credentials (new page)
- mw:OAuth/For_Developers (cross-linking)
- mw:OAuth/Owner-only_consumers (cross-linking)
- mw:Wikimedia_APIs/Rate_limits (update references to client credentials as being planned in the future)
- mw:Wikimedia_APIs/Rate_limits/FAQ (update references to client credentials as being planned in the future)
A similar request has been declined before: https://issues.gerritcodereview.com/issues/40001846
Sat, Nov 7
Yeah, in theory this is fixed.
Can we just taint CSRF tokens obtained via CORS?
Uh, right. We could disallow CORS for the token API (cross-domain requests would then have to use CentralAuth tokens) but that's disruptive and would add a performance overhead. Modern browsers set Sec-Fetch-Mode: same-origin on non-CORS requests (also they usually set the Origin header) but it would probably be a bad idea to rely on that exclusively for security purposes. (We could do it anyway as layered defense.)
Fri, Nov 6
All CORS requests go through ApiMain::handleCORS() or CorsUtils::modifyResponse() or CorsUtils::createPreflightResponse() so the decision could happen there. It would take some refactoring as none of those places have trivial access to the handler / modules, but it would be much more flexible than changing the CSRF tokens.
As noted in T22814#248552, we could get rid of origin/cross-origin by pushing some of the relevant logic to the CDN layer. That would be better developer experience and better for caching, but harder to maintain.
Wrt origin, the basic problem it is trying to solve is that 1) for CORS requests the Access-Control-Allow-Origin response header will depend on what origin the request is made from (in part because we want to allow CORS from our domains but not from external domains, in part becase authenticated CORS requires a specific origin in Access-Control-Allow-Origin so we can't just always use *); 2) that means the cache must vary on Origin, but 3) browsers set the Origin header for many non-CORS requests so that would cripple caching. Rule of thumb for Varnish is that the same URL must either always or never vary on a given thing. So including the origin in the URL lets you vary on Origin, but only for CORS requests. (I'm not entirely sure why it needs a value.) See T22814#248552 for context.
Assert & Assertuser → not v0; move to header; consider combining to a single param?
we can just pass a valid token to the action API if we know that the request is safe [against CSRF]
Centralauthtoken → already handled as a header
maxage/smaxage is used by our own clients quite a bit (VisualEditor, MediaViewer, Popups etc). You can't send cache headers from the action API by default, since there is no invalidation mechanism, ant there is no way to know how sensitive the client is going to be to stale data. But the client does know that, so it basically just outsources caching decisions to the client. (At the cost of fragmenting the CDN cache - different [s]maxage values will result in different cache entries, on top of the action API's other caching woes with parameter ordering etc. The assumption is that WMF code will be careful in how to use it, and other clients probably won't use it much.)
Thu, Nov 5
Verified in the webrequest DB that:
- /w/rest.php/oauth2/access_token requests show the OAuth version, client ID and grant type, for all three grant types
- other REST API request show the OAuth version and client ID
- action API request show the OAuth version and client ID
This is blocked on SRE disagreeing that it should be done, right?
Wed, Nov 4
CI support was de facto removed in T398469: Migrate mediawiki/vagrant CI to Bullseye and remove custom image, the jobs didn't work since then.
Thanks for the cleanup! The test account was, unsurprisingly, to test T219316 (long since fixed). I have no idea what the multimedia one was about, some kind of automation? If it ever worked, it probably got lost when the old MM team got disbanded a decade ago.
Mon, Oct 26
Wouldn't the spoofuser table be the more logical place for this?
To recap what was discussed elsewhere: the goal is being able to come up with a list of accounts that need to be synced with CiviCRM (based on an opt-in action that happens in MediaWiki). If you want to handle that in MediaWiki, it's probably best to create a new table for it because 1) you get full control of the exact business rules for your last-touched timestamp, rather than using a timestamp that's shared with all potential future CentralAuth usecases; 2) probably less effort to create a new table than to do a schema change on the large and heavily used globaluser table, 3) much easier to change or undo the approach in the future (given that the project is still experimental).
To recap what was discussed elsewhere: the use case is a maintenance script going through a lot of users while processing a big data dump from an external system. If you batch multiple writes into transactions, batching them into a single write probably doesn't get you that much extra performance, and as @Krinkle says it's not that straightforward to do. Transactions are controlled by the maintenance script (Maintenance::beginTransactionRound()/commitTransactionRound()), a lot of scripts use that with batches of 100 or 1000 or so. It also automatically waits if needed for replicas to catch up, which can be important when doing lots of writes.
Deletion is a lot of hassle (you want to retain for a while for incident investigations etc), and the screenshot doesn't really provide a use case. (Please copy the text of discussions in the future BTW, it's better for search, and images aren't included in notification emails.)
Could also just use oarc_oauth2_allowed_grants and call the old grant client_credentials_legacy or something like that. Either way, the tricky part is how/when the migration happens for third parties.
Thu, Oct 22
Per T180858#3774737, this doesn't solve any clear need, isn't really a bugfix (the API is doing what you ask it to do), and would probably have surprising side effects. I think we should just keep life simple and not do it.
(Maybe the API could return a warning when an impossible first character is used, feel free to file a task about that if it seems useful.)
Mon, Oct 19
Tested in production, works as expected.
Thanks @Rajveer42! Assuming this is fixed. (If it isn't, phaultfinder will eventually open an alerting task about the script failing due to some block. I don't think there's a more direct way to validate in production, short of setting up fake blocks which I rather wouldn't.)
Sat, Oct 17
PermissionManager::getUserPermissions() errs on the safe side by always applying session restrictions. Conceptually that's fine (we can't reliably tell whether the caller is interested in session restrictions or not, and erring in the other direction could cause serious vulnerabilities, e.g. by letting OAuth apps exceed their scopes). I see no security issue here.
Thu, Oct 15
Depending on whether you also need to unlink users who have recently unset the preference, either setting wikimedia-donor to a timestamp rather than a boolean, or having a separate wikimedia-donor-last-touched field seems like the easiest way of keeping track of the time.
Communication:
Tue, Oct 13
This is the only thing in the job output that seems like an error:
arwiki Unknown component: ext.cite.visualEditor, ext.cite.wikiEditor, ext.cite.community-configuration-autoname, ext.cite.referencePreviews, ext.confirmEdit.CaptchaWidget, ext.confirmEdit.hCaptcha, ext.confirmEdit.hCaptcha.styles, ext.confirmEdit.hCaptcha.gradeC, ext.globalCssJs.user, ext.globalCssJs.user.styles, ext.wikimediaMessages.ipInfo.hooks, ext.abuseFilter.ace, ext.visualEditor.editCheck.checks, ext.wikimediaEvents.visualEditor, mw.cx.externalmessages, ext.checkUser.tempAccountOnboarding, ext.checkUser.ipInfo.hooks, ext.checkUser.suggestedInvestigations, ext.quicksurveys.survey.ReadingLists.beta.feature.survey, ext.quicksurveys.survey.Automatic.Translation.Feedback, mediawiki.messagePoster
The new MediaWiki version is on group 0, but the authevents Logstash channel is sampled 1:1000 and has no group0 temp account creation events from the last day at all, and the Prometheus metric is not split by wiki (it made the dashboard slow to the point of uselessness). So I'm not sure there's a good way to assess impact other than waiting for the group 1 deployment, unless we can identify some non-sampled log event that would accompany the error.
Also a request ID would be useful.
If you can still reproduce, what's the chain of top-level HTTP requests / redirects?
Works for me on Chrome 154.0.8037.92 / Ubuntu in incognito mode. The browser is not redirected to the central domain though, and ends up with no central cookies. As far as I can see, that's a JS issue (the VE could should handle the redirect).
Probably a train blocker?
Those seem like two very different errors.
Mon, Oct 12
Still (or again?) happening. Should be fixed (well, ignored) by T432613: backfilLocalAccounts.php should not send alerts when the account is blocked though.
extensions/CentralAuth/maintenance/backfillLocalAccounts.php: Finished run autoCreateUser failed for Marmelade1964: Error: '''Your IP address is in a range that has been [[m:Special:MyLanguage/Global blocks|blocked on all Wikimedia Foundation wikis]].'''
Mesh timeout was updated in T390972: Restart CronJobs on failure of the service mesh, this can probably be closed now.
Mesh timeout was updated in T390972: Restart CronJobs on failure of the service mesh, this can probably be closed now.
Mesh timeout was updated in T390972: Restart CronJobs on failure of the service mesh, this can probably be closed now.
Mesh timeout was updated in T390972: Restart CronJobs on failure of the service mesh, this can probably be closed now.
This is a documented limitation of the minifier; similar changes have been rejected in the past to keep the code simpler (T37492: CSSMin::minify should not interfere with string values). Is there a real-world use case this bug is interfering with? The example in the task description is not something I'd expect to see in real code - it's brittle and there are almost certainly better ways to target a given hidden div.
To clarify, when you say "old notifications become re-highlighted", you don't mean individual notifications (as in the number on the icon changing, or the blue dot reappearing in the upper right corner of a notification entry in the dropdown) but rather one of the menu icons becoming re-highlighted (going from gray to red/blue), right?
Oct 12 2026
Naming isn't the main problem. In any case let's continue this thread in a dedicated task -> T440867: Make new OAuth 2 client-credentials apps authenticated by default (set $wgOAuth2ClientCredentialsOwnerAuthCutover default-on)
WikiMap has changed recently, we should check whether this will be still an issue after T440863: Remove most uses of MockWikiMapTrait-
(Tagging as MediaWiki-Core-Platform-Team as we created the mock mainly for CentralAuth.)
We are (since a few days ago) not setting callback URLs on owner-only and client-credentials apps since they have no purpose, but yeah it should be displayed in a more meaningful way (probably by just hiding the whole field). If you are seeing it on an app with auth code grant or an OAuth 1 app, that's a bug in app validation.
Oct 9 2026
09:09:14 1) MediaWiki\Extension\OATHAuth\Tests\Integration\Special\OATHManageTest::testDisplaysIrremovableWarning 09:09:14 Failed asserting that " <snip> (oathauth-2fa-groups-notice-multiple-links-entry: 2, (group-interface-admin-member: TestUser 94aa7c.09d)(and)(word-separator)(group-sysop-member: TestUser 94aa7c.09d), 127.0.0.1, <a rel="nofollow" class="external text" href="http://127.0.0.1:9413/wiki/SomePage">SomePage</a>) <snip> (oathauth-2fa-groups-notice-multiple-links-entry: 1, (group-suppress-member: TestUser 94aa7c.09d), 127.0.0.1, <a rel="nofollow" class="external text" href="http://127.0.0.1:9413/wiki/DefaultPage">DefaultPage</a>) <snip> (oathauth-2fa-groups-notice-multiple-links-entry: 1, (group-interface-admin-member: TestUser 94aa7c.09d), remote-wiki.local, <a rel="nofollow" class="external text" href="http://remote-wiki.local/wiki/SomePage">SomePage</a>) <snip> " contains "(oathauth-2fa-groups-notice-multiple-links-entry: 2, (group-interface-admin-member: TestUser 94aa7c.09d)(and)(word-separator)(group-sysop-member: TestUser 94aa7c.09d), wikidb-unittest_.local".
so the $entry['wiki'] parameter differs. Not sure if that means the test finds the user on a different wiki than expected or something about wiki handling is broken (we know eg. WikiMap doesn't work well in unit tests).
Oct 6 2026
(Wrt the current high number of memcached errors, there is an investigation ongoing in T420223: Increase in number of memcached errors in eqiad. For replag, I have no idea what would count as unusually high.)
We'd need a fast system user check (e.g. T212720: System users should be in a dedicated user group).
What is the scenario in which an adversary can intercept the submitted code, but cannot intercept the challenge? Otherwise the combinatorics is entirely pointless, and each fragment can only be used once.
Oct 5 2026
That seems like a more confusing variant of issuing recovery codes (which we do).
CentralAuthUnattachUserJob jobs stopped being scheduled when the train reached group 2, so whatever was happening (still not sure what resulted in multiple jobs per minute) is fixed.
Oct 4 2026
Another approach would be to ignore all tokens where the iat (issued at) field is older than some given threshold. That's robust against accidental minting of tokens with no / far future expiry.
I wonder if we should have some kind of suppression system (along the lines of the current production hack - an array with normalized message => sampling rate that overrides normal sampling settings) so that deployers can deal with non-critical-seeming log flood via a simple and well-documented config change.
The number of events with throttle warning is always going to be 1000 (or more generally 1000 x number of unique message strings that are being throttled), since that's the throttle limit, right? The real (unthrottled) number of events would be more informative as that tells you how much burden it is putting on the event intake, but I don't think that number is available within Logstash.
Oct 3 2026
Pushing Gerrit patches for low-risk security issues (which are nevertheless private) is not uncommon, and I think in that case we'd still want to link to the Phab task, so warn reject rather than reject would better. (Or allow the patch through when an I-Know-What-I-Am-Doing: Yes footer is present, or whatever.)
Oct 1 2026
How does it put pressure on the logging infra if it's a relatively small increase in total log traffic? 200K / 30 min is about 100/sec, IIRC the total MediaWiki log volume is a couple thousand per sec.
Should be in backlog, not radar, since it's about a component we own. Also maybe worth another look if it's happening 50 times a day.
Sep 29 2026
Oh, right, the service factory could be reinitialized at any time. Guess we'll just have to use Utils::getCentralWiki() everywhere then.
