How to prevent registration spam

I used to have this spam signup problem on my personal forum too but it has slowed down quite a bit. Now I only get one or two or max (like today) 5 a day. Diligently deleting spam accounts and adding to block lists seems to do the trick. I have “Staff must approve all new user accounts before they are allowed to access the site.” enabled which puts the new users in the handy new review queue so it takes just a moment to jam through them. Adding a custom question helps too in order to identify the obvious spammers.

On my work forum I use wp-discourse wordpress plugin and SSO, and have a very long signup form. We very rarely get spam signups that way.

2 Likes

Is the new sign-up / login plugin a solution to prevent spamming ?

1 Like

Can I know how to extra data like that?

Out of curiosity, how these can pass Captcha? how the signup process can be completed without solving the Captcha?

You should also just remember that in such a case your own mail server can end up on a blacklist if too much form spam is distributed.

If the bot uses real addresses for registration, this can happen very quickly.
I have solved this by using an external nginx as a proxy for my discourse docker instance and monitoring the log file with fail2ban, i. e.:

/etc/fail2ban/filter.d/nginx-discourse.conf

[Definition]
failregex = ^<HOST>.*"GET /u/account-created HTTP/2.0" 200.*$

/etc/fail2ban/jail.d/defaults-debian.conf

[nginx-discourse]
enabled = true
port = http,https
filter = nginx-discourse
logpath = /var/log/nginx/your.discourse.access.log
bantime = 43200
findtime = 3600
maxretry = 3
banaction = ufw

This example means if anybody tries 3 times a registration within an hour from the same IP, then this IP is blocked for 12 hours.
Adjust this values for your purpose and system environment!

2 Likes

I get constant spam registrations from verified bots using gmail (gmail!) accounts, all of them from India. A few other domains too, but the gmail accounts are surprising.

What has become of Google.

3 Likes

Same here.
If they don’t post, they are inoffensive. New accounts of inactive users aren’t visible to visitors or regular users, and users’ profiles aren’t indexed; So these spam accounts are basically invisible to everyone but admins/mods, and will be removed automatically after a while thanks to the periodic cleanup sidekick job.

2 Likes

Even though they can’t post, they do some random things such search queries,

or seemingly trying to hack the auth system:

Job exception: Net::SMTPAuthenticationError
(google_oauth2) Authentication failure! invalid_credentials: OAuth2::Error, invalid_grant: Bad Request { "error": "invalid_grant", "error_description": "Bad Request" }
(google_oauth2) Authentication failure! csrf_detected: OmniAuth::Strategies::OAuth2::CallbackError, csrf_detected | CSRF detected
1 Like