validator is vulnerable to regular expression denial of service (ReDoS). An attacker is able to slow down the application or causes an application crash via a malicious string and regex /(\s)+$/g
via the rtrim function due to lack of safer regular expression to escape the string input from attacker.