Steps to reproduce (on vagrant with oauth role on):
- visit oauth hello world app
- authorize
- disable hello world app
- verify identity
Tgr | |
Oct 19 2016, 1:35 AM |
F4631569: 0001-SECURITY-check-stage-and-user-blocked-locked-status-.patch | |
Oct 19 2016, 10:42 PM |
F4624363: 0001-SECURITY-check-stage-and-user-locked-status-in-ident.patch | |
Oct 19 2016, 2:48 AM |
Steps to reproduce (on vagrant with oauth role on):
Also, the API disallows actions when the user is blocked and $wgBlockDisablesLogin is on, but /identify does not.
- if ( !$localUser || !$localUser->isLoggedIn() ) { + if ( !$localUser || !$localUser->isLoggedIn() || $localUser->isLocked() ) { throw new MWOAuthException( 'mwoauth-invalid-authorization-invalid-user' );
Instead of throwing 'mwoauth-invalid-authorization-invalid-user' for the added condition, it would make more sense to throw 'mwoauth-invalid-authorization-blocked-user'. Also, you're not checking the $wgBlockDisablesLogin && ->isBlocked() case.
Fixed:
Thanks! (And sorry for forgetting to respond. I wanted to deploy it and then got distracted.)
Let's keep it open until it's merged in master (and the task can be made public), though.
@demon do you want to make a proper security release for this? IMO it is significant enough to warrant a backport (/identify was added in 1.23 so that means 1.23, 1.26 and 1.27) but not severe enough for the whole security release process with the pre-announcement and whatnot. If the old branches will also get new releases when 1.28 is released, IMO we can just merge to master and backport and be done with it.
Since it's not bundled I say let's do that. Push to master + all supported branches and send an announcement to the usual places.
Merged as https://gerrit.wikimedia.org/r/#/c/317733/ (I probably should have made the task public first) and backported.
Change 318228 had a related patch set uploaded (by Gergő Tisza):
SECURITY: check stage and user blocked/locked status in /identify
Change 318228 merged by jenkins-bot:
SECURITY: check stage and user blocked/locked status in /identify