LibProtection / libprotection-dotnet

.NET implementation of LibProtection library
MIT License
33 stars 5 forks source link

Incorrect formatting of interpolated strings #56

Closed Barkhat26 closed 3 years ago

Barkhat26 commented 3 years ago

Method SafeString.Format takes interpolated string after converstion of interpolated strings to string. For example, following code:

string input = "<script>alert(`XSS`)</script>";
Console.WriteLine(SafeString<Html>.Format($"<p>{input}</p>"));

prints out to terminal following text:

<p><script>alert(`XSS`)</script><p>

instead of:

<p>&lt;script&gt;alert(`XSS`)&lt;/script&gt;</p>