Page MenuHomePhabricator

Log attempts to access protected variable values even if no actual values were present
Closed, ResolvedPublic

Description

As part of the changes implemented in T387331: Provide a mechanism for other extensions to modify protected variables access requirements, access to protected variables is only logged if an actual value is present:

if ( count( $protectedVariableValuesShown ) ) {
	$logger = $this->abuseLoggerFactory->getProtectedVarsAccessLogger();

This replaces code that used to infer whether or not a log view should be logged, as technical limitations at the time caused a use case which unnecessarily logged views of public logs. However, we should still log if the logs of a protected filter were viewed, similar to how CheckUser logs all uses, even if no results were found. This can happen when a filter that was previously using protected variables no longer uses them, as it will still be considered protected into perpetuity.

Acceptance Criteria:

  • Views of logs of protected filter hits are logged, even if no protected variable values are exposed.

Event Timeline

Change #1133188 had a related patch set uploaded (by STran; author: STran):

[mediawiki/extensions/AbuseFilter@master] Always log when a user views details about a protected filter hit

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

Change #1133188 merged by jenkins-bot:

[mediawiki/extensions/AbuseFilter@master] Always log when a user views details about a protected filter hit

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

dom_walden subscribed.

I have tested accessing a large number of AbuseFilter logs on my local wiki and checking that a log is recorded each time. This included AbuseFilter logs of protected filters but which did not contain protected variables.

Test environment: local docker Abuse Filter – (d6dc418) 07:22, 15 April 2025. CheckUser 2.5 (7c58304) 07:29, 14 April 2025.