The examples in the link are some content related to script attacks. If you have time, click here.
1. Do not trust request. querystring:
I believe that in the ASP era, this problem is serious. If you don't believe it, you can find several ASP enterprise sites on the network and find the URL "view. asp? Id = xxx ", changed to" view. asp? Id = xxx or 1 = 1 ", I believe you will see something different. net, it should be very rare, but the last time someone saw that csdn had exploded, the simple solution was to perform data type verification or conversion when obtaining data. For example:
Int viewid = 0;
If (Int. tryparse (request. querystring ["ID"], out viewid )){
//...
}
2. Do not trust maxlength:
Sometimes we want the client to enter a value of no more than a certain length. In this case, the maxlength of input may be used. But can maxlength be 100% to ensure that the length of this value cannot exceed maxlength?Xmlns = "http://www.w3.org/1999/xhtml">
Under normal circumstances, you can only enter four characters in the input box above, but is it true that the data post to us by the user?
Javascript: Alert (window. c = function () {document. getelementsbytagname ("input") [0]. value = "Do you think I have four characters in length? "}())