Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I prevent automatic form submission by bots?

I am running ColdFusion MX, so I don't have the possibility of using the built-in cfimage Captcha functionality in my application, before form submitting.

But the problem is without captcha the bots submit the forms.

What will be best way to prevent automatic submitting?

like image 472
user160820 Avatar asked Jul 12 '10 18:07

user160820


2 Answers

Captchas don't have to be images!

Try one of the following solutions:

  • Most bots don't understand CSS. Create two submit buttons, the first with a value that will be rejected by the server, the second with a value that will be accepted by the server. Hide the first one using CSS.
  • Ask the user to answer a simple math problem. This will require you to create the math problem and store the expected solution somewhere (like the user's session), then compare the user's submitted answer with the stored answer. For extra protection, you can create simple addition, subtraction and multiplication questions. Avoid division, remainders are a pain for some users.
  • Bots read the names of form elements, and tend to ignore text labels. Try creating a checkbox named "optout" (like a newsletter), checked by default. Next to the checkbox, ask the user to uncheck the checkbox if they are a human. The opposite technique also works (unchecked checkbox that you ask the user to check).

All of these solutions can be done without third party code or API calls.

That being said, reCAPTCHA is pretty good and easy to integrate into almost any environment.

like image 85
Charles Avatar answered Oct 14 '22 08:10

Charles


Take a look at cfformprotect - it will work with CFMX 6 and all later engines.

It aims to be fully accessible - and invisible to most users - with an assortment of methods to stop bots and spammers.

Also you might want to look at a CF wrapper for reCaptcha, which is compatible with CFMX 7.

like image 26
Peter Boughton Avatar answered Oct 14 '22 09:10

Peter Boughton