TMH intentionally won't let bots execute transcodes, but this seems to be a rather bad over-sight.
Reported by @Revent.
Jdforrester-WMF | |
Mar 17 2017, 11:05 PM |
F35005857: 01-T160800.patch | |
Mar 14 2022, 9:47 PM |
F34924619: 01-T160800.patch | |
Jan 20 2022, 3:55 PM |
F34911602: T160800.patch | |
Jan 8 2022, 9:22 PM |
TMH intentionally won't let bots execute transcodes, but this seems to be a rather bad over-sight.
Reported by @Revent.
I had emailed Brion about this, after a mention on IRC.
A client logged in through the API via a 'botpassword' cannot reset transcodes... it requires a client login.
However, and this is the problem, a blocked user CAN use the API to reset transcodes... this leaves open the potential for a problematic DOS attack, by resetting them en-masse for no reason.
From T296764, resetting a transcode creates a public log of that action:
If a user is blocked and suppressed, the user can continue to abusively create public logs with that suppressed username, essentially leaking suppressed data.
Also since the transcode-reset right is part of the implicit autoconfirmed group, I don't think there would be any way for local sysops to prevent possible abuse (by removing the right).
@brion: Could you review the patch (or have an idea who could review the patch)? Thanks.
Code-Review-1
The permissions check needs to go after // Make sure we have a valid Title so we know $titleObj isn't null. Otherwise LGTM (though untested so far)
New patch that places the permissions check after the title check per @Legoktm:
Deployed the following patch (basically the same as the one above, but with some extraneous whitespace removed):
Change 776014 had a related patch set uploaded (by Mstyles; author: Dylsss):
[mediawiki/extensions/TimedMediaHandler@master] SECURITY: Disallow blocked users from resetting transcodes
Change 775940 had a related patch set uploaded (by Mstyles; author: Dylsss):
[mediawiki/extensions/TimedMediaHandler@REL1_35] SECURITY: Disallow blocked users from resetting transcodes
Change 775941 had a related patch set uploaded (by Mstyles; author: Dylsss):
[mediawiki/extensions/TimedMediaHandler@REL1_36] SECURITY: Disallow blocked users from resetting transcodes
Change 775942 had a related patch set uploaded (by Mstyles; author: Dylsss):
[mediawiki/extensions/TimedMediaHandler@REL1_37] SECURITY: Disallow blocked users from resetting transcodes
Change 776014 merged by jenkins-bot:
[mediawiki/extensions/TimedMediaHandler@master] SECURITY: Disallow blocked users from resetting transcodes
Yeah we just plum forgot to fix this. :) It's an irksome DoS vector though, so good to fix! Merged the patch to master; I'm leaving the branch patches until someone's ready to deploy.
Hey @brion - where were you looking to deploy these? Are there external mediawiki installations we should look at? Per the comment above (T160800#7775935), this patch has been on Wikimedia production releases since March 14th, 2022. And should now fall off for 1.39.0-wmf.6 since it was merged to master. And we'll (re-)announce the issue to the community with the next supplemental security release (T297839), due out, hopefully, tomorrow.
Change 775942 merged by jenkins-bot:
[mediawiki/extensions/TimedMediaHandler@REL1_37] SECURITY: Disallow blocked users from resetting transcodes
Change 775941 merged by jenkins-bot:
[mediawiki/extensions/TimedMediaHandler@REL1_36] SECURITY: Disallow blocked users from resetting transcodes
Change 775940 merged by jenkins-bot:
[mediawiki/extensions/TimedMediaHandler@REL1_35] SECURITY: Disallow blocked users from resetting transcodes