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

Popular posts from this blog

asynchronous - C# WinSCP .NET assembly: How to upload multiple files asynchronously -

aws api gateway - SerializationException in posting new Records via Dynamodb Proxy Service in API -

asp.net - Problems sending emails from forum -