Turn your tactics upside down.
Don't try to filter out unacceptable characters - the policy is "Assume OK if I don’t know what is bad"
Instead, filter in valid characters - the policy "This stuff is fine, I assume that everything else is bad."
For security reasons, accept the Default Deny policy instead of the Default Accept policy.
For example...
... if you are asking someone for a search query, say the person’s name, restrict the input to only those characters that you expect to find in the names.
One way is to restrict AZ, and then make sure that your search technique is accented (for example, I = ì = í = î = ï, etc.), although this falls on non-European names.
... if you ask for a number, limit only numbers and reject everything else.
Bevan
source share