Page MenuHomePhabricator

Deprecate $wgWhitelistRead and $wgWhitelistReadRegexp (and related code)
Closed, DeclinedPublicSecurity

Description

The global variables (and functionality behind) $wgWhitelistRead and $wgWhitelistReadRegexp should be deprecated due to:

  1. Their ability to introduce certain security issues under various MediaWiki configurations (e,g, the currently-protected T297416)
  2. These variables aren't as relevant as they once were due to certain auth-related pages now simply allowing reads by default and the ability to edit MediaWiki:Loginreqpagetext and any related messages.

The technical changes should be fairly simple (DefaultSettings and PermissionsManager mainly) and then obviously updating release notes and perhaps proactively reaching out to the maintainers of the handful of extensions which make use of either of these global variables.

Details

Risk Rating
Informational
Author Affiliation
WMF Technology Dept

Event Timeline

sbassett set Security to Software security bug.Dec 13 2021, 10:31 PM
sbassett added a project: Security-Team.
sbassett changed the visibility from "Public (No Login Required)" to "Custom Policy".
sbassett changed the subtype of this task from "Task" to "Security Issue".

Actually... let's protect this until the upcoming security release.

See also related discussion in T297416#7568198 mentioning a different approach than deprecating.

sbassett removed a project: Security-Team.

Declined in favor of the other approach @Aklapper mentions at T297416#7568198.

sbassett triaged this task as Lowest priority.Dec 15 2021, 8:14 PM
sbassett changed Author Affiliation from N/A to WMF Technology Dept.
sbassett changed the visibility from "Custom Policy" to "Public (No Login Required)".
sbassett changed Risk Rating from N/A to Informational.
sbassett added a project: SecTeam-Processed.

We're going to be renaming this variables anyway given their language, but if people really want to keep this around as a variable, fine.

We're going to be renaming this variables anyway given their language, but if people really want to keep this around as a variable, fine.

I'd guess we could re-open this task (or create a similar task) down the road. Personally, I don't love the idea of these globals sticking around indefinitely.

We're going to be renaming this variables anyway given their language, but if people really want to keep this around as a variable, fine.

I'd guess we could re-open this task (or create a similar task) down the road. Personally, I don't love the idea of these globals sticking around indefinitely.

I've never run a world-facing private wiki, so I'd be interested to hear from actual users about how much these variables are critical to their world. Probably "lots". :-(

I honestly see this as a defense in depth principle. It's possible that future actions miss to add the given check, or current check mistakenly gets removed.

It's possible that future actions miss to add the given check, or current check mistakenly gets removed.

The new check fails closed, so if someone misses it they're protected. I would hope someone trying to remove a check for read permissions is properly scrutinized as security sensitive. As noted in the other ticket, this check exists in the Action API and now REST API subsystems without much issue.

I think there is value in having a public "home page" for private wikis versus a private one, and it's nice if we didn't have to resort to message overrides for it because that will cause complications in the future if we want to rename the message or add more parameters, etc. If we were implementing this feature today I think something like $wgPublicMainPage = 'Foobar'; would be simpler (and then you could do neat tweaks like switching where the logo points if you're logged in or out).

This may also be a new message like MediaWiki:Publicmainpage (and the current MediaWiki:Loginreqpagetext be removed, see T17484: Redirect to Special:UserLogin when logging is in required to proceed, instead of showing an error message).