U
U
User992022-02-25 07:55:11
ASP.NET
User99, 2022-02-25 07:55:11

How to escape user input?

I work in a sheaf ASP.NET Core C#+Dapper
Users are registered in system. Found in the database records like <script>alert('sss')script> and so on.
The question is, should user input be escaped? If yes, how to do it?
using C# or Dapper? can you give some examples?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
V
Vasily Bannikov, 2022-02-25
@vabka

The question is, should user input be escaped? Yes.


If yes, how to do it?
using C# or Dapper?

At the front. Save it to the database as it is, but when you show it to someone, use HTML entity

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question