Page MenuHomePhabricator

One of the checks for 'override-antispoof' permission is inverted (CVE-2022-28209)
Closed, ResolvedPublicSecurity

Description

One of the checks for 'override-antispoof' permission in the AntiSpoof extension is inverted, here: https://github.com/wikimedia/mediawiki-extensions-AntiSpoof/blob/7a5fc55dc31a0ab654a80a0fa6293027293c5b7c/includes/AntiSpoofPreAuthenticationProvider.php#L145

This might not be a real security issue – it looks like the faulty code path is only used for displaying UI messages (JS checks on Special:CreateAccount), and not for actually creating accounts. But I didn't go through everything to prove that for sure, so I'm filing as a security task just in case.

It's also not reproducible on Wikimedia wikis, because the anti-spoof checks there are handled by code in CentralAuth, which doesn't have the bug: https://github.com/wikimedia/mediawiki-extensions-CentralAuth/blob/061b493dc96a874bb49e1e67c10e416fce6040be/includes/CentralAuthPrimaryAuthenticationProvider.php#L512

This has been introduced in https://gerrit.wikimedia.org/r/c/mediawiki/extensions/AntiSpoof/+/618623, by accidentally removing a ! to negate a condition.

I discovered the problem while testing a patch for T167163.

Event Timeline

Reedy moved this task from Incoming to Security Patch To Deploy on the Security-Team board.
Reedy subscribed.

Patch LGTM.

Should be backported to 1.36 through 1.38, but isn't part of the tarball.

I think this one can probably just be deployed and then pushed through gerrit.

Reedy triaged this task as Low priority.Mar 18 2022, 1:19 AM

Change 772519 had a related patch set uploaded (by Reedy; author: Bartosz Dziewoński):

[mediawiki/extensions/AntiSpoof@master] Fix check for 'override-antispoof' permission

https://gerrit.wikimedia.org/r/772519

Change 772475 had a related patch set uploaded (by Reedy; author: Bartosz Dziewoński):

[mediawiki/extensions/AntiSpoof@REL1_38] Fix check for 'override-antispoof' permission

https://gerrit.wikimedia.org/r/772475

Change 772476 had a related patch set uploaded (by Reedy; author: Bartosz Dziewoński):

[mediawiki/extensions/AntiSpoof@REL1_37] Fix check for 'override-antispoof' permission

https://gerrit.wikimedia.org/r/772476

Change 772477 had a related patch set uploaded (by Reedy; author: Bartosz Dziewoński):

[mediawiki/extensions/AntiSpoof@REL1_36] Fix check for 'override-antispoof' permission

https://gerrit.wikimedia.org/r/772477

Change 772475 merged by jenkins-bot:

[mediawiki/extensions/AntiSpoof@REL1_38] Fix check for 'override-antispoof' permission

https://gerrit.wikimedia.org/r/772475

Change 772476 merged by jenkins-bot:

[mediawiki/extensions/AntiSpoof@REL1_37] Fix check for 'override-antispoof' permission

https://gerrit.wikimedia.org/r/772476

Change 772477 merged by jenkins-bot:

[mediawiki/extensions/AntiSpoof@REL1_36] Fix check for 'override-antispoof' permission

https://gerrit.wikimedia.org/r/772477

Change 772519 merged by jenkins-bot:

[mediawiki/extensions/AntiSpoof@master] Fix check for 'override-antispoof' permission

https://gerrit.wikimedia.org/r/772519

Mstyles renamed this task from One of the checks for 'override-antispoof' permission is inverted to One of the checks for 'override-antispoof' permission is inverted (CVE-2022-28209).Mar 31 2022, 5:43 PM
Mstyles closed this task as Resolved.
Mstyles claimed this task.
Mstyles changed the visibility from "Custom Policy" to "Public (No Login Required)".Mar 31 2022, 5:46 PM
Mstyles changed the edit policy from "Custom Policy" to "All Users".