Summary
Special:GlobalContributions permissions checks assume that the groups with IP reveal rights never change. This is currently the case according to the IP reveal access policy.
Explanation of the issue
If the IP reveal rights are assigned to different groups, then the Special:GlobalContributions permissions check may become inaccurate for users in those groups, for up to 1 month. This means:
- If IP reveal rights were added to a group, then users in that group may not be able to reveal IPs via Special:GlobalContributions if they have an existing cache entry (meaning if they have checked Special:GlobalContributions within the last month). Eventually this will fix itself.
- If IP reveal rights are removed from a group, then users in that group may still be able to reveal IPs via Special:GlobalContributions if they have an existing cache entry (meaning if they have checked Special:GlobalContributions within the last month). Eventually this will fix itself.
This is also the case for other permissions, e.g. seeing deleted edits.
This only affects changing which rights are assigned to groups. Special:GlobalContributions will show the correct data to a user straight away if they are added to or removed from a group with IP reveal rights.
Recommendations if changing group rights
As summarized in T396217#11065904, we advise that it is probably OK for some cache entries to be out of date for a while given the types of changes we expect to happen. We don't think it is likely that sensitive rights will be removed from groups, thus enabling users to see data that they shouldn't. We expect that assigning these rights to additional groups will be very infrequent.
However, this task should be read through and a judgement should be made about this, if ever the group rights assignments do change.
Technical notes
For more details, including possible solutions to invalidate the cache when the group rights assignment changes, see T396217#11065904.
Special:GlobalContributions caches its external permissions lookups because they're expensive but necessary. This cached value relies on being invalidated if the user ever gains or losses permissions in order to ensure that if the permission can affect their lookup permissions, Special:GC will accurately reflect that. The only way to programmatically declare this invalidation is on user group change (local and global). However, rights can be added/removed to groups via config and if a relevant right is added/removed this way, the cache invalidation has no way of seeing this.
The only protection against this drift is policy and institutional knowledge not to do the thing. If policy changes or a config changes, we need to decide and document:
- what to do preemptively (eg. in case of policy change and we have time to prepare)
- what to do reactively (eg. in case of a config change we need to respond to)
Acceptance Criteria
From T396217#11065904:
- Update the way we cache so that the data can't get arbitrarily old - https://gerrit.wikimedia.org/r/c/mediawiki/extensions/CheckUser/+/1176511
- Update the config documentation patch from T396217#10891325 to advise reading through this task before changing the rights assignment for the IP reveal rights - https://gerrit.wikimedia.org/r/c/operations/mediawiki-config/+/1154308
- Update the description of this task to make it clear that, if the IP reveal rights assignments change, we advise doing nothing by default, but we advise reading through this task and deciding whether doing nothing is still the best course of action.