c# - Using HttpUtility.HtmlEncode and handling special characters/umlaut etc -
I use 2 question: How to Exposes a risk by using HttpUtility.HtmlEncode to sanitize user input to prevent XSS attacks. I am doing My problem is that it converts HtmlEncode special codes such as ü to their html equivalent code. I know what it does and does not encode. Then I need HtmlDecode to display it back to the user properly ü > HtmlEncode determines that it is not ü and other Unicode characters like standard Greek alphabet characters. Does HtmlEncode encode all non ascii characters? What is the best way to stop script tags but allow special characters such as umlauts without a special unknown list? HtmlDecode This is potentially changing the malicious javascript
- HTMLEncode () is the main thing:
- it handles any such characters Which are not part of the default 127 ASCI characters.
- It encodes the character, which can be interpreted incorrectly by the browser as valid HTML, CSS or Javascript, to prevent both webpage crashed and deliberately.
- Is it dangerous to use? Everything can be dangerous to use it, depending on how you use it, the question is not as much as "are you decoding"? Rather, "Are you decoding user data?" What you do with the result can definitely be dangerous to use, even by displaying it in the client, XSS may be the reason.
The FAR to be told about encoding and decoding is high, which I can write here, and people have consolidated it in front of me that I can tell you I can That's what XSS is and how you can stop it.
Comments
Post a Comment