.NET HTML whitelisting (anti-xss/Cross Site Scripting)

前端 未结 6 688
日久生厌
日久生厌 2020-12-18 04:51

I\'ve got the common situation where I\'ve got user input that uses a subset of HTML (input with tinyMCE). I need to have some server-side protection against XSS attacks an

6条回答
  •  攒了一身酷
    2020-12-18 05:14

    http://www.microsoft.com/en-us/download/details.aspx?id=28589 You can download a version here, but I linked it for the useful DOCX file. My preferred method is to use the NuGet package manager to get the latest AntiXSS package.

    You can use the HtmlSanitizationLibrary assembly found in the 4.x AntiXss library. Note that GetSafeHtml() is in the HtmlSanitizationLibrary, under Microsoft.Security.Application.Sanitizer.

提交回复
热议问题