An online contact form is an excellent way to let your users communicate with you, and vitally important if you run a mailing list. Unfortunately, bots and spammers can easily clog up your mailing list if you don’t have effective validation and other methods in place to stop them.

This post was originally published in AbstractAPI.

Use Case: Blocking Bot Form Submission

Problem Statement

Problem Statement


Web forms are under constant attack from bots for submitting spurious and fake data. Therefore, it is imperative to design them such that only humans can access them and the critical data entered through the forms is properly validated.

Realization Approach

Realization Approach


A bunch of strategies be employed to prevent bot data submission at the frontend and additional safeguards to validate critical data like email and phone number at the backend.

Solution Space

Solution Space


A web form that can prevent bot submission with multiple layers of safeguards at the frontend and backend.

In this article, we’ll talk about the threat that spam bots post to online web forms, and how you can protect your forms from these types of attacks.

Key Takeaways

  • Online contact forms are crucial for effective email marketing and maintaining a robust mailing list is key to a good return on investment (ROI).
  • Spam bots pose a significant threat to web forms, leading to clogged mailing lists and reduced efficiency.
  • Effective validation methods and strategies are essential to protect forms from bot attacks.
  • Utilizing CAPTCHA, double opt-in, Web Application Firewalls (WAF), honeypots, real-time verification tools, and filtering proxies can significantly reduce bot submissions.
  • Regular updates and monitoring of defense strategies are vital in adapting to the evolving landscape of cybersecurity and sophisticated bot tactics.

Understanding the Threat of Bots on Web Forms

Before we can dive into the methods for preventing bot attacks and spam form submissions, we must understand what they are and why they are so detrimental to your marketing efforts.

What are Spam Bots and how do they work?

A spam bot is an intelligent program that is designed to spread spam across the internet. There are many types of spam bots, including social media comment bots, phishing bots, scraper bots, card stuffing or cracking bots, and form bots.

Form bots crawl your website searching for the HTML code that indicates a web form. Once they find the form, they use JavaScript to inject spam information into each form field (sometimes this is data stolen from real human users, sometimes it is simply nonsense) and submit the form.

The impact of bot submissions on your website

Form bots are sometimes used to access information that is only accessible via filling out the online form (i.e. a free downloadable PDF.)

Sometimes, a competitor might program bots to generate lots of form spam signups to slow down your lead generation and make it difficult to distinguish real users from fake ones. These fake emails take up valuable space on your mailing list and can harm your bounce rate and sender reputation.

Form bots are also used to create fake leads if you have paid a company to help with lead generation, and they use nefarious methods to make it look like their service is working. By spamming your registration forms with a lot of fake signups, they can claim to be generating leads for you, and charge more for their services.

Proven Methods to Prevent Bot Form Submissions

Now that we understand the dangers of bot spam on your website, let’s take a look at some spam prevention methods.

Implementing CAPTCHA for user verification

The best and most effective way of preventing spam in a signup form is to use a CAPTCHA for verification. CAPTCHA stands for “Completely Automated Public Turing Test to tell Computers and Humans Apart.”

A CAPTCHA usually entails no more than a checkbox to prove that a user is human. Sometimes, a CAPTCHA might require the user to solve a quick challenge. These challenges are designed to be impossible for bots to solve.

By requiring a user to complete a CAPTCHA before form data can be submitted, you drastically increase the percentage of real people to spam bots that get through your signup form.

Double opt-in

You should enable double opt-in for any web form on your website. Double opt-in sends an email to a user directly after signup that requires them to check a box or enter a verification code to prove that the email address belongs to a real human.

This is one of the easiest methods of spam prevention to set up and is highly effective in preventing bot signups and signups from fake emails and invalid email addresses.

The role of firewalls in blocking suspicious traffic

A Web Application Firewall (WAF) is a piece of software that analyzes web traffic and attempts to filter out legitimate users from bot attacks. This is done by examining both GET and POST requests and then applying a set of predetermined policies to filter out traffic that matches known attack signatures.

Unfortunately, in today’s increasingly complex cybersecurity landscape, bots are becoming more sophisticated, and many are now able to get around firewalls. WAFs are only designed to protect websites from known attacks—SQL injections, session hijacking, and cross-site scripting.

This means they are sometimes ineffective in blocking new attacks from today’s advanced, more sophisticated bots. WAFs are still an important piece of form spam prevention, but they work best in tandem with other methods.

Honeypots: A stealthy approach to catching bots

A honeypot or honeypot CAPTCHA is a hidden field on a web form that is invisible to humans but visible to bots. A honeypot CAPTCHA is relatively simple to make: create a form field using HTML, then use CSS to hide the field from users.

Before submitting the form, run a piece of JavaScript code to check whether the honeypot field is empty. If it is, it is likely the form was filled out by a human. If it is not, you can assume the form was filled out by a bot and refuse to submit the form.

This works because bots are usually not smart enough to know that a form is hidden from users. Typically, they ignore CSS code, and will simply inject information into every available field on the form.

Real-time verification tools to block spam at entry-level

Another very effective method of preventing bot activity is to use an email verification API or other service to validate the email addresses and other information provided to the form. By sending the contact information to an online API such as AbstractAPI, SendGrid, and ZeroBounce before you submit the form, you can filter out invalid email addresses and emails input by spambots.

A validation API checks things like MX and SMTP records, IP addresses, role-based emails, and emails generated by free email providers to filter out known spam signups and prevent bots from getting through your signup forms.

Filtering proxies and VPNs to reduce spam risks

Spam bots often use VPNs and proxies to hide their true IP addresses and avoid detection. To combat this, you can set up a filter to cross-reference incoming network requests and check their origins in a database of IP addresses of known proxies or VPNs.

There are several online resources to help you achieve this, including Smoothwall, KasperSky, and ClearOut.

Advanced techniques: IFrames and Two-Factor Authentication

An IFrame is an HTML element that allows a website to host external content. Spam bots sometimes use IFrames to grab form data and host it on their site, then generate spam submissions to the form.

By adding a check for IFrames during the form submission process, you can stop these types of submissions. This can either be done on the front end or server side.

Best Practices for Maintaining Form Integrity

Now that you know some of the methods for preventing spam signups, let’s talk about how to maintain your web forms and keep spam signups down.

Regularly updating your defense strategies

Bots are becoming smarter all the time, and the landscape of cyber security is ever-changing. It’s important to stay on top of current trends. Regularly check the methods you have implemented and make sure that they are still performing as expected. If new methods become available, implement them as soon as possible.

Monitoring form submissions for unusual activity

Set up real-time monitoring to double-check every submission to your web forms. If you used WordPress to build your website, plugins should be available to make this very easy. If you used some other tool, search for JavaScript libraries and APIs that can handle this.

If you used a service like Mailerlite, Mailchimp, ZeroBounce, or something else to set up your signup form, the service will likely handle this monitoring for you.

Conclusion

Spam bots are a pain, but they don’t need to bog down your mailing list. We recommend implementing a few or all of the methods outlined in this article to prevent bot activity on your signup forms and keep your mailing list free from spam accounts and invalid email addresses.

About the author 

Radiostud.io Staff

Showcasing and curating a knowledge base of tech use cases from across the web.

TechForCXO Weekly Newsletter
TechForCXO Weekly Newsletter

TechForCXO - Our Newsletter Delivering Technology Use Case Insights Every Two Weeks

>