-
-
Notifications
You must be signed in to change notification settings - Fork 7.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add mechanisms to reduce registration spam #15276
Add mechanisms to reduce registration spam #15276
Conversation
ffa5e55
to
4a7b05c
Compare
For now, those counter-measures seem to have worked very well. Time will tell whether those where generic spam bots or Mastodon-specific ones that could easily adapt to the new countermeasures, though. |
|
||
// Empty the honeypot fields in JS in case something like an extension | ||
// automatically filled them. | ||
delegate(document, '#registration_new_user,#new_user', 'submit', () => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this not going to help bots that execute JS, i.e. headless Chrome?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It probably is… I don't know how prevalent those are.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I suspect those that execute JS would ignore fields with display: none
anyway
Add two honeypot fields: a fake website input and a fake password confirmation one. The label/placeholder/aria-label tells not to fill them, and they are hidden in CSS, so legitimate users should not fall into these. This should cut down on some non-Mastodon-specific spambots.
cf8dbe3
to
9de3e77
Compare
9de3e77
to
2a0eacf
Compare
6df31c7
to
3f689ca
Compare
@@ -10,6 +10,9 @@ | |||
= f.input :password, placeholder: t('simple_form.labels.defaults.password'), required: true, input_html: { 'aria-label' => t('simple_form.labels.defaults.password'), :autocomplete => 'off', :minlength => User.password_length.first, :maxlength => User.password_length.last }, hint: false, disabled: closed_registrations? | |||
= f.input :password_confirmation, placeholder: t('simple_form.labels.defaults.confirm_password'), required: true, input_html: { 'aria-label' => t('simple_form.labels.defaults.confirm_password'), :autocomplete => 'off' }, hint: false, disabled: closed_registrations? | |||
|
|||
= f.input :confirm_password, as: :string, placeholder: t('simple_form.labels.defaults.honeypot', label: t('simple_form.labels.defaults.password')), required: false, input_html: { 'aria-label' => t('simple_form.labels.defaults.honeypot', label: t('simple_form.labels.defaults.password')), :autocomplete => 'off' }, hint: false, disabled: closed_registrations? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there any point localizing the "Password" intended to catch bots?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not really I guess, but there's not really any harm either, it's not a new string
This PR introduces several techniques to limit registration spam:
To avoid legitimate users filling them in, they have distinctive labels/placeholders, have a
display: hidden
style, and are cleared via javascript on form submission.Those techniques have not been widely tested on Mastodon instances yet, so neither their efficiency or their downsides have been fully tested yet, but I expect it to significantly cut down on generic spam bots (which seem to be very prevalent on instances with approval-based registrations, because of the textarea).
Note that rejecting registration attempts is important for two reasons: