AntiXSS in ASP.Net Core

后端 未结 6 1789
爱一瞬间的悲伤
爱一瞬间的悲伤 2020-12-10 12:17

Microsoft Web Protection Library (AntiXSS) has reached End of Life. The page states \"In .NET 4.0 a version of AntiXSS was included in the framework and could be enabled via

6条回答
  •  离开以前
    2020-12-10 12:57

    Sounds like you need a whitelist based sanitizer of some sort. OWASP AntiSamy.NET used to do that, but I don't think it's maintained anymore. If data is always delivered to JSON, you could also run in through DOMPurify on the client side, before adding it to the DOM. Having malicious HTML in the JSON itself isn't all that dangerous (at least not as long as you set the content-type and X-content-type-options: nosniff headers correctly). The code will not trigger until it's rendered into the DOM.

提交回复
热议问题