I propose to implement a system that warns a user who is making an edit in the AbuseFilter that may cause false positives in a dangerous way. Like regex mistakes that may cause empty matches or match infinitely.
Kind regards.
I propose to implement a system that warns a user who is making an edit in the AbuseFilter that may cause false positives in a dangerous way. Like regex mistakes that may cause empty matches or match infinitely.
Kind regards.
Subject | Repo | Branch | Lines +/- | |
---|---|---|---|---|
Return warnings from the parser, add warning for catch-all regexps | mediawiki/extensions/AbuseFilter | master | +137 -39 |
Status | Subtype | Assigned | Task | ||
---|---|---|---|---|---|
Resolved | Daimona | T264768 Avoid dangerous AbuseFilter edits | |||
Resolved | Daimona | T187686 Write an Ace worker for AbuseFilter and add clientside validation |
The property of being a "dangerous" filter is undecidable due to Rice's theorem (I believe), so there's no way we can fully implement this. We might add some common checks (e.g. for regexps matching the empty string), but that wouldn't be complete. And even then, disallowing the edit is out of question. We should only show a warning to the user, but that's blocked on T187686, which seems non-trivial.
@Daimona: Does that mean this task should be either "declined", or "stalled" and T187686 should be marked its subtasks? It's unclear to me what this is stalled on...
It's unclear to me as well. It depends on what exactly is the scope of this task. More precisely:
My opinion is that (2) seems the best option, but I'd like to hear from @SRuizR what kind of "errors" we should warn about.
Aside from regexp patterns matching blank (or matching everything), do we have any other "dangerous" edits in mind? Have they ever happened, and if so, have they happened frequently enough to be a concern?
Also, why bother? If a filter matches too many edits, it'll quickly get throttled anyway.
The only thing I thought about was the regex empty match, but there may be other things. Anyway, I think Daimona's option (2) is the best thing to avoid incidents.
I think this could be merged with T187686 because I think it's the only possible thing that could be made.
Not really. These are really two different things. If this couldn't be made, the task would be declined.
Some comments as a global abuse filter writer.
So I suppose that the current design is more purposed to run the risk to make an edit, especially to a regex and see what it does, rather than have one make edits and check the outcome prior to committing the filter. So even the ability to have a temporary save of a filter and check of a regex would be useful.
Change 650530 had a related patch set uploaded (by Daimona Eaytoy; owner: Daimona Eaytoy):
[mediawiki/extensions/AbuseFilter@master] Return warnings from the parser, add warning for catch-all regexps
Change 650530 merged by jenkins-bot:
[mediawiki/extensions/AbuseFilter@master] Return warnings from the parser, add warning for catch-all regexps
I'm going to close this as resolved since the regex-matches-all warning was implemented, and that seemed to be the only clear actionable from this task. Similar feature requests can be filed as separate tasks.