Page MenuHomePhabricator

hCaptcha: Create mechanism to allow the showcaptcha consequence in AbuseFilter to always challenge the user
Closed, ResolvedPublic1 Estimated Story Points

Description

Summary

WMF's hCaptcha instance is set up in 99.9% passive and invisible mode. But when an AbuseFilter defines showcaptcha as its consequence, it should display a challenge.

Technical notes

We can use a separate sitekey for this, and find a way to swap the sitekey in use when showcaptcha is used in AbuseFilter.

Acceptance criteria

  • showcaptcha in AbuseFilter always displays a challenge when hCaptcha is enabled

Event Timeline

kostajh set the point value for this task to 0.5.

We can use this site key (c0343ab6-480e-4d5c-abc0-f86255586384) for a configuration that will result in an "always challenge" mode when hCaptcha is loaded.

kostajh changed the point value for this task from 0.5 to 1.Sep 30 2025, 11:59 AM

For whoever picks this up: please check in with other engineers about the approach before starting on the work.

We're also discussing using FancyCaptcha for the showcaptcha consequence.

Change #1196204 had a related patch set uploaded (by Samuel (WMF); author: Samuel (WMF)):

[mediawiki/extensions/ConfirmEdit@master] WIP: Use FancyCaptcha for AbuseFilter consequence

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

sguebo_WMF changed the task status from Open to In Progress.Oct 15 2025, 4:17 AM

Change #1203037 had a related patch set uploaded (by Kosta Harlan; author: Kosta Harlan):

[mediawiki/extensions/ConfirmEdit@master] [WIP] Support an "always challenge" SiteKey when shouldForceShowCaptcha is enabled

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

Change #1203547 had a related patch set uploaded (by Kosta Harlan; author: Kosta Harlan):

[operations/mediawiki-config@master] hCaptcha: Use FancyCaptcha for API edits and page creations

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

Change #1203547 merged by jenkins-bot:

[operations/mediawiki-config@master] hCaptcha: Use FancyCaptcha for API edits and page creations

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

Mentioned in SAL (#wikimedia-operations) [2025-11-11T14:52:03Z] <kharlan@deploy2002> Started scap sync-world: Backport for [[gerrit:1203547|hCaptcha: Use FancyCaptcha for API edits and page creations (T405595)]], [[gerrit:1203797|hCaptcha: Disable addurl trigger for hCaptcha edits (T409822)]]

Mentioned in SAL (#wikimedia-operations) [2025-11-11T14:54:47Z] <kharlan@deploy2002> kharlan: Backport for [[gerrit:1203547|hCaptcha: Use FancyCaptcha for API edits and page creations (T405595)]], [[gerrit:1203797|hCaptcha: Disable addurl trigger for hCaptcha edits (T409822)]] synced to the testservers (see https://wikitech.wikimedia.org/wiki/Mwdebug). Changes can now be verified there.

Mentioned in SAL (#wikimedia-operations) [2025-11-11T15:04:40Z] <kharlan@deploy2002> Finished scap sync-world: Backport for [[gerrit:1203547|hCaptcha: Use FancyCaptcha for API edits and page creations (T405595)]], [[gerrit:1203797|hCaptcha: Disable addurl trigger for hCaptcha edits (T409822)]] (duration: 12m 38s)

Change #1203037 merged by jenkins-bot:

[mediawiki/extensions/ConfirmEdit@master] Support an "always challenge" SiteKey when shouldForceShowCaptcha is enabled

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

Change #1204576 had a related patch set uploaded (by Kosta Harlan; author: Kosta Harlan):

[mediawiki/extensions/ConfirmEdit@wmf/1.46.0-wmf.2] Support an "always challenge" SiteKey when shouldForceShowCaptcha is enabled

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

Change #1204581 had a related patch set uploaded (by Kosta Harlan; author: Kosta Harlan):

[operations/mediawiki-config@master] hCaptcha: Define configuration for "always challenge" mode

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

Change #1204581 merged by jenkins-bot:

[operations/mediawiki-config@master] hCaptcha: Define configuration for "always challenge" mode

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

Change #1204576 merged by jenkins-bot:

[mediawiki/extensions/ConfirmEdit@wmf/1.46.0-wmf.2] Support an "always challenge" SiteKey when shouldForceShowCaptcha is enabled

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

Mentioned in SAL (#wikimedia-operations) [2025-11-12T14:01:28Z] <kharlan@deploy2002> Started scap sync-world: Backport for [[gerrit:1204367|hCaptcha instrumentation: Log editor_interface for editAttempStep (T409701)]], [[gerrit:1204576|Support an "always challenge" SiteKey when shouldForceShowCaptcha is enabled (T405595)]], [[gerrit:1204581|hCaptcha: Define configuration for "always challenge" mode (T405595)]]

Mentioned in SAL (#wikimedia-operations) [2025-11-12T14:27:19Z] <kharlan@deploy2002> kharlan: Backport for [[gerrit:1204367|hCaptcha instrumentation: Log editor_interface for editAttempStep (T409701)]], [[gerrit:1204576|Support an "always challenge" SiteKey when shouldForceShowCaptcha is enabled (T405595)]], [[gerrit:1204581|hCaptcha: Define configuration for "always challenge" mode (T405595)]] synced to the testservers (see https://wikitech.wikimedia.org/wiki/Mwdebug). Changes can

Change #1204588 had a related patch set uploaded (by Dreamy Jazz; author: Dreamy Jazz):

[mediawiki/extensions/ConfirmEdit@master] MakeGlobalVariablesScriptHookHandler: Fix hCaptcha site key handling

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

Mentioned in SAL (#wikimedia-operations) [2025-11-12T14:48:36Z] <kharlan@deploy2002> Finished scap sync-world: Backport for [[gerrit:1204367|hCaptcha instrumentation: Log editor_interface for editAttempStep (T409701)]], [[gerrit:1204576|Support an "always challenge" SiteKey when shouldForceShowCaptcha is enabled (T405595)]], [[gerrit:1204581|hCaptcha: Define configuration for "always challenge" mode (T405595)]] (duration: 47m 08s)

Change #1204618 had a related patch set uploaded (by Dreamy Jazz; author: Dreamy Jazz):

[mediawiki/extensions/ConfirmEdit@master] Create tests for SimpleCaptcha::confirmEditMerged

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

Change #1204588 merged by jenkins-bot:

[mediawiki/extensions/ConfirmEdit@master] MakeGlobalVariablesScriptHookHandler: Fix hCaptcha site key handling

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

Change #1204638 had a related patch set uploaded (by Dreamy Jazz; author: Dreamy Jazz):

[mediawiki/extensions/ConfirmEdit@master] Show more helpful error message on edit page when hCaptcha forced

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

Change #1196204 abandoned by Dreamy Jazz:

[mediawiki/extensions/ConfirmEdit@master] Use FancyCaptcha for AbuseFilter consequence

Reason:

Given that the AbuseFilter hCaptcha consequence patch has been merged, I think we can abandon this now

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

Change #1204618 merged by jenkins-bot:

[mediawiki/extensions/ConfirmEdit@master] Create tests for SimpleCaptcha::confirmEditMerged

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

Change #1204638 merged by jenkins-bot:

[mediawiki/extensions/ConfirmEdit@master] Show more helpful error message on edit page when hCaptcha forced

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

Change #1204927 had a related patch set uploaded (by Dreamy Jazz; author: Dreamy Jazz):

[mediawiki/extensions/ConfirmEdit@wmf/1.46.0-wmf.2] MakeGlobalVariablesScriptHookHandler: Fix hCaptcha site key handling

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

Change #1204927 merged by jenkins-bot:

[mediawiki/extensions/ConfirmEdit@wmf/1.46.0-wmf.2] MakeGlobalVariablesScriptHookHandler: Fix hCaptcha site key handling

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

Mentioned in SAL (#wikimedia-operations) [2025-11-13T17:16:48Z] <dreamyjazz@deploy2002> Started scap sync-world: Backport for [[gerrit:1204927|MakeGlobalVariablesScriptHookHandler: Fix hCaptcha site key handling (T405595)]], [[gerrit:1204855|VisualEditor hCaptcha: Add config to disable onload handling (T409962)]]

Mentioned in SAL (#wikimedia-operations) [2025-11-13T17:18:50Z] <dreamyjazz@deploy2002> dreamyjazz, kharlan: Backport for [[gerrit:1204927|MakeGlobalVariablesScriptHookHandler: Fix hCaptcha site key handling (T405595)]], [[gerrit:1204855|VisualEditor hCaptcha: Add config to disable onload handling (T409962)]] synced to the testservers (see https://wikitech.wikimedia.org/wiki/Mwdebug). Changes can now be verified there.

Mentioned in SAL (#wikimedia-operations) [2025-11-13T17:25:36Z] <dreamyjazz@deploy2002> Finished scap sync-world: Backport for [[gerrit:1204927|MakeGlobalVariablesScriptHookHandler: Fix hCaptcha site key handling (T405595)]], [[gerrit:1204855|VisualEditor hCaptcha: Add config to disable onload handling (T409962)]] (duration: 08m 48s)

dom_walden subscribed.

I can confirm this happens on testwiki and test2wiki. On submitting an edit which triggers a filter, I see the edit page and submitting again shows the hCaptcha challenge.