I have a screen sharing application in which all sensitive data is masked. There are some scenarios in which the customer types sensitive data, such as the SSN, into a non-masked field, thereby directly compromising our solution.
Is there a way I can detect that person is typing SSN or any sensitive data, without accessing the DB -- or any other server-side information -- just on the client side.
For instance, consider a form with SSN and address fields. How can I avoid displaying an SSN mis-entered in the Address field?
SSN
Address:888-9999-0988
EDIT
My approach as of now is storing all patterns in a property file on the client side. For example, a typical password in my application is 8 characters with following rules:
^(?=.*[A-Za-z])(?=.*\d)(?=.*[$@$!%*#?&])[A-Za-z\d$@$!%*#?&]{8,}$
I will have this regex stored on client side. Once the user starts typing, I will check whether he is typing a password or a username. Similarly, I can break a phone number into country - area code format and can have a regex for that also. But since SSN is pure 9 digit random number, I am stuck.
By extracting field names from DOM, I can get exact location of cursor and Field name in which User is typing data.And by using the type of data format they support I can have rough idea whether user is typing the required data or something else. Please correct me if I am wrong
September: 14th-2016 Since I have screen sharing solution running in a browser,it will be used as plug-able component by the websites.So it won't be easier to ask them to restructure their pages. Below is the approach I have finalized based on your inputs. I will have one file file with all patterns stored in it. 1.For Credit related info all have definite patterns.So it won't be any problem 2.Passwords also have some rules or patterns.So these can also be checked
To avoid data exposure I will show generic message till user types data,like the watsapp shows "User is typing".Once User tabs or comes to next field then only data will be shown after inline Pattern Validation.
Only thing left here is how to detect those fields like SSN, Phone number etc which does not have any pattern.Hope we can have some solution for this also.
Regards Harry