Allowing local URL in Microsoft.Security.Application.Sanitizer.GetSafeHtmlFragment

StackOverflow https://stackoverflow.com/questions/11122730

  •  15-06-2021
  •  | 
  •  

Question

Microsoft.Security.Application.Sanitizer.GetSafeHtmlFragment seems to strip all <a href="">link</a> into <a>link</a>

Is there anyway to preserve local URL, e.g. <a href="/Product/1"> when passing it into Sanitizer.GetSafeHtmlFragment?

Note: I'm using AntiXSS 4.2.1

Was it helpful?

Solution

The AntiXSS library has been broken for a few months now. There's no way around this problem, unfortunately. Either you rollback to a previous version, or search for something else to use.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top