Detecting viewstate tampering

蓝咒 提交于 2019-12-05 23:07:45

The viewstate is signed with a machinekey (default servers mac) however if it's just the error you get then it could be a transmission error or similar (also if your running a farm make sure to set the same machine key on all machines)

Also if your after security don't store sensetive information in the viewstate, save it in the session instead.

You could add an encrypted checksum in the ViewState, and check whether it is still correct after the postback

EDIT: after reading the link posted by phoenix, it seems that there is already such a mechanism built in ASP.NET, so my suggestion is probably useless...

There is a build in mecanism that checks the viewstate for tamper attacks.

Are you getting The view state is invalid for this page and might be corrupted exception and suspecting tampering ? this exception taken when you remove controls between postbacks.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!