[go: nahoru, domu]

Page MenuHomePhabricator

"Anonymous" users cannot undo changes related to structured data due to AbuseFilter
Open, Needs TriagePublicBUG REPORT

Description

List of steps to reproduce (step by step, including full links if applicable):

What happens?:
AbuseFilter blocks the action, three rules are triggered at once: 27, 58 and 84, e.g. 27, 58 and 84. Please look closely at variables old_content_model, new_content_model, old_wikitext, new_wikitext (and optionally edit_diff, added_lines, removed_lines) in the mentioned log entries. I have no idea what, but something is definitely screwed up. I think it started about a month ago.

What should have happened instead?:
AbuseFilter should allow the action.

Event Timeline

Issues about specific AbuseFilter should be raised at local wiki unless it is related to the extension itself, such as a missing or broken feature.

@Bugreporter Just look at the log entries – these three rules/filters have been triggered because something is screwed up "below", perhaps AbuseFilter extension itself. It's not a problem with the rules, they have been working for years and have not been changed recently.

The first thing that comes to mind is that whoever is firing the EditFilterMergedContent hook is passing SlotRecord::MAIN instead of the actual slot being edited. I'll try to reproduce this locally and see if that's indeed the reason.

Based on my local testing, my guess was right. This was caused by r747596 -- notice how $slotRole is not passed to onEditFilterMergedContent. OTOH, it's really not that patch's fault, since the parameter is not officially documented in the hook documentation, nor is it present in the EditFilterMergedContentHook interface (see T288885).

At this point, I think that the core hook should be changed to pass this parameter. Making it mandatory would be a breaking change and we'd better replace the hook with a new one, so perhaps we can just add it as an optional (but recommended) parameter for now.

For the record, I had already created https://gerrit.wikimedia.org/r/c/mediawiki/extensions/AbuseFilter/+/776286, which is still waiting for review.
I don't think it will solve this problem. Looking at T288885, or doing something like T304238 is still much needed.

These don't look to me like changes related to structured data.

In edit https://commons.wikimedia.org/w/index.php?title=File:Queen_Victoria_by_Bassano.jpg&diff=prev&oldid=804669319 Cessy3 vandalistically added en caption "welcome". In edit https://commons.wikimedia.org/w/index.php?title=File:Queen_Victoria_by_Bassano.jpg&diff=prev&oldid=841293383 Haansn08 removed that caption, but earned abuse filter log entries https://commons.wikimedia.org/wiki/Special:AbuseLog/10343284 and https://commons.wikimedia.org/wiki/Special:AbuseLog/10343285 in the process because "New page wikitext, after the edit ($1) (new_wikitext)" is completely wrong (it is not wikitext at all, but a bastardized text representation of the change in wikibase-mediainfo) and triggered Commons Abuse Filter 58. Perhaps we can exclude changes where "New content model ($1) (new_content_model)" is 'wikibase-mediainfo' to remove such false positives?