Keycloak Edit profile is accepting special characters like HTML tags <>

Hi,

We are trying to edit the user profile from our application. We have put validation of special characters like html tag in our keycloak theme and it is working properly if somebody is trying to save the request from keycloak theme page.
But
we are facing one issue, if somebody intercept this request and add special characters from backend than keycloak server is accepting special characters in First Name and Last Name.
How we can block this at keycloak server level.