Page MenuHomePhabricator

Implement secure enclave mode for hCaptcha
Closed, ResolvedPublic

Description

Summary

Secure enclave mode exists and can be used by hCaptcha Enterprise users. We want to use this on WMF wikis.

Background

  • hCaptcha integration in ConfirmEdit (CAPTCHA extension) currently requires loading the JS API in the head element
  • We can use the secure enclave method only possible for hCaptcha Enterprise users which can allow us to defer this and provide better privacy
  • We cannot detail much more about this because it's documentation is private

Acceptance criteria

Event Timeline

Change #1128882 had a related patch set uploaded (by Reedy; author: Reedy):

[mediawiki/extensions/ConfirmEdit@master] WIP: hCaptcha: Implement secure enclave mode

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

acooper changed the task status from Open to In Progress.Mar 21 2025, 2:35 PM
acooper triaged this task as High priority.

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

[mediawiki/extensions/ConfirmEdit@master] Create HCaptchaOutput service

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

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

[mediawiki/extensions/ConfirmEdit@master] HCaptchaOutput: HTML escape the hCaptcha API URL

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

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

[mediawiki/extensions/ConfirmEdit@master] Start on tests for HCaptcha.php

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

Change #1163863 merged by jenkins-bot:

[mediawiki/extensions/ConfirmEdit@master] Start on tests for HCaptcha

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

Change #1163870 merged by jenkins-bot:

[mediawiki/extensions/ConfirmEdit@master] Create HCaptchaOutput service

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

Change #1164138 merged by jenkins-bot:

[mediawiki/extensions/ConfirmEdit@master] HCaptchaOutput: HTML escape the hCaptcha API URL

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

Change #1128882 merged by jenkins-bot:

[mediawiki/extensions/ConfirmEdit@master] hCaptcha: Implement secure enclave mode

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

Dreamy_Jazz subscribed.

As deployment to test2wiki is delayed, we should close this task and have a generic QA task once we are on test2wiki.

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

[mediawiki/extensions/ConfirmEdit@master] WIP: hCaptcha: Fix secure enclave implementation

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

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

[mediawiki/extensions/ConfirmEdit@wmf/1.45.0-wmf.17] hCaptcha: Fix secure enclave implementation

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

Change #1185096 merged by jenkins-bot:

[mediawiki/extensions/ConfirmEdit@wmf/1.45.0-wmf.17] hCaptcha: Fix secure enclave implementation

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

Mentioned in SAL (#wikimedia-operations) [2025-09-05T15:15:04Z] <kharlan@deploy1003> Started scap sync-world: Backport for [[gerrit:1184968|hCaptcha: Update secure enclave API endpoint]], [[gerrit:1185096|hCaptcha: Fix secure enclave implementation (T378188)]]

Mentioned in SAL (#wikimedia-operations) [2025-09-05T15:42:23Z] <kharlan@deploy1003> dreamyjazz, kharlan: Backport for [[gerrit:1184968|hCaptcha: Update secure enclave API endpoint]], [[gerrit:1185096|hCaptcha: Fix secure enclave implementation (T378188)]] synced to the testservers (see https://wikitech.wikimedia.org/wiki/Mwdebug). Changes can now be verified there.

Mentioned in SAL (#wikimedia-operations) [2025-09-05T16:16:07Z] <kharlan@deploy1003> Finished scap sync-world: Backport for [[gerrit:1184968|hCaptcha: Update secure enclave API endpoint]], [[gerrit:1185096|hCaptcha: Fix secure enclave implementation (T378188)]] (duration: 61m 02s)

Change #1185080 merged by jenkins-bot:

[mediawiki/extensions/ConfirmEdit@master] hCaptcha: Fix secure enclave implementation

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

Change #1185175 had a related patch set uploaded (by CDanis; author: CDanis):

[operations/puppet@production] hcaptcha: eschew newassets, use js instead

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

Change #1185175 merged by CDanis:

[operations/puppet@production] hcaptcha: eschew newassets, use js instead

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

kostajh subscribed.

The code we implemented in this task does not support loading secure-api.js in VisualEditor. Because T403829: hCaptcha: Self-host secure-api.js code in /static directory proposes some changes to how we're loading secure-api.js, I'd suggest we complete this task after we're finished with T403829: hCaptcha: Self-host secure-api.js code in /static directory.

kostajh removed Reedy as the assignee of this task.Sep 7 2025, 7:32 PM
kostajh updated Other Assignee, removed: Dreamy_Jazz.
kostajh updated the task description. (Show Details)

The code we implemented in this task does not support loading secure-api.js in VisualEditor. Because T403829: hCaptcha: Self-host secure-api.js code in /static directory proposes some changes to how we're loading secure-api.js, I'd suggest we complete this task after we're finished with T403829: hCaptcha: Self-host secure-api.js code in /static directory.

Follow-up for this is in T405585: hCaptcha: Fix secure enclave loading in VisualEditor