Page MenuHomePhabricator

Adjust Content Translation to changes in AbuseFilter and SpamBlacklist systems
Closed, ResolvedPublic


When saving an edit is prevented by the AbuseFilter or SpamBlacklist extensions, the error is currently reported as a successful API response with a 'failure' code in the body ( AbuseFilter: P8988, SpamBlacklist: P8990 ).

In the future, these will be reported as standard API errors (AbuseFilter: P8989, SpamBlacklist: P8991 ).
Clients that do handle AbuseFilter or SpamBlacklist failures specially will need to be updated to check for error codes 'abusefilter-warning', 'abusefilter-disallowed', and/or 'spamblacklist' and handle them as they do the current AbuseFilter and SpamBlacklist failures, if they want to preserve their current special handling.

Note that edit failures due to CAPTCHAs from ConfirmEdit are not being changed at this time. They will continue to be reported as before (ConfirmEdit: P9076 )

Event Timeline

Pginer-WMF triaged this task as Medium priority.Sep 11 2019, 9:50 AM
Pginer-WMF updated the task description. (Show Details)
Pginer-WMF raised the priority of this task from Medium to High.Sep 11 2019, 11:57 AM

In order for the adjustments to catch the train before the Abuse filter changes take effect, the code should be ideally reviewed, merged and tested by September 17 (i.e., during the next 6 days). So, I'm increasing the priority to high due the time constraints.

Change 535874 had a related patch set uploaded (by Petar.petkovic; owner: Petar.petkovic):
[mediawiki/extensions/ContentTranslation@master] Update Abuse Filter error handling code

Change 535881 had a related patch set uploaded (by Petar.petkovic; owner: Petar.petkovic):
[mediawiki/extensions/ContentTranslation@master] Remove obsolete abuse filter error handling in CX1

Change 535881 merged by jenkins-bot:
[mediawiki/extensions/ContentTranslation@master] Remove obsolete abuse filter error handling in CX1

Change 535874 merged by jenkins-bot:
[mediawiki/extensions/ContentTranslation@master] Update Abuse Filter error handling code

@Petar.petkovic any hints on how to test this?

There were changes in how Abuse Filter sends data when publishing is prevented due to some filter being hit. Due to good communication, the changes were brought to our attention in time, before changes in Abuse Filter ended up in production. The changes are rolling out in 1.34.0-wmf.23.
We reacted and adapted our code to changes. That means, there is no environment (besides local) where you can see what would happen if we didn't adapt to changes.

What you can do is check that errors are reported correctly in Content Translation when Abuse Filter is hit and preventing publishing. You can use cx2-testing for this and check Abuse Filter rules created over there. Look for rules which have "Disallow". I used rule #4, which checks for YouTube links. Steps how I got abuse filter to get hit:

  1. Created new account to be sure user_age < 600 condition defined in Abuse Filter is satisfied
  2. Start translating any article with any language pair
  3. Add first paragraph and type "" somewhere inside the paragraph
  4. Add another paragraph. Error in issue card system should be registered
  5. Now that we have error, publish button is disabled and we cannot attempt publishing, but due to T226280, if we add another section, button gets enabled again
  6. Try publishing and you should see:

af-cx2-testing.png (938×1 px, 70 KB)

Trying to translate Аскаров, Аскар Сайпулаевич from ru to en, I added the word BITCH which, according to abuse filter 225 should not be allowed and I was able to publish to my personal spaceАскаров,_Аскар_Сайпулаевич

User namespace is not among the namespaces (Main, User_talk) checked by that filter.

FYI for SpamBlacklist testing, I've always tried adding links to (the entire domain is disallowed for some reason).