Page MenuHomePhabricator

UploadWizard: Honor AbuseFilter showcaptcha consequence on publish
Open, Needs TriagePublicBUG REPORT

Description

Steps to replicate the issue (include links if applicable):

  • On a wiki with AbuseFilter + ConfirmEdit and the showcaptcha custom action enabled ($wgConfirmEditEnabledAbuseFilterCustomActions = [ 'showcaptcha' ]), create an AbuseFilter matching uploads (e.g. action contains "upload") with the "Require CAPTCHA verification to perform the action" (showcaptcha) consequence.
  • Upload a file as a user matched by the filter — via Special:UploadWizard.
  • Watch the ConfirmEdit log channel and the abuse_filter_log entry for the hit.

What happens?:

On UploadWizard, adding a file runs the stash phase (action = stashupload) and the filter matches — abuse_filter_log records the hit (filter 5, afl_action = stashupload) but with afl_actions empty. ConfirmEdit logs:

> [ConfirmEdit] Filter 5: stashupload is not defined in the list of triggers known to ConfirmEdit

because stashupload is not in CaptchaTriggers::CAPTCHA_TRIGGERS, so CaptchaConsequence::execute() returns false and the showcaptcha consequence does nothing.

What should have happened instead?:

The showcaptcha consequence should force a CAPTCHA for the matched upload (including for users who would otherwise skip the CAPTCHA), the same way it works for edit, createaccount, etc.

Event Timeline

Change #1305057 had a related patch set uploaded (by Mpostoronca; author: Mpostoronca):

[mediawiki/extensions/ConfirmEdit@master] CaptchaTriggers: Add upload and stashupload as CAPTCHA triggers

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

Change #1305057 abandoned by Mpostoronca:

[mediawiki/extensions/ConfirmEdit@master] CaptchaTriggers: Add upload and stashupload as CAPTCHA triggers

Reason:

we decided to write a new hook

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

Change #1305245 had a related patch set uploaded (by Mpostoronca; author: Mpostoronca):

[mediawiki/extensions/UploadWizard@master] Honor AbuseFilter showcaptcha consequence on UploadWizard upload

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

Change #1305246 had a related patch set uploaded (by Mpostoronca; author: Mpostoronca):

[mediawiki/extensions/ConfirmEdit@master] CaptchaConsequence: Allow extensions to claim CAPTCHA trigger actions

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

Change #1305246 merged by jenkins-bot:

[mediawiki/extensions/ConfirmEdit@master] CaptchaConsequence: Allow extensions to claim CAPTCHA trigger actions

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

Change #1310014 had a related patch set uploaded (by Mpostoronca; author: Mpostoronca):

[mediawiki/extensions/ConfirmEdit@master] SimpleCaptcha: Add shouldSkipCaptcha() exemption helper

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

Change #1310015 had a related patch set uploaded (by Mpostoronca; author: Mpostoronca):

[mediawiki/extensions/ConfirmEdit@master] SimpleCaptcha: Add public getCaptchaApiData() accessor

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

Change #1310014 merged by jenkins-bot:

[mediawiki/extensions/ConfirmEdit@master] SimpleCaptcha: Add shouldSkipCaptcha() exemption helper

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

Change #1310015 merged by jenkins-bot:

[mediawiki/extensions/ConfirmEdit@master] SimpleCaptcha: Add public getCaptchaApiData() accessor

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