Malware and profanity detection in user inputs

Hey everyone - I am looking to add a feature to detect malware and/or profanity in user inputs.

The app in question is a talent marketplace that is being used by large enterprises and my client is worried that someone in the community may spam or abuse their ability to post information.

Any ideas will be appreciated.

Maybe start a list of texts of “banned” words, then when the text input contains any of the words put a warning text and don’t allow them to press the submit button? Maybe there’s a public list of popular texts that are banned.

For the spam you could have it so when they click the submit button it has two events, one with the condition if the users posts within the past 1 minute:count > 10, then it wouldn’t do anything and show some warning text saying they are posting too much, or the other action is ≤ 10 and it proceeds to post it?

1 Like

Hi @jagdish_bajaj,

This can be completed using a banned words API that will return a true or false, or you can do it in-house via the following method.

Firstly, you will need a data type setup to store your banned words. For this example, I’ve set it up like this:

Within the words list, I have the following words:

We need to set up some conditionals to check for these banned words.

Firstly, detecting banned word/s:

Simply splitting the value with a space will check for banned words, but users can bypass this filter by adding !/":*&*) or any other special characters. Because of this, I have added a find and replace using the following regex pattern [!@#$%^&*(),.?":{}|<>]. This will help to counteract any tricking of the filter.

We then intersect our current input against the search for the banned words’ first item (as we store all terms in a single list) and check that the count is not 0. If the count is > 0, then the conditional will return true.

For the no banned words found, we
check that the count is 0.

Here’s a GIF of it in action:
Untitled design (2)

This comment by @sam.morgan was extremely helpful for creating these workflows.

1 Like