PKumar022351 (Community Member) asked a question.

CWE 80 Improper Neutralization of Script-Related HTML Tags in a Web Page (Basic XSS)

Below is My Existing Code:

 

String strOut = "<td width=\"10%\" id=\"searchResultsHeaderTDProd\" bgcolor=\"" + bgColor + "\"><font id=\"searchResultsInfoAdd\"><b>" + ESAPI.encoder().encodeForHTML(policyNumber)+"</b></font>";

 

strOut+="<br><font id=\"searchResultsInfoAdd\"><b>"+ESAPI.encoder().encodeForHTML(policyStatus)+"</b></font></td>";

out.println(strOut); -- Here this line getting  Improper Neutralization of Script-Related HTML Tags

 

I am using below code to Resolve :

out.println(ESAPI.encoder().canonicalize(strOut));

 

But after scan still report is showing CWE 80 flaws and its not gone. Please assist me to resolve this issue.

 


Topics (3)

No articles found
Loading

Ask the Community

Get answers, share a use case, discuss your favorite features, or get input from the community.