# SECURITY ISSUE - Forms seems to be subject to input validation issue

**URL:** <https://community.hubspot.com/t/security-issue-forms-seems-to-be-subject-to-input-validation-issue/95742>\
**Category:** Email Marketing Tool\
**Tags:** starter\
**Created:** [December 10, 2023, 4:35pm UTC](https://community.hubspot.com/t/security-issue-forms-seems-to-be-subject-to-input-validation-issue/95742 "2023-12-10T16:35:02Z")\
**Posts on this page:** 12\
**Page:** 1

<div class="post-metadata">

**Author:** ![SilvyaT](https://avatars.discourse-cdn.com/v4/letter/s/5daacb/32.png) [@SilvyaT](https://community.hubspot.com/u/SilvyaT)\
**Post date:** [December 10, 2023, 4:35pm UTC](https://community.hubspot.com/t/security-issue-forms-seems-to-be-subject-to-input-validation-issue/95742/1 "2023-12-10T16:35:02Z")

</div>

Hi,

we have been using the HubSpot integration (forms) for demo request,

we love HubSpot but recently some treat actors started using the platform to inject malicious code and sent malicious email to other users using the form

we trying to prevent this behaviour with notification (if you have not raised a request ignore this email)

Nonetheless, the forms have input validation issues; a malicious actor can inject HTML tags in names and other fields where there should never be space for those as they get interpreted.

for now we have a workaround via zapier to send all the emails but of course this is expensive and suboptimal

---

<div class="post-metadata">

**Author:** ![SilvyaT](https://avatars.discourse-cdn.com/v4/letter/s/5daacb/32.png) [@SilvyaT](https://community.hubspot.com/u/SilvyaT)\
**Post date:** [December 10, 2023, 4:37pm UTC](https://community.hubspot.com/t/security-issue-forms-seems-to-be-subject-to-input-validation-issue/95742/2 "2023-12-10T16:37:44Z")

</div>

Find below some example of the fields with injection potential (example \<h1\> to modify the font)

 ![Screenshot 2023-12-10 at 4.22.12 pm.png](https://d2qpr2jzcazej7.cloudfront.net/original/3X/7/c/7cd63f4a82f89b1c2efabf114945205d8b0d81d6.png)  
The form  
 ![Screenshot 2023-12-10 at 4.16.36 pm.png](https://d2qpr2jzcazej7.cloudfront.net/original/3X/b/3/b3307c1fe1e7be35991ca81139082465f5774b38.png)  
the email output  
 ![Screenshot 2023-12-10 at 4.16.59 pm.png](https://d2qpr2jzcazej7.cloudfront.net/original/3X/6/b/6b167645e657a6c7182c94d1eb7318086d5232b0.png)  
domain validation passed (from a user)  
 ![Screenshot 2023-12-10 at 4.16.50 pm.png](https://d2qpr2jzcazej7.cloudfront.net/original/1X/c84dd7e5a28fd37db805aa9f953372e4dce39e5b.png)  
injection in fields  
 ![Screenshot 2023-12-10 at 4.17.48 pm.png](https://d2qpr2jzcazej7.cloudfront.net/original/3X/3/d/3d681bec87f17dccc357d7a737d10aeaa4ba2d4c.png)

 ![Screenshot 2023-12-10 at 4.10.43 pm.png](https://d2qpr2jzcazej7.cloudfront.net/original/3X/a/5/a544339f473968f950cffa1bb0d32dcb667a06e0.png)  
filter in zapier  
 ![Screenshot 2023-12-10 at 4.13.03 pm.png](https://d2qpr2jzcazej7.cloudfront.net/original/3X/c/6/c6cce26b640059eb8e9fdc3d41e54289f4565afb.png)  
no way to filter in hubspot

---

<div class="post-metadata">

**Author:** ![jnix284](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/jnix284/32/29_2.png) [@jnix284](https://community.hubspot.com/u/jnix284)\
**Post date:** [December 11, 2023, 7:09pm UTC](https://community.hubspot.com/t/security-issue-forms-seems-to-be-subject-to-input-validation-issue/95742/3 "2023-12-11T19:09:44Z")

</div>

@SilvyaT it has to be done when you create the property, so you’d need to create custom properties and map them to the defaults with a workflow, but you can set [form field validation rules](https://knowledge.hubspot.com/crm-setup/set-validation-rules-for-properties) to “don’t allow special characters” which will limit the ability to add code.

t[his knowledge base article has more info about form spam management](https://knowledge.hubspot.com/forms/prevent-spam-form-submissions)

---

<div class="post-metadata">

**Author:** ![SilvyaT](https://avatars.discourse-cdn.com/v4/letter/s/5daacb/32.png) [@SilvyaT](https://community.hubspot.com/u/SilvyaT)\
**Post date:** [December 11, 2023, 7:21pm UTC](https://community.hubspot.com/t/security-issue-forms-seems-to-be-subject-to-input-validation-issue/95742/4 "2023-12-11T19:21:02Z")

</div>

Hi Jennifer

thanks for the update we’ll look into it, but wouldn’t those character of HTML script be disabled by default? those are dangerous script that have no place in a Name field?

---

<div class="post-metadata">

**Author:** ![SilvyaT](https://avatars.discourse-cdn.com/v4/letter/s/5daacb/32.png) [@SilvyaT](https://community.hubspot.com/u/SilvyaT)\
**Post date:** [December 11, 2023, 7:23pm UTC](https://community.hubspot.com/t/security-issue-forms-seems-to-be-subject-to-input-validation-issue/95742/5 "2023-12-11T19:23:09Z")

</div>

hi, those rules seesm to be blocked

 ![Screenshot 2023-12-11 at 7.22.27 pm.png](https://d2qpr2jzcazej7.cloudfront.net/original/3X/a/3/a3711161469923919894e5ab0ccf0981057f64b5.png)

---

<div class="post-metadata">

**Author:** ![jnix284](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/jnix284/32/29_2.png) [@jnix284](https://community.hubspot.com/u/jnix284)\
**Post date:** [December 11, 2023, 7:29pm UTC](https://community.hubspot.com/t/security-issue-forms-seems-to-be-subject-to-input-validation-issue/95742/6 "2023-12-11T19:29:22Z")

</div>

@SilvyaT as I mentioned, you can’t add rules to existing fields. New custom fields would have to be created. Validation rules are new, so I’m not sure if that’s why it is limited to new fields only.

---

<div class="post-metadata">

**Author:** ![SilvyaT](https://avatars.discourse-cdn.com/v4/letter/s/5daacb/32.png) [@SilvyaT](https://community.hubspot.com/u/SilvyaT)\
**Post date:** [January 3, 2024, 12:12pm UTC](https://community.hubspot.com/t/security-issue-forms-seems-to-be-subject-to-input-validation-issue/95742/7 "2024-01-03T12:12:46Z")

</div>

Happy new year

Thanks. Do you any plan when those will be rolled out for all the fields

we have a lot of forms and this would really help from security perspective

---

<div class="post-metadata">

**Author:** ![jnix284](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/jnix284/32/29_2.png) [@jnix284](https://community.hubspot.com/u/jnix284)\
**Post date:** [December 11, 2023, 7:34pm UTC](https://community.hubspot.com/t/security-issue-forms-seems-to-be-subject-to-input-validation-issue/95742/8 "2023-12-11T19:34:02Z")

</div>

@SilvyaT not by default that I know of, but another option would be to add a honeypot - a hidden form field that human users can’t see, but bots do.  
If the form submission includes a value in the hidden form field, you’ll know it’s spam (you can use a workflow to automate this).

Are you actively receiving form submissions with scripts or are you just testing?

I’ve had other users ask about this in the past, but have only seen fake tests go through, I’ve never seen a malicious script make it through - whether someone has tried is unknown, but that’s across hundreds of accounts.

---

<div class="post-metadata">

**Author:** ![PamCotton](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/pamcotton/32/47916_2.png) [@PamCotton](https://community.hubspot.com/u/PamCotton)\
**Post date:** [December 11, 2023, 6:49pm UTC](https://community.hubspot.com/t/security-issue-forms-seems-to-be-subject-to-input-validation-issue/95742/9 "2023-12-11T18:49:07Z")

</div>

Hello @SilvyaT, Happy Monday!

Thank you for posting in our Community!

Are you currently using the [_Block free email providers_ feature](https://knowledge.hubspot.com/forms/block-form-or-pop-up-form-submissions-from-specific-email-domains?_ga=2.165990782.1956400714.1616004301-137713041.1616004301) in a HubSpot form? There is also a feature that allows you to block form or pop-up form submissions from specific email domains. ( [More information here](https://knowledge.hubspot.com/forms/block-form-or-pop-up-form-submissions-from-specific-email-domains)).

You can prevent visitors with email addresses containing specific domains from submitting your HubSpot [form](https://knowledge.hubspot.com/forms/create-forms) or [pop-up form](https://knowledge.hubspot.com/forms/create-pop-up-forms). To further protect your forms from spam submissions, learn how to [enable CAPTCHA on your forms](https://knowledge.hubspot.com/forms/prevent-spam-form-submissions).

To our top experts, @Jnix284, @JustinPerkinsC [@Jigar\_Thakker](https://community.hubspot.com/t5/user/viewprofilepage/user-id/610147) any recommendations or workarounds to @SilvyaT?

Thank you,

Pam

---

<div class="post-metadata">

**Author:** ![SilvyaT](https://avatars.discourse-cdn.com/v4/letter/s/5daacb/32.png) [@SilvyaT](https://community.hubspot.com/u/SilvyaT)\
**Post date:** [December 11, 2023, 6:51pm UTC](https://community.hubspot.com/t/security-issue-forms-seems-to-be-subject-to-input-validation-issue/95742/10 "2023-12-11T18:51:49Z")

</div>

Hi This will not work for sql injection or other attacks.

attackers can use the First and Last name to send email in a domain owner behalf to other users with injections or other things in the Name and last name like (click here) . is it possible to raise this with security?

---

<div class="post-metadata">

**Author:** ![SilvyaT](https://avatars.discourse-cdn.com/v4/letter/s/5daacb/32.png) [@SilvyaT](https://community.hubspot.com/u/SilvyaT)\
**Post date:** [December 11, 2023, 8:33pm UTC](https://community.hubspot.com/t/security-issue-forms-seems-to-be-subject-to-input-validation-issue/95742/11 "2023-12-11T20:33:36Z")

</div>

add validation rules and replace the field with new field? can validation rule be added to default fields?

---

<div class="post-metadata">

**Author:** ![jnix284](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/jnix284/32/29_2.png) [@jnix284](https://community.hubspot.com/u/jnix284)\
**Post date:** [December 11, 2023, 8:47pm UTC](https://community.hubspot.com/t/security-issue-forms-seems-to-be-subject-to-input-validation-issue/95742/12 "2023-12-11T20:47:35Z")

</div>

Hi @SilvyaT as far as I’m aware, validation rules can’t be added to existing fields.

To add validation rules, you’d have to do the following:

1 - create a custom property (ex: “validated form first name”)

2 - create a workflow that triggers on form submission

2.a - the first step would be to copy the value from “validated form first name”

2.b - and set it for the default “first name” value

By creating the workflow, you can use the validated form fields in the background and have the default properties updated automatically. This same workflow could also filter out any spam submissions if you add a honeypot field (for bots that are submitting forms that don’t include a script or special character).
