c# - Improper Neutralization of Script-Related HTML Tags in a Web Page (Basic XSS) (CWE ID 80) for response.BinaryWrite -
i tried applying encode filename still getting veracode error @ response.binarywrite(data);
below code:
webclient req = new webclient(); httpresponse response = httpcontext.current.response; response.clear(); response.clearcontent(); response.clearheaders(); response.buffer = true; response.addheader("content-disposition", "attachment;filename=\"" + xsssec.encoder.htmlencode(filename) + "\""); byte[] data = req.downloaddata(filepath); response.binarywrite(data); response.flush(); response.suppresscontent = true;
any suggestions fix issue?
Comments
Post a Comment