css - Servlet reflected cross site scripting vulnerability -


i've analyzed code findbugs , reported warning

servlet reflected cross site scripting vulnerability.

code , 3rd line throws warning:

string tickname = request.getparameter("ticko"); printwriter w = response.getwriter(); w.println("unable perform tickonem '" + tickname +"' because no tick name active!"); //this line throws warning. 

what real reason , how fix it?

reason appending user provided data response without escaping. vulnerable injecting javascript executed in user browser. avoid such vulnerabilities should html escape every user supplied data before sending back. can use existing libraries perform escaping example stringescapeutils


Comments

Popular posts from this blog

c# - Unity IoC Lifetime per HttpRequest for UserStore -

Change the color of an oval at click in Java AWT -

I am trying to solve the error message 'incompatible ranks 0 and 1 in assignment' in a fortran 95 program. -