When using the AbuseFilter 'abusefiltercheckmatch' API, I can compare against the value of protected variables that the user cannot see. For example, if CheckUser is installed I can inspect the value of user_unnamed_ip when the user does not have the right to see temporary account IP addresses.
This can happen when comparing against a specific AbuseFilterLog entry (logid) or RecentChange (rcid).
Steps to reproduce
- Install the AbuseFilter and CheckUser extensions on your local mediawiki environment
- Make a test edit using a temporary account
- Log in as a user who has the sysop and checkuser group
- Open Special:CheckUser, enter the temporary account name, submit the form, and note the IP used by the temporary account
- Go to Special:AbuseFilter/new
- In the conditions field, enter something like the following where 1.2.3.4 is replaced with the IP found in step 4
user_unnamed_ip = '1.2.3.4'
- Edit using a temporary account again
- While logged in as the user with sysop and checkuser, find the AbuseFilterLog entry for the edit performed in step 7 and note down the ID.
- Log in as a user who has the sysop group but not the checkuser group
- Open Special:AbuseFilterLog/ID where the ID is the ID noted down in step 8, and note that an error is displayed
- Open Special:ApiSandbox, select abusefiltercheckmatch as the action, and enter logid as the ID from step 7
- Enter user_unnamed_ip = '1.2.3.4' where 1.2.3.4 is the IP you noted down in step 4
- Submit the API request and note that the API says that the filter conditions matched the log entry
What happened
The API responded to match the filter log against the filter log entry. For example:
What should have happened
The API should have thrown an error saying that the user does not have access to that log entry
Acceptance criteria
- The AbuseFilter 'abusefiltercheckmatch' API checks protected variable access for both 'logid' and 'rcid' requests
