Page MenuHomePhabricator

I was logged in despite a 2FA error
Closed, DuplicatePublic

Description

I have been getting randomly logged out (see T387061) which is annoying but not a security issue per se.

Minutes ago, I refreshed a previously logged in tab on fawiki (my last edit on fawiki was at 14:09 UTC and time now is 21:55 UTC) and I found myself to be logged out again. So, I started logging in. Since I am a CU on fawiki, I have to enter a 2FA token when I log in. Either I entered the wrong token, or MediaWiki incorrectly deemed as an "expired" token, because when I entered it and pressed submit, the page showed me a red warning box indicating the token is invalid or has expired. Below it was NOT a place to enter the 2fA token again though (as is typically the case when you enter an invalid token). Instead, below it was simply a blue button for getting "centrally logged in". Thankfully, I was able to go back in my browser and take a screenshot.

The issue: pressing on that button logged me in successfully even though I apparently had entered an invalid 2FA token.

image.png (776×714 px, 65 KB)

Additional clues: The red message is centralauth-error-badtoken and the blue button is centralauth-non-login-wiki-buttonlabel.

Details

Risk Rating
Low
Author Affiliation
Wikimedia Communities

Event Timeline

Huji changed the subtype of this task from "Task" to "Bug Report".
Huji updated the task description. (Show Details)

Logs mentioning your username in the relevant time frame: https://logstash.wikimedia.org/goto/1d891346190d4c750ec8b7e89803a0c9

One of the entries is OATHAuth user Huji entered a valid OTP, so most likely this was some kind of bug with the redirection after login (maybe T390784), combined with our surprising autologin behavior, and not a security issue.

We'll have a closer look, but I'm writing this just to reassure you :)

Thanks. Definitely reassuring.

centralauth-error-badtoken (if you see it on the local wiki) typically means that the login was successful but something went wrong with the redirect back to the local wiki afterwards. So yeah I think this is just a duplicate of T390784: Error when logging-in on auth.wikimedia.org: "The provided authentication token is either expired or invalid.".

Thanks for your followed up. I would argue that the phrase "The provided authentication token is either expired or invalid." does not mean "something went wrong with the redirect back to the local wiki" and so a separate message should be created and displayed in such circumstances.

And I have no issue with merging this with T390784 and/or with making this task public, if you deem appropriate.

The error is about an expired token that's used during authentication so technically the message is true, but you are right that "authentication token" sounds like it's about your password or 2FA token, when it's actually about an internal token, so the message could use improvement.

sbassett triaged this task as Low priority.
sbassett removed a project: WMF-NDA.
sbassett changed the subtype of this task from "Bug Report" to "Security Issue".
sbassett changed Author Affiliation from N/A to Wikimedia Communities.Apr 21 2025, 3:00 PM
sbassett changed the visibility from "Custom Policy" to "Public (No Login Required)".
sbassett changed the edit policy from "Custom Policy" to "All Users".
sbassett changed Risk Rating from N/A to Low.
sbassett changed the subtype of this task from "Security Issue" to "Task".
sbassett added a project: SecTeam-Processed.