I have placed the code below inside my forms. The request would then show a token in its cookie, and also a hidden field is created when my html is being generated. Note that both the cookie and the hidden field have different values.
<%= System.Web.Helpers.AntiForgery.GetHtml() %>
Everytime i postback, i have the validator shown below.
if (IsPostBack)
{
AntiForgery.Validate();
}
The weird part is that even if I change the cookie in the hidden field forcefully (using MITM software like burp). the validator would not even detect that the token has been changed.
I have listed down the generated tokens (refreshing the page a couple of times) and tried using one of the listed ones to manipulate the most current request. And to no surprise, the validator does not catch an error.
I read that the tokens are session based so I tried to use the token on another session (another user). and still, the validator does not catch anything.
Changing the token in the cookie would catch an error, but that cookie token is constant and is the same for all forms.
Is there anything wrong or any other missing pieces to this issue?