I am currently working on an old ASP project where security has now become a big issue. These are not only unsafe encryption methods (md5), but I am worried about problems with SQL injections. I am still not very good at injecting, and I have only tried the basics of what I know. I found a function that โprotectsโ any user input, but I wonder if it really does something to prevent injection attacks. Here is the function:
function sqlfix(input) if not isnull(input) and input <> "" then input = replace(input, ";", ";") input = replace(input, "'", "'") input = replace(input, """", """) input = replace(input, "(", "(") input = replace(input, ")", ")") input = replace(input, "|", "|") input = replace(input, "<", "<") input = replace(input, ">", ">") input = replace(input , "'", "''") 'input = Server.HTMLEncode(input) 'input = Server.UrlEncode(input) sqlfix = input else sqlfix = "" end if end function
I remember how this was done many years ago when I first started PHP with mysql_ * functions, but now I switched to PDO and parameter binding. However, I do not know how safe this is for ASP applications. Thanks for any input.
source share