Page MenuHomePhabricator

AbuseFilter not blocking edits that trigger the Filter
Open, Needs TriagePublic

Description

Discussing on https://es.wikipedia.org/wiki/Usuaria_discusi%C3%B3n:XanaG#Filtro_111, it was mentioned that there are certain cases where there is an AbuseFilter that should have avoided an edit to be saved, yet it went through.

Specifically, the last case we spotted was this version of filter 111 not blocking this edit.

The user did not gain autoconfirmed nor any other normal group that could have been later removed.

Using /test shows that the filter does trigger on that edit (i.e. the filter was written correctly). That version was active at the time (I checked it when that was the only filter version, even). The filter was enabled, with the only action of "Prevent the user from performing the action in question".

However, the edit clearly went through, and there is no AbuseLog either.

So, we have an edit that should have been blocked directly by the AbuseFilter (it doesn't even involve throttling) yet it didn't for unknown reasons. This isn't the first time that such weirdness is spotted.

Note: this is a different bug than T62481 (and T240951).

Event Timeline

Maybe mwlog1001 will have some details about what happened?

First of all, the edit was revdel'ed, hence I cannot help with on-wiki debugging in any way. Would it be possible to undelete it, at least temporarily?

That said, I've checked logstash to see if there's something interesting for that time. Lately, the AF channel is clogged by T230256, which I hope gets resolved soon. At least, I think that unset variables are not the cause of this bug, given that the filter only uses variables available for all edits, and the action in question was an edit. However, all log entries on logstash for that time (12/01, ~11:27 UTC) refer to unset variables.

We may try grepping logs on mwlog, but I don't think we'll find anything useful. Recently, I've reported T241519, which seems very similar, but we didn't find anything useful in the logs.

Given that this is not the first time this bug happens, I'm wondering whether we should add a debug line at the end of checkAllFilters, e.g.

$logger->debug( __METHOD__ . ' filters matched: {filters}', [ 'filters' => implode( ', ', $matchedFilters ) ?: 'none', 'user' => $this->user->getName(), 'title' => $this->title->getPrefixedText() ] );

to be executed unconditionally for all actions. That would certainly help us understand whether the issue is with parsing the filter or with taking consequences. Note, however, that it would add gazillions of log entries. To reduce the confusion, I'd like to wait for r538598 before moving on.