Secure id value in mvc c #

I have a table like

  table Car(
   id int primary key,
   type nvarchar(300)
)

and I have mvc CarController with

[Httpost]
Edit(Car model){}

I have a view where Id is hidden and enter texbox, now I would like to know if someone overrides the hidden value and sends a different identifier, will it change the other line? how can i prevent this?

+4
source share
2 answers

For this, the best solution follows, in which you need to prevent identification.

  • Use an anti-corrosion token (in this case it will not help, but will cover most other cases).

  • . ,    , .    , .

+1

? , . , OwnerId Car Car by Id , () .

0

Source: https://habr.com/ru/post/1568948/


All Articles