A security scan of an ASP.NET web site we are developing reported the following on an input field used for a search:
"The ctl00%24txtTopQckSearch parameter appears to be vulnerable to server-side JavaScript code injection attacks. The submitted value appears to be placed into a dynamically evaluated JavaScript statement, within a single-quoted context.
The payload '+(function(){if(typeof cb715==="undefined"){var a=new Date();do{var b=new Date();}while(b-a<20000);cb715=1;}}())+' was submitted in the ctl00%24txtTopQckSearch parameter. The application took 7641 milliseconds to respond to the request, compared with 5625 milliseconds for the original request, indicating that the injected JavaScript code caused a time delay.
Please note that to manually reproduce this behavior using the reported request, you will need to change the name of the canary variable, which is currently cb715."
My questions are:
What is "Server-Side JavaScript code injection" (as opposed to Client-Side Injection -XSS)?
How can I manually recreate the server side attack described above?
How can it be prevented?
Thanks!