首页 > 解决方案 > 如何保护 MVC 返回文件方法免受 XSS 攻击

问题描述

Fortify 下面的代码块存在 XSS 漏洞,我该如何解决?

    [HttpPost]
    public ActionResult MyMethod(string contentType, string base64, string fileName)
    {
        var fileContents = Convert.FromBase64String(base64);
        return File(fileContents, contentType, fileName);
    }

标签: c#asp.net-mvcsecurityxssfortify

解决方案


推荐阅读