Response to ASP Overflow Vulnerability We should do comprehensive character filtering
One is the member login
The following section of code filters out the illegal characters of username
<%
Username=trim (Request.Form ("username"))
Userpws=trim (Request.Form ("password"))
If Username= "" or userpws= "" or Instr (username, "=") >0 or Instr (username, "%") >0 or Instr (USERNAME,CHR)) >0 or I NSTR (username, "?") >0 or INSTR (username, "&") >0 or Instr (username, ";") >0 or INSTR (username, ",") >0 or Instr (username, "'") >0 or Instr (username, ",") >0 or Instr (USERNAME,CHR (34)) >0 or Instr (USERNAME,CHR (9)) >0 or Instr (username, "") >0 or Instr (username, "$") >0 Then
Response.Write ("Please enter username and password correctly")
Response.End
End If
%>
Another is an overflow vulnerability that enters illegal characters through the address bar
If a page is a newslist.asp page for newspage.asp
We pass NewSID parameters from newslist.asp to newspage.asp
When newspage.asp receive parameters, we usually use only
<%
Dim NewSID
Newsid=request (' NewSID ')
....................
%>
For security's sake, we need to add at least one sentence.
<%
Dim NewSID
Newsid=tirm (Request ' ID ')
If newsid= ' or Instr (NewSID, "') >0 or Instr (NewSID,"% ") >0 Then
Response.Write (' illegal parameter ')
Response.End
%>
I said basically on the above two points, if there is no place please advise.
Although there are some vulnerabilities in the Internet, but we enter a few lines of code to better enhance the security of the site!
Using illegal character overflow to attack website Simple response method