AntiXSS in ASP.Net Core

后端 未结 6 1806
爱一瞬间的悲伤
爱一瞬间的悲伤 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:34

    You can use System.Text.Encodings.Web for programmatic encoding in .NET Standard. It offers HTML, JavaScript and URL encoders. It should be equivalent to AntiXss because it is documented to use white list:

    By default encoders use a safe list limited to the Basic Latin Unicode range and encode all characters outside of that range as their character code equivalents.

提交回复
热议问题