fix(editor): Validate user info before submiting (#7608)

Validate first and last names before saving them to database. This
should prevent security issue with un-sanitized data that ends up in
emails.

---------

Co-authored-by: कारतोफ्फेलस्क्रिप्ट™ <aditya@netroy.in>
This commit is contained in:
Milorad FIlipović
2023-11-22 12:14:44 +01:00
committed by GitHub
parent 9b4856e7de
commit 2064f7f251
4 changed files with 97 additions and 1 deletions

View File

@@ -11,7 +11,7 @@ export function NoXss() {
options: { message: `Malicious ${propertyName}` },
validator: {
validate(value: string) {
return !/<(\s*)?(script|a|http)/.test(value);
return !/(^http|^www)|<(\s*)?(script|a)|(\.[\p{L}\d-]+)/u.test(value);
},
},
});